Describe the bug
When specifying a storage acl policy that uses match and/or equals, storage key paths are no longer displayed in the UI.
My Rundeck detail
To Reproduce
Steps to reproduce the behavior:
description: rduser, all access.
context:
application: 'rundeck'
for:
resource:
- allow: '*' # allow create of projects
project:
- allow: '*' # allow view/admin of all projects
project_acl:
- allow: '*' # allow admin of all project-level ACL policies
storage:
- allow: 'read' # allow read/create/update/delete for all /keys/* storage content
equals:
path: 'keys/test1'
- allow: 'read' # allow read/create/update/delete for all /keys/* storage content
match:
path: 'keys/test1/.*'
by:
group: teststorage
Expected behavior
The key storage UI should display any keys and folders that the user has permissions for and allow them to navigate them.
Desktop (please complete the following information):
Additional context
This bug doesn't affect access to the keys, both during job execution and in the UI. If I specify the path in the browser (i.e. http://localhost:4440/menu/storage/keys/test1/). I can still view the keys if I enter test1 in the input field located on the System > Key Storage page while at the same time I'm blocked for any folder and keys I don't have permission to.
Note: When I specify an equals or a match condition for a storage aclpolicy, it also appears to break default key selection in the project configuration.
Hi Dutch,
I ran some test with your very example just change some few things, try it in this way
description: testuser, all access.
context:
application: 'rundeck'
for:
resource:
- allow: '*' # allow create of projects
project:
- allow: '*' # allow view/admin of all projects
project_acl:
- allow: '*' # allow admin of all project-level ACL policies
storage:
- equals:
path: 'keys'
allow: [read]
- match:
path: 'keys/prueba2' # allow to view only the prueba2 keys in the path (prueba2)
allow: [read]
- equals:
path: 'keys/prueba2/prueba2'
allow: [read]
by:
group: user
I created a key called prueba3 on the same path and the testuser is only able to view prueba2.
Occur on 3.2.5 too. I followed this:
https://docs.rundeck.com/docs/administration/security/key-storage.html#examples
My ACL (doesn't work.):
description: rduser, all access.
context:
application: 'rundeck'
for:
resource:
- allow: '*'
project:
- allow: '*'
project_acl:
- allow: '*'
storage:
- equals:
path: 'keys'
allow: [read]
- match:
path: 'keys/something'
allow: [read]
- equals:
path: 'keys/something/.*'
allow: [read]
by:
group: user
@elioe 's way works in my case (referencing the key directly):
description: rduser, all access.
context:
application: 'rundeck'
for:
resource:
- allow: '*'
project:
- allow: '*'
project_acl:
- allow: '*'
storage:
- equals:
path: 'keys'
allow: [read]
- match:
path: 'keys/something'
allow: [read]
- equals:
path: 'keys/something/password1'
allow: [read]
by:
group: user
maybe I'm forgetting something?
@MegaDrive68k replacing "equals" with "match" seems to do the wild-card trick:
Before:
- equals:
path: 'keys/something/.*'
allow: [read]
After:
- match:
path: 'keys/something/.*'
allow: [read]
Thanks @runwaldo !
Most helpful comment
@MegaDrive68k replacing "equals" with "match" seems to do the wild-card trick:
Before:
After: