Friday, 2024-02-09

LuziHey could someone take a look at https://review.opendev.org/c/openstack/keystone/+/900028 ?07:48
Luzidmendiza[m], are you around?12:46
dmendiza[m]Luzi: 👋14:12
Luzihi14:12
Luzii am currently trying to understand the impact of the scopes and the current state of the RBAC implementation14:13
dmendiza[m]Yeah, it's somewhat confusing, but I can try to help. 😅14:14
Luzii am thinking about the restrictions a domain-manager (role or persona) should have and how this can be achieved14:15
Luziso far i did understand, that system scope is postponed or even not up for enforcing at all, due to the problems with breaking workflows:14:16
Luziadmins managing user resources in cases of operational need (e.g. evacuating a compute host)14:16
dmendiza[m]Right, so, per the latest Secure RBAC spec https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html we sort-of backpedaled on system-admin, not necessarily system scope14:17
Luziso for example a domain manager should be able to list only his domain, a admin schould be able to list all domains and a user from a project?14:18
Luzibecause in that policy the project scope is added14:18
Luzihttps://github.com/openstack/keystone/blob/master/keystone/common/policies/domain.py#L7414:18
dmendiza[m]Right, so, for that specific rule (identity:list_domains) the allowed personas would be:  Any admin regardless of scope (system-admin, domain-admin, project-admin) as well as any system-scoped persona (system-admin, system-manager, system-member, system-reader).14:21
dmendiza[m]actually, no sorry, that's wrong14:21
dmendiza[m]scratch that14:22
dmendiza[m]so it would be any admin in the allowed scope types14:22
dmendiza[m]so, system-admin and project-admin are allowed, but no domain-admin14:22
dmendiza[m]because scope_types does not allow domain-scoped tokens14:22
dmendiza[m]all system personas are allowed though14:23
dmendiza[m]because of implied roles.14:23
Luziokay? but a domain manager persona would in that case need a domain scope, right?14:23
dmendiza[m]right, so all we need to do for that policy would be to add `scope_types=['system', 'domain', 'project']14:23
dmendiza[m]that would allow domain-admin14:24
dmendiza[m]say we wanted to extend that to domain-manager14:24
dmendiza[m]then the policy would have to change to:14:24
dmendiza[m]base.RULE_ADMIN_REQUIRED + ' or (role:reader and system_scope:all) or  (role:manager and domain_id:%(target.domain_id)s)'14:26
dmendiza[m]And we'd need to make sure the target object has the domain_id property assigned for that API14:26
dmendiza[m]which I've realized in the last couple of weeks is kind of a mess14:26
dmendiza[m]because we are very inconsistent in how domain scope is checked14:27
dmendiza[m]but I have a few ideas on how to fix it14:27
Luziokay, so before a possible domain manager role can be applied, the domain scope has to be thoroughly defined14:27
Luzior persona14:28
Luzii still miss the part of where is the scope given? so right now what would an admins request look like, for creating a project in constrast to migrating ressources for users of said project. Do those scopes differ somewhere?14:29
dmendiza[m]Yeah, so, we can technically already make domain-managers with the existing default roles.  We just have to assign "manager" to a user on a specific domain.  The only part missing is adding the scope_type=[ ... , "domain" , ... ] to the relevant policy definitions and (role:manager and domain_id:%(target.domain_id)s) to the actual policy.14:30
Luzioh okay14:31
dmendiza[m]the scope comes into play in two parts of the workflow14:31
Luziand being in that scope would prevent the domain manager from managing ressources in the projects of the domain, because those are project-scoped, right?14:32
dmendiza[m]It depends on the policy for the individual APIs14:32
Luziokay, so this is very individual...14:32
Luzithank you dmendiza[m] 14:33
dmendiza[m]but, in general, I think most projects are only accepting project-scoped tokens14:33
LuziI will think about this and maybe update the spec in keystone :)14:33
dmendiza[m]so, yeah, to be clear, the scope is defined at role-assignment14:33
dmendiza[m]so to make a domain-manager you'd send a request to:14:33
dmendiza[m]PUT /v3/domains/$SPECIFIC_DOMAIN_ID/users/$USER_ID/roles/$MANAGER_ROLE_ID14:34
dmendiza[m]after that, the user is allowed to request tokens with domain scope that will have the manager role14:34
dmendiza[m]the user has to say they want a domain-scoped token when they submit their credentials14:35
dmendiza[m]and that token is not allowed by policies that only have system_scope=['project'] in their definition14:35
Luziyeah, okay i have to think about all of this, thank you dmendiza[m] 14:39
opendevreviewDouglas Mendizábal proposed openstack/keystone master: Normalize policy checks for domain-scoped tokens  https://review.opendev.org/c/openstack/keystone/+/90852417:34
opendevreviewDouglas Mendizábal proposed openstack/keystone-tempest-plugin master: Consistent and Secure RBAC (Phase 1)  https://review.opendev.org/c/openstack/keystone-tempest-plugin/+/90371320:38

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!