Replies: 1 comment 2 replies
-
hi @kennydo , if the cost of re-authenticate is too high, is it possible for you to try CN based auth? https://etcd.io/docs/v3.5/op-guide/authentication/rbac/#using-tls-common-name In this case you can skip Authenticate() so the cost from bcrypt can be avoided. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to run a multi-tenant etcd cluster where we use RBAC to limit each tenant's access to a particular prefix. For example, we'd like tenant X to have a user that grants them access only to the /userX prefix. When we add a new tenant, we'd do a series of steps to setup the user. It would look like: create role roleX, grant the role access to the /userX prefix, create user userX, then grant roleX to userX.
If I understand correctly, each of those actions increases the auth store revision. Since auth tokens are checked against the current auth store revision, this means that:
So in a worst case scenario, the timeline of events could look like:
T=0 users 1-99 authenticate
T=1 admin creates a new role
T=2 users 1-99 try to do an operation, but it fails due to the auth revision being old. They re-authenticate.
T=3 admin grants the new role some permissions
T=4 users 1-99 tries again to do an operation, but it fails due to the auth revision being old. They re-authenticate.
T=5 admin creates a new user
T=6 users 1-99 tries again to do an operation, but it fails due to the auth revision being old. They re-authenticate.
...and so on
Does this sound accurate? Do you have any advice on how to better control access in this scenario?
One potential workaround is lowering the bcrypt cost, which would decrease the server load of each authenticate call. But I think there's a problem with the pattern of invalidating every other user's auth token whenever a new user is set up.
Beta Was this translation helpful? Give feedback.
All reactions