open-consul/agent/consul
Matt Keeler 99e0a124cb
New ACLs (#4791)
This PR is almost a complete rewrite of the ACL system within Consul. It brings the features more in line with other HashiCorp products. Obviously there is quite a bit left to do here but most of it is related docs, testing and finishing the last few commands in the CLI. I will update the PR description and check off the todos as I finish them over the next few days/week.
Description

At a high level this PR is mainly to split ACL tokens from Policies and to split the concepts of Authorization from Identities. A lot of this PR is mostly just to support CRUD operations on ACLTokens and ACLPolicies. These in and of themselves are not particularly interesting. The bigger conceptual changes are in how tokens get resolved, how backwards compatibility is handled and the separation of policy from identity which could lead the way to allowing for alternative identity providers.

On the surface and with a new cluster the ACL system will look very similar to that of Nomads. Both have tokens and policies. Both have local tokens. The ACL management APIs for both are very similar. I even ripped off Nomad's ACL bootstrap resetting procedure. There are a few key differences though.

    Nomad requires token and policy replication where Consul only requires policy replication with token replication being opt-in. In Consul local tokens only work with token replication being enabled though.
    All policies in Nomad are globally applicable. In Consul all policies are stored and replicated globally but can be scoped to a subset of the datacenters. This allows for more granular access management.
    Unlike Nomad, Consul has legacy baggage in the form of the original ACL system. The ramifications of this are:
        A server running the new system must still support other clients using the legacy system.
        A client running the new system must be able to use the legacy RPCs when the servers in its datacenter are running the legacy system.
        The primary ACL DC's servers running in legacy mode needs to be a gate that keeps everything else in the entire multi-DC cluster running in legacy mode.

So not only does this PR implement the new ACL system but has a legacy mode built in for when the cluster isn't ready for new ACLs. Also detecting that new ACLs can be used is automatic and requires no configuration on the part of administrators. This process is detailed more in the "Transitioning from Legacy to New ACL Mode" section below.
2018-10-19 12:04:07 -04:00
..
autopilot autopilot: don't follow the normal server removal rules for nonvoters 2018-08-14 14:24:51 -07:00
fsm New ACLs (#4791) 2018-10-19 12:04:07 -04:00
prepared_query Allow ignoring checks by ID when defining a PreparedQuery. Fixes #3727. 2018-04-10 14:04:16 +01:00
state New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_client.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_endpoint_legacy.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_replication.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_replication_legacy.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_replication_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_server.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
autopilot.go Remove deprecated metric names 2018-05-08 16:23:15 -07:00
autopilot_oss.go Fix vet error 2017-12-18 18:04:42 -08:00
autopilot_test.go autopilot: don't follow the normal server removal rules for nonvoters 2018-08-14 14:24:51 -07:00
catalog_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
catalog_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
client.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
client_serf.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
client_test.go dns: implements prefix lookups for DNS TTL (#4605) 2018-10-19 08:41:04 -07:00
config.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
connect_ca_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
connect_ca_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
consul_ca_delegate.go Move connect CA provider to separate package 2018-06-14 09:42:15 -07:00
coordinate_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
coordinate_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
enterprise_client_oss.go Allow for easy enterprise/oss coexistence 2018-05-24 10:36:42 -04:00
enterprise_server_oss.go Allow for easy enterprise/oss coexistence 2018-05-24 10:36:42 -04:00
filter.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
filter_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
flood.go Add segment addr field to tags for LAN flood joiner 2017-08-30 11:58:29 -07:00
health_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
health_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
helper_test.go Cleans up some drift between the OSS and Enterprise trees. 2017-10-11 15:53:07 -07:00
intention_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
intention_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
internal_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
internal_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
issue_test.go Moves the FSM into its own package. 2017-11-29 18:36:53 -08:00
kvs_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
kvs_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
leader.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
leader_oss.go re-add Connect multi-dc config changes 2018-10-19 08:41:03 -07:00
leader_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
merge.go Takes the skip out of the client check. 2017-09-06 17:05:40 -07:00
merge_test.go Skips unique node ID check for old versions of Consul. 2017-09-05 22:57:29 -07:00
operator_autopilot_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
operator_autopilot_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
operator_endpoint.go pkg refactor 2017-06-10 18:52:45 +02:00
operator_raft_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
operator_raft_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
prepared_query_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
prepared_query_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
raft_rpc.go agent: move conn pool for muxed connections into separate pkg 2017-06-21 05:42:39 +02:00
rpc.go [BUGFIX] Avoid returning empty data on startup of a non-leader server (#4554) 2018-08-23 12:06:39 -04:00
rpc_test.go [BUGFIX] Avoid returning empty data on startup of a non-leader server (#4554) 2018-08-23 12:06:39 -04:00
rtt.go Added Coordinate.Node rpc endpoint and client api method 2017-10-26 19:16:40 -07:00
rtt_test.go Fix more unstable tests in agent and command 2018-09-12 14:49:27 +01:00
segment_oss.go Remove deprecated metric names 2018-05-08 16:23:15 -07:00
serf_test.go pkg refactor 2017-06-10 18:52:45 +02:00
server.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
server_lookup.go More cleanup from code review 2017-08-30 12:31:36 -05:00
server_lookup_test.go More cleanup from code review 2017-08-30 12:31:36 -05:00
server_oss.go agent/consul: RPC endpoints to list roots 2018-06-14 09:41:50 -07:00
server_serf.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
server_test.go do not bootstrap with non voters 2018-09-19 17:41:36 -07:00
session_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
session_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
session_timers.go address review comments 2017-07-07 09:22:34 +02:00
session_timers_test.go rpc: refactor sessionTimers and fix racy tests 2017-07-07 09:22:34 +02:00
session_ttl.go Remove deprecated metric names 2018-05-08 16:23:15 -07:00
session_ttl_test.go Moves the FSM into its own package. 2017-11-29 18:36:53 -08:00
snapshot_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
snapshot_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
stats_fetcher.go Fix stats fetcher healthcheck RPCs not being independent 2018-08-14 14:23:52 -07:00
stats_fetcher_test.go Fix more unstable tests in agent and command 2018-09-12 14:49:27 +01:00
status_endpoint.go Move autopilot to a standalone package 2017-12-11 16:45:33 -08:00
status_endpoint_test.go rpc: run agent/consul tests in parallel 2017-07-07 09:22:34 +02:00
txn_endpoint.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
txn_endpoint_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
util.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
util_test.go pkg refactor 2017-06-10 18:52:45 +02:00