Replies: 6 comments 11 replies
-
|
What if we simplify it by having a single env var for mapping groups to permissions? For example: This way we wouldn’t need separate variables for each role, and it would be easier to manage mappings in one place. |
Beta Was this translation helpful? Give feedback.
-
|
Perhaps we could simply add a This way, Dozzle reads the user’s SSO groups from the header and automatically assigns the corresponding roles on login. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @mitchplze for the explanation. I don't think I understood the first time. But your examples of what an admin would do helped a lot. So I see multiple things being asked here:
I prefer defaults that would just work. So if it's just adding What do you all think? |
Beta Was this translation helpful? Give feedback.
-
|
@dima-bzz I think there is a bug right now. It's actually comma separated and not |. 🤨 |
Beta Was this translation helpful? Give feedback.
-
|
@amir20 This was probably taken from our earlier discussion about how to handle roles. |
Beta Was this translation helpful? Give feedback.
-
|
You could implement it like this: ...
switch role {
case "shell", "dozzle_shell":
roles |= Shell
case "actions", "dozzle_actions":
roles |= Actions
}
...Or using a map for more flexibility: ...
var oidcGroupToRole = map[string]Role{
"dozzle_shell_group": Shell,
"dozzle_actions_group": Actions,
"dozzle_download_group": Download,
}
...
switch r {
case "all":
return All
default:
if gr, ok := oidcGroupToRole[r]; ok {
roles |= gr
} else {
log.Debug().Str("role", role).Msg("ignored unknown role/group")
}
}
...This way you can easily map multiple group names to roles and handle unknown roles gracefully. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Originally posted by @amir20 in #4118 (reply in thread)
Hello,
Currently the
Client-Role(customizable) authorization header in Dozzle expects a specifically-formatted value like:roles:shell|actions|download. This means one has to write a custom reverse-proxy rule to create and then inject a new header on authentication, with data sourced (most likely) from a custom OIDC claim that also has to be created and maintained separately, and you have to remember the formatting/options.Currently:
Rather than do that, I think Dozzle should instead inspect the forwarded header value for 'tags' or keywords, so that existing OpenID group claims can be passed seamlessly through the proxy, to Dozzle, as an existing header (
X-Forwarded-Groupsin a lot of cases).That header should already look like an array:
["group1","group2","group3"]So my proposal:
Example:
Then one simply creates those groups on their identity provider, and adds the users to the appropriate groups.
Example with above config:
X-Forwarded-Groupsheader from the SSO provider as:["dozzle_actions","dozzle_shell","git_maintainer","something_else"]If you don't want that level of granularity, one could just map them all to the same group:
So:
["dozzle_admins","something_else"]would grant the user all the privileges on login, as the same group is used for all.Maintaining the current functionality of "no header = all privs" is a good one (if not a bit unsafe), if people don't want to bother setting this up at all - it would be very simple, and no additional vars.
Hope that makes sense. I'm away for a few days but will reply mid next-week.
Beta Was this translation helpful? Give feedback.
All reactions