Skip to content
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

auth: support accessing all keys for non-root roles #7468

Closed
heyitsanthony opened this issue Mar 9, 2017 · 1 comment · Fixed by #7649
Closed

auth: support accessing all keys for non-root roles #7468

heyitsanthony opened this issue Mar 9, 2017 · 1 comment · Fixed by #7649
Assignees
Milestone

Comments

@heyitsanthony
Copy link
Contributor

The current v3 auth code assumes that a role will cover a set of intervals [a, b). However, this is insufficient for including the entire key set since if b is fixed there is always a c where c > b. The Range code handles this by treating [a, '\x0') as meaning all keys >= a; auth should probably do the same.

@mitake
Copy link
Contributor

mitake commented Mar 10, 2017

I see, the case of [a, '\x0') should be supported, too.

Anyway, I want to refine current permission check mechanism of auth code with interval tree. Can I assign it to myself?

@heyitsanthony heyitsanthony added this to the v3.3.0 milestone Mar 14, 2017
mitake added a commit to mitake/etcd that referenced this issue Apr 3, 2017
This commit adds a new option --open-ended to the command etcdctl role
grant-permission. If the option is passed, an open ended permission
will be granted to a role e.g. from start-key to any keys those are
larger than start-key.

Example:
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant r1 readwrite a b
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant --open-ended r1 readwrite c
$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [a, b) (prefix a)
        [c, <open ended>
KV Write:
        [a, b) (prefix a)
        [c, <open ended>

Note that a closed parenthesis doesn't follow the above <open ended>
for indicating that the role has an open ended permission ("<open
ended>" is a valid range end).

Fixes etcd-io#7468
mitake added a commit to mitake/etcd that referenced this issue Apr 4, 2017
This commit adds a new option --from-key to the command etcdctl role
grant-permission. If the option is passed, an open ended permission
will be granted to a role e.g. from start-key to any keys those are
larger than start-key.

Example:
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant r1 readwrite a b
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant --from-key r1 readwrite c
$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [a, b) (prefix a)
        [c, <open ended>
KV Write:
        [a, b) (prefix a)
        [c, <open ended>

Note that a closed parenthesis doesn't follow the above <open ended>
for indicating that the role has an open ended permission ("<open
ended>" is a valid range end).

Fixes etcd-io#7468
mitake added a commit to mitake/etcd that referenced this issue Apr 4, 2017
This commit adds a new option --from-key to the command etcdctl role
grant-permission. If the option is passed, an open ended permission
will be granted to a role e.g. from start-key to any keys those are
larger than start-key.

Example:
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant r1 readwrite a b
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant --from-key r1 readwrite c
$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [a, b) (prefix a)
        [c, <open ended>
KV Write:
        [a, b) (prefix a)
        [c, <open ended>

Note that a closed parenthesis doesn't follow the above <open ended>
for indicating that the role has an open ended permission ("<open
ended>" is a valid range end).

Fixes etcd-io#7468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants