etcd-workbench icon indicating copy to clipboard operation
etcd-workbench copied to clipboard

role feature has some bugs

Open yurneroma opened this issue 7 months ago • 1 comments

i use etcdctl create a role which can read all keys, can write under /test. and apply to a user.
i use etcdctl to list all keys, the command is: ETCDCTL_API=3 etcdctl --user=mabin:password get / --prefix
it can work well.

but when i login in with etcd-workbench gui, it shows permission denied. the snapshot is :

Image Image Image Image

yurneroma avatar May 12 '25 08:05 yurneroma

Hello, as I currently don’t have a computer nearby and cannot check the specific issue, based on my memory, I suspect it might be caused by the pagination feature. You can try the following steps to temporarily resolve the problem and provide me with an opportunity to verify:

Go to Settings > Keys > turn off Pagination Query.

tzfun avatar May 12 '25 09:05 tzfun

@yurneroma I reproduced your issue and found that this is reasonable. The read permission you set for the role is not for all keys, but only for keys prefixed with "/". In etcd workbench, if no namespace is set, reading keys means accessing all keys. Therefore, the etcd server will prompt a permission denied error because the role does not have read permissions for all keys. Adding a namespace set to "/" in your configuration will allow normal access.

Image

If you need to set up permissions that support accessing all keys, you should configure it like this:

Image

In etcd workbench, you'll see that the access permissions for all keys and prefix-based access are displayed differently.

Image

tzfun avatar Jun 04 '25 07:06 tzfun