-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get all keys with restricted user #8157
Comments
The current auth policy seems too strict here. Probably a user should be able to issue |
@heyitsanthony that would work, but require a separate call. In the spirit of doing what the user expects -- if I say get all, what I'm really saying is.. get all (that I have access to). I honestly think the simplest answer is just return what you're allowed to see. And if that's nothing, return an empty set. I'd almost suggest that permission denied shouldn't happen on a get, perhaps just an empty result -- the extra benefit is the client won't know if the key exists or not. Right now I can infer key existence, if not it's value, from the return message. |
@japhar81 do other systems behave like this? |
@heyitsanthony I can attest that MapR's HDFS works that way. |
OK, I can think of some problems with that model for a system like etcd. For instance, if a user asks for "k" without permissions and gets an empty response, despite "k" existing. The client has no way to tell whether the key does not exist or if it just lacks permission without extra RPCs. What if it's checking for a key as some part of an election protocol? Should the client then proceed as if there's no leader? Likewise, suppose that same user issues a transaction with I'd much rather reject it outright than have these cases that will silently break. |
How about just a strict option of some sort? Give me the choice.. behave as you do now, or just return what I can see. Or even introduce a new command, get-allowed or something? I don't have a strong implementation preference, just a strong belief that a client should be able to discover what it's got access to see.. |
@hzektser @heyitsanthony @japhar81 I understood the motivation of reading all granted keys. etcd v3's range based permission would be a little bit complex than file system model (related discussion can be found here: #6359 (comment)). So checking that permission configuration won't result unintentional granting is important. Possibly changing the semantics of |
@xiang90 I'm reopening this PR because the client side change is still undergoing (I should remove |
/cc @jpbetz |
@mitake Any interest in keeping this open? Looks like the mitake@b0ecc0c WIP was never merged. |
@jpbetz currently I don't have emergent use cases of this feature. If there are users who wants this, I'll revive the commit. But closing this issue temporally wouldn't be a problem, I think. |
Sounds good. Closing this for now since there is no activity. If there is interest or activity on this in the future we can easily reopen. |
Given a base install (with auth enabled) and some test data;
Let's say we have a simple test user with some permissions;
This works as root to get all keys as root;
ETCDCTL_API=3 ./etcdctl --user="root:root" get --prefix=true ""
but fails as the test user;
I would have expected this to return all the keys test1 has access to.. Failing that, is there any way for test1 to discover what keys it's got access to?
The text was updated successfully, but these errors were encountered: