Friday, 2025-04-11

*** mhen_ is now known as mhen01:33
d34dh0r53no reviewathon today :)12:52
bretonhello14:55
bretoni have a question about https://review.opendev.org/c/openstack/keystone/+/85184514:56
bretonso... it got merged. It introduced a uniquness constraint in https://review.opendev.org/c/openstack/keystone/+/851845/6/keystone/common/sql/migrations/versions/bobcat/expand/b4f8b3f584e0_fix_incorrect_constraints.py14:57
bretonhow? There was no uniqueness before, users created a bunch of trusts that are duplicate, and now there is a constraint added14:58
bretonfor me the upgrade fails with oslo_db.exception.DBDuplicateEntry15:00
gtemabreton - unfortunately you would need to resolve those manually. Duplicated entries are a potential security vulnerability, so you definitely don't want them to be present15:02
bretonwhy are they a security vulnerability? Was it discussed somewhere?15:05
gtemano sure. Potential vulnerability is that you have multiple trusts with the same params and when you delete it you may have an impression there is no trust anymore, but it is still there (as duplicate)15:06
gtemaremaining_uses is also not being properly counted, as well as redelegation_count15:06
bretonwhy? A trust has an id. And that id is required to use it.15:12
bretonit also means that the users who recorded that id will now lose it.15:13
gtemabut when you login using trust its ID is not passed. Keystone picks one (eventually a random one)15:13
bretonno, it is passed.15:13
gtemaoh, right15:14
bretonhttps://docs.openstack.org/api-ref/identity/v3-ext/#consuming-a-trust15:14
gtemabreton - anyway, the expected constraint was added 10 years ago in https://opendev.org/openstack/keystone/commit/59b09b50ff15df9975832dbfba42e0c984591e48  so it is expected that it is there. Perhaps (and most likely this was the point of the change you referred to) it was not properly applied due to the code bug15:21
bretonit was never added, and was never expected in OpenStack. https://opendev.org/openstack/glance/src/branch/master/glance/common/trust_auth.py#L47-L52 - Glance doesn't even consider that a trust creation can fail normally15:43
bretonmistral, same: https://github.com/openstack/mistral/blob/688c4e5743df5b9c2c81ac43fcdbdd817e25cf1d/mistral/services/security.py#L110 15:45
bretonmagnum, same - no logic around existing trust: https://github.com/openstack/magnum/blob/ea302babcbe00f2c3d3503bda133fcc5a58dbe1b/magnum/common/keystone.py#L20915:46
bretonzaqar, same: https://github.com/openstack/zaqar/blob/master/zaqar/notification/tasks/trust.py#L6015:47
bretonaodh: https://github.com/openstack/aodh/blob/master/aodh/api/controllers/v2/alarms.py#L46315:48
bretoni am investigating it further... it seems that there was some activity around this issue in yoga, commit afce7ca8eb15:57
bretonalright, i still cannot fully describe the issue, but it is not as bad as it seems20:21
bretonthe unique constraint almost never works even today20:22
bretonthe constraint gets triggered if one tries to create a trust with expiration date. Without expiration the trust can be created with the same params as many times as needed.20:23

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