46 Commits

Author SHA1 Message Date
James Phillips
ec90404df0
Adds fine-grained watch support to ACL endpoints. 2017-01-25 09:58:22 -08:00
James Phillips
ca7a243b70
Adds ACL management support to the agent. 2016-12-14 07:07:41 -08:00
James Phillips
8b67991ef7
Adds complete ACL coverage for /v1/session endpoints. 2016-12-12 21:59:22 -08:00
James Phillips
99e810f9c7
Adds complete ACL coverage for /v1/internal/ui/node endpoints. 2016-12-12 18:22:10 -08:00
James Phillips
9c785c7022
Fixes implementation of node ACLs for /v1/catalog/node/<node>.
This would return a "permission denied" error, but this changes it to
return the same response as a node that doesn't exist (as was originally
intended and written in the code comments).
2016-12-12 16:53:31 -08:00
James Phillips
35475a66df
Adds full ACL coverage for /v1/health endpoints. 2016-12-12 16:28:52 -08:00
James Phillips
bcf1ffad99
Adds complete ACL coverage for /v1/coordinate/nodes and Coordinate.Update RPC. 2016-12-12 14:52:27 -08:00
James Phillips
2ace618bf9
Adds complete ACL coverage for /v1/catalog/service/<service>. 2016-12-12 08:34:15 -08:00
James Phillips
8038f21684
Adds complete ACL coverage for /v1/catalog/nodes. 2016-12-10 16:49:19 -08:00
James Phillips
9b7564490c
Adds complete ACL coverage for /v1/catalog/deregister.
This included some state store helpers to make this more efficient.
2016-12-09 21:04:44 -08:00
James Phillips
800c67c58a
Adds complete ACL coverage for /v1/catalog/register. 2016-12-09 21:04:37 -08:00
James Phillips
ae1cd5b47d
Switches all ACL caches to 2Q. 2016-08-09 11:00:22 -07:00
James Phillips
734cc0b3d5
Increases the ACL cache size to 10k. 2016-08-04 18:03:07 -07:00
James Phillips
0a9060bb84
Adds remaining core replication tests. 2016-08-04 16:33:40 -07:00
James Phillips
f44bc7e97a
Removes a TODO comment.
Decided we don't need to log anything about the token here. If the
token is not valid then the client will get an error about that, so
anything that can happen here is related to talking to the server in
the ACL datacenter, so not specific to the token.
2016-08-04 07:46:59 -07:00
James Phillips
e831727923
Activates fallback to replicated ACLs. 2016-08-03 21:24:09 -07:00
James Phillips
d336bdd7b0
Adds basic ACL replication plumbing. 2016-08-03 21:24:04 -07:00
Calvin Leung Huang
912887a4db Fix substring length on obfuscated token 2016-07-05 15:53:30 -04:00
Calvin Leung Huang
4bd5523276 Obfuscate token for lookupACL error 2016-03-15 17:16:25 -04:00
James Phillips
90898dff98 Adds missing token redact in the GET path. 2016-02-26 15:59:00 -08:00
James Phillips
87ceb2f3de Changes to more idiomatic "ok" pattern for prefix getter. 2016-02-24 16:26:43 -08:00
James Phillips
899dcfe053 Completes switch of prepared_query ACLs to govern query names. 2016-02-24 01:26:16 -08:00
James Phillips
67de77482e Creates new "prepared-query" ACL type and new token capture behavior.
Prior to this change, prepared queries had the following behavior for
ACLs, which will need to change to support templates:

1. A management token, or a token with read access to the service being
   queried needed to be provided in order to create a prepared query.

2. The token used to create the prepared query was stored with the query
   in the state store and used to execute the query.

3. A management token, or the token used to create the query needed to be
   supplied to perform and CRUD operations on an existing prepared query.

This was pretty subtle and complicated behavior, and won't work for
templates since the service name is computed at execution time. To solve
this, we introduce a new "prepared-query" ACL type, where the prefix
applies to the query name for static prepared query types and to the
prefix for template prepared query types.

With this change, the new behavior is:

1. A management token, or a token with "prepared-query" write access to
   the query name or (soon) the given template prefix is required to do
   any CRUD operations on a prepared query, or to list prepared queries
   (the list is filtered by this ACL).

2. You will no longer need a management token to list prepared queries,
   but you will only be able to see prepared queries that you have access
   to (you get an empty list instead of permission denied).

3. When listing or getting a query, because it was easy to capture
   management tokens given the past behavior, this will always blank out
   the "Token" field (replacing the contents as <hidden>) for all tokens
   unless a management token is supplied. Going forward, we should
   discourage people from binding tokens for execution unless strictly
   necessary.

4. No token will be captured by default when a prepared query is created.
   If the user wishes to supply an execution token then can pass it in via
   the "Token" field in the prepared query definition. Otherwise, this
   field will default to empty.

5. At execution time, we will use the captured token if it exists with the
   prepared query definition, otherwise we will use the token that's passed
   in with the request, just like we do for other RPCs (or you can use the
   agent's configured token for DNS).

6. Prepared queries with no name (accessible only by ID) will not require
   ACLs to create or modify (execution time will depend on the service ACL
   configuration). Our argument here is that these are designed to be
   ephemeral and the IDs are as good as an ACL. Management tokens will be
   able to list all of these.

These changes enable templates, but also enable delegation of authority to
manage the prepared query namespace.
2016-02-23 17:12:43 -08:00
Ryan Uber
3ef482de7f consul: split ACL cache into a reusable struct 2015-06-18 18:13:29 -07:00
Ryan Uber
cee0af8d5c consul: fast path a typed nil during ACL filtering 2015-06-12 16:46:15 -07:00
Ryan Uber
389f89274a consul: fail badly if an unsupported type is passed to the ACL filter 2015-06-11 17:06:35 -07:00
Ryan Uber
e06e5c5e99 consul: fix log message 2015-06-11 15:00:26 -07:00
Ryan Uber
71f21fdea7 consul: testing acl filters in isolation 2015-06-11 14:14:43 -07:00
Ryan Uber
a4d34b66d6 consul: testing internal endpoint acl filtering 2015-06-11 13:05:33 -07:00
Ryan Uber
d217c25668 consul: rename function to avoid collision and clean up 2015-06-11 13:04:47 -07:00
Ryan Uber
6623538c93 consul: break acl filtering into a separate struct 2015-06-11 12:08:21 -07:00
Ryan Uber
5b90b0f249 consul: use anonymous function for acl filtering 2015-06-10 18:43:48 -07:00
Ryan Uber
5fed1b5dc3 consul: filter internal endpoints for acls 2015-06-10 18:40:40 -07:00
Ryan Uber
c68f1dab8a acl: initial pass at service discovery acls 2015-06-10 18:40:09 -07:00
Armon Dadgar
e56007753d consul: Provide ETag to avoid expensive policy fetch 2014-08-18 15:46:59 -07:00
Armon Dadgar
84488ed1f0 consul: Starting token enforcement 2014-08-18 15:46:23 -07:00
Armon Dadgar
2d5e869e69 consul: Prevent resolution of root policy 2014-08-18 15:46:23 -07:00
Armon Dadgar
10db4c7c8f consul: Resolve parent ACLs 2014-08-18 15:46:23 -07:00
Armon Dadgar
ef171ca344 consul: Support management tokens 2014-08-18 15:46:23 -07:00
Armon Dadgar
a82439c713 consul: Adding some metrics for ACL usage 2014-08-18 15:46:23 -07:00
Armon Dadgar
827e7c9efa consul: Create anonymous and master tokens 2014-08-18 15:46:22 -07:00
Armon Dadgar
fe86c8c5ee consul: Testing ACL resolution 2014-08-18 15:46:22 -07:00
Armon Dadgar
0c912f2c98 consul: Use Etag for policy caching 2014-08-18 15:46:22 -07:00
Armon Dadgar
b5e22203fc consul: Support conditional policy fetch 2014-08-18 15:46:22 -07:00
Armon Dadgar
338f11c6cf consul: Enable ACL lookup 2014-08-18 15:46:22 -07:00
Armon Dadgar
97a737b1ee consul: Pulling in ACLs 2014-08-18 15:46:21 -07:00