Tuesday, 2025-02-25

knikollakeekz: group memberships carried through mapping rules have a time limit and require renewal through periodic re-authentication  https://specs.openstack.org/openstack/keystone-specs/specs/keystone/ussuri/expiring-group-memberships.html00:55
knikollait is managed through the [federation] default_authorization_ttl configuration option https://github.com/openstack/keystone/blob/187bcad52219c2c99b572b3d5463dfa7b2128201/keystone/conf/federation.py#L12000:58
knikollain your case default_authorization_ttl = 720, so 12 hours00:59
opendevreviewYaguang Tang proposed openstack/keystoneauth master: fix logic issue for getting IDP data with HTTP 400 response  https://review.opendev.org/c/openstack/keystoneauth/+/94217101:17
*** mhen_ is now known as mhen03:00
opendevreviewMerged openstack/keystone master: docs: Remove warning about unified limits API  https://review.opendev.org/c/openstack/keystone/+/89312008:59
knikollagtema: thank you for stepping up to be keystone ptl. amazing work! 13:42
gtemathks knikolla, glad to see you here again13:42
knikolla:) would love to hear more about the federation work that you're doing and happy to help a bit here and there13:43
knikollathough unfortunately i don't have anymore work-time allocated to openstack things. 13:44
gtemasad. A start of federation work is in my Rust reimplementation of Keystone which is for the beginning necessary as a "library"13:45
gtemaJust around an hour ago was reading an article "quantum computers are now the reailty" and think - we need to move very fast to be ready for eventual changes in crypto area13:46
gtemahttps://www.forbes.com/sites/chuckbrooks/2025/02/22/quantum-computing-has-arrived-we-need-to-prepare-for-its-impact/ - pretty interesting read13:46
knikollainteresting. so you're reimplementing the keystone api?13:48
gtema1st idea was to have a library for accessing keystone DB, but it immediately evolved into "if we have that anyway it just cost a few loc to add API": https://github.com/gtema/keystone13:49
gtemaperformance difference is HUGE13:49
gtemait is a very long way to go. Initially I only wanted to have certain parts that are involved in the federation work13:50
gtemabtw, also read about next steps https://gtema.github.io/posts/rethinking-openstack-auth-authz/13:50
gtemaI plan to implement that exactly in the new separate component not to break users and allow CSPs deploy that on older versions of OpenStack (sadly the reality shows how old lot of clouds are)13:51
knikollareading the blog post now, give me a few minutes13:55
gtemasure, no hurry :)13:55
knikollacan you tell me a bit more about the problem "Lack of an easy possibility to easily exchange JWT for an OpenStack token."?14:00
gtemaflexibility - every user (customer) must be able to configure own rules, register own provider, define own mapping14:01
knikollaah, that makes sense.14:01
gtemathe use case: github action provides a JWT and we want to exchange it for fernet14:01
knikollamod_auth_oidc makes it so you can't have per-domain identity providers, and every reconfiguration requires admin and restart14:02
gtemabut every domain should be defining own mapping rules for that and grant permissions14:02
gtemaprecisely - therefore I want to get rid of mod_auth_oidc and merge this into the keystone directly14:02
gtemaand sadly while POCing on that figured out that python libs for oidc are in a very bad shape14:03
knikollai think that makes sense. in our (my employer's) use cases we have put an identity broker in front of keystone that handles the multiple idp part. 14:03
knikollaso it's: external idp 1 2 and 3 -> keycloak -> keystone14:03
gtemamany are doing exactly that because otherwise it is not possible14:03
gtemaissue here is that customers are still not really able to do necessary work themselves unless you grant them into the broker IDP which is also not what everybody wants14:04
knikolla(funny parenthesis, but we (the keystone team at the time of 6-7 years ago) wanted to start work on an identity brokering service that handled just mapping rules to issue tokens, and written in rust https://opendev.org/x/spectroscope )14:05
knikollanothing came out of that as that was about the time when most people stopped getting funded to work on openstack on the keystone side14:06
gtemahehe, funny14:06
gtemaI am not sure it makes any sense (or any capacity) to implement brokering in openstack. There are lot of tools doing so already14:07
gtemait is just that openstack does not integrate good with them14:07
knikollathat's what the federation plugin sort of does already14:08
knikollait's just about making it more dynamic and configurable so that authN can be separate from the projects/role assignments piece of keystone. 14:09
gtemayupp14:09
gtemathe mapping resource is also not flexible enough to address all potential use cases. Basically data model is not fitting well into the authN/Z world of today14:10
knikollathe moment you start dealing with multiple service offerings, from the perspective of a CSP, there is no data model that fits well.14:11
knikollato your point of "Lack of possibility to integrate external authorization systems."14:11
knikollai found that what worked best for us is having a centralized service that "pushed" permissions to each of the individual services that we offer to customers (openstack, openshift, etc)14:12
knikollawe used https://coldfront.readthedocs.io/en/latest/ for that14:13
knikollabut again, that doesn't work for the use case of allowing users to handle their own IdPs and users14:13
gtemayeah. I think pretty much every CSP offering more than OS would have some external system where authZ is being managed. We should allow openstack better consume that.14:14
gtematherefore I was playing with role-assignment backend plugin to fetch info from external source (openfga in that particular case). and on the other side OS services would delegate authz decision to OpenPolicyAgent14:15
gtemaafter I myself came to the idea and prototyped a lot found that it was also already present as an idea in OS just that it never landed14:16
gtemahttps://www.openstack.org/videos/summits/berlin-2018/dynamic-policy-for-openstack-with-open-policy-agent14:16
gtemaI work on implementing this in prod now at my employer14:17
knikollayou'll see that a lot of ideas on how to make keystone and federation better were 80% implemented (because that takes 20% of the effort) during 2018 and 2019, haha. 14:17
gtemayeah14:17
knikollai am myself guilty of a lot of that too14:17
knikollaas you may have seen above from "expiring group membership" or "federated user crud"14:17
gtemayes, those are cool things14:18
knikollabut they didn't go far enough14:18
gtemayeah. I think back those days federation was not really a thing for CSPs, and nowadays implementation does not fit current requirements14:19
knikolla"Implement SCIM support so that customer is able in a self-service manner synchronize domain users from an external IdP"14:19
knikollaThis is tricky, because SCIM by default only has users and groups as concepts14:20
gtemaI know. For now I have implemented SCIM as a proxy (translating to keystone api) which can be deployed by customer themselves for their domain14:20
gtemaanother challenge is the auth of the scim itself14:21
gtemabut anyway - this is just necessary14:21
knikollacool stuff, I did something similar. SCIM is exposed as an API through ColdFront (our self-service project/user management service) and it exposes all projects of a user as groups "members of project X" or Y. And that ties into the part of the code in coldfront that pushes the permissions to create users and role assignments through federated user crud api. 14:23
knikollaso it's a layer above all the cloud services that we provide.14:24
gtemayeah - we both have cool ideas. Just need to bring them to the keystone ;-)14:24
knikollain your use case you want keystone to provide authentication to services external to openstack too? 14:26
gtemanot really14:26
gtemakeystone is far away from being an IdP itself. Ideally this would be possible, but I do not think it is worth of effort14:26
gtemaI mean if we want to allow external auth in keystone this requires to reimplement keycloak14:27
keekzyeah we're using dex.14:27
keekzso is it possible to keep the groups permanently? does setting default_authorization_ttl=0 mean no groups, or permanent groups?14:28
gtemaif we however would allow serving as flexible oauth provider it would probably do the work. Emit JWT that other services would be able to validate14:28
knikollakeekz: 0 disables persisting groups. that means the user can't create application credentials or trusts with the group membership carried through mapping rules. 14:29
knikollai wouldn't reccomend setting it to permanent (or a very high number) because there is no mechanism to keep things in sync14:29
knikollaif a user is deleted from your idp, or they are removed from the group, keystone wouldn't know14:29
knikollatherefore the user would still have access through the application credential14:30
knikollayou can permanently assign roles or groups to the user though using the CLI or API, this only applies for group memberships carried through mapping rules14:31
knikollagtema: i see your point, but for most of those user cases that is solved by setting an identity broker in front of keystone, for authN. for authZ I think openpolicy agent or something similar  would be amazing. 14:33
gtemahttps://github.com/gtema/oslo.policy.opa - I currently work on implementing tests autogeneration14:34
gtemaproblematic is (drumbeats...) neutron14:34
gtemaI have seen repo from 7 years ago trying to do similar in golang, but I do this accessing policies from the code directly what gives much more possibilities14:35
knikollaand that work would potentially make work for me much easier too, since instead of pushing permissions to keystone every time a role assignment changes for our users, I would push it to OPA and in an ideal world, all our services would use that as a source of truth for authZ. 14:35
knikollathat leaves keystone to just be a middleware service that is configurable to fetch information for authN and authZ and issue tokens containing it for consumption by openstack services. 14:36
gtemavery right - this is exactly what in general I am willing to achieve. Focus on authN in Keystone and leave authZ itself for OPA14:37
gtemaOPA gives much more flexibility in regards to fine-granular access beyond roles14:38
gtemaeventually we could manage opa policies in keystone14:38
gtemato implement the necessary bundling and central control plane for policies of OpenStack14:38
gtemathe keystone policy rule... (full message at <https://matrix.org/oftc/media/v1/media/download/AY9bar41Q05sEJLCf2BlxCmdYLm2_4ofp6zpqkg4Ag6ey9FVhVshbz_tOcgn15ywpTtEgiDB9s2q_eKsHTBFH5tCeVhaadwwAG1hdHJpeC5vcmcvT3VRd2p5a0RaeUtBeU9mY3puQWJOdVl3>)14:40
gtemano human is able to decode it reasonably14:40
knikollahahaha, indeed14:41
gtemaand since I parse it myself I suspect humans that developed this rule missed few necessary brackets so that oslo-policy treats it not as human would read14:42
gtemamaybe it is not this rule, but I remember seeing something similar where ordering was not matching the text form14:42
knikollapolicy in general is something i feel we could have done so much better14:44
knikollabut really struggled to gain any traction as it required broader openstack implementation14:45
gtemaand I guess opa would help us solving this now14:45
knikollaI sort of like what application credentials did, in overlaying on top of policy access_rules14:46
gtemayeah. Sadly you can't alter access rules (i.e. if you did a typo)14:47
gtemaand also lot of CSPs nowadays complain about need to have concept of service account, which is something similar to app creds but not bound to a single "human"14:47
gtemaof course you can create a new "technical user" and get app creds for it, but i.e. in the case of github workload auth you can't do this reasonably14:48
gtemait's too dynamic14:49
knikollaam i correct in assuming you mean letting your users create service accounts? 14:50
gtemayes. And in the federation case (the JWT as desribed in my doc) would be sort of dynamic14:51
gtemabut one of the issues with tech accounts is that you can't actually have account without password set14:51
gtemaso if you want to have service account and create app creds for it you need to have password set14:51
gtemanot even with trusts you can bypass this14:51
knikollaif you know the claims that will be present in the JWT coming from github, you can map them to the correct permissions14:52
gtemayes, but in order for rest of openstack to work there must be also user_id14:53
knikollayou can precreate the user https://github.com/nerc-project/coldfront-plugin-cloud/blob/3cc766c46b0541109df5a8fed3c2e675d2b065f7/src/coldfront_plugin_cloud/openstack.py#L27714:54
knikollaif you know the unique identifier14:54
gtemafor the external workload case (github workflow JWT) there are plenty of combinations of repo/workflow/actor/branch ... Of course you can also pre-create users, but there should be also possibility to reduce this (not every combination require dedicated user).14:56
gtemaand if we talk about service accounts and app creds it still does not help - you can only create appcreds after loggining-in as the user14:57
knikollai see your point14:59
knikollathat's not a use case i've had to deal with14:59
knikollaand... uh... i'll try to spend some time next week to put the federated user crud stuff in keystoneclient and openstackclient15:00
gtemayou should not do anything in keystoneclient itself - time is ticking for killing it off. We finalize migration in openstackclient to have rely on sdk only15:01
knikollain sdk then15:01
gtemacool. Honestly the data model of the user is just awesome: 6 tables with mixed relation types (1to1, 1tomany) and this should be all combined in the single operation15:05
knikollahahaha :) 15:05
keekz@gtema the service account / machine user is exactly what i'm trying to do. also through github. i have a github action which runs terraform to do a provisioning test (create network, servers, etc) in each of our environments. and i'm sure my users (other internal teams) would need/want to do the same15:05
gtemakeekz - I know. I want to implement auth from GT just like any other cloud - exchange of JWT to keystone token with required privileges (as configured by the user itself)15:06
gtemasadly precisely as we discuss above data model in keystone now is not flexible enough to allow this easily and requires "foundational" changes15:07
knikollahave to head out for now o/15:09
gtemacy, was nice to chat with you again15:17

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