Repository navigation
squid-19.2.7: Backport/618 - #35
Merged
Merged
Conversation
The EC2Engine (S3 Keystone auth) previously returned nullptr for its ACL strategy, meaning S3 requests could only match ACLs by the bare project_id. This prevented Swift-format ACL entries (project:user) from being honored by S3 requests. Implement a full ACL strategy in EC2Engine::get_acl_strategy() that matches all 6 combinations of project/user UUIDs and names, mirroring the existing logic in TokenEngine::get_acl_strategy(). This enables bidirectional ACL interoperability between Swift and S3 when Keystone is the identity provider. Bare Keystone role names (e.g. 'X-Container-Read: Member') are not matched against the aclspec. Swift's keystoneauth scopes role-name ACL elements to the project that owns the container (see swift/common/middleware/keystoneauth.py: tenant-mismatch gate runs before the user_role-in-roles loop). The acl_strategy_t callback in RGW does not see the bucket owner, so a bare-role-name lookup here would grant the permission to any token carrying that role regardless of project scope, leaking access across Keystone projects in multi-tenant clouds. Project-scoped role-name ACLs are out of scope for this change and will need a separate follow-up that threads the container/bucket owner through the ACL evaluation. Fixes: https://tracker.ceph.com/issues/68492 Fixes: https://tracker.ceph.com/issues/68476 Signed-off-by: Senol Colak <[email protected]> (cherry picked from commit e05a139) (cherry picked from commit a18aee2) (cherry picked from commit 5afd197) Signed-off-by: Uwe Schwaeke <[email protected]>
Both TokenEngine::get_acl_strategy() and EC2Engine::get_acl_strategy()
were producing the same lambda over the same Cartesian product of
{tenant_id, tenant_name} x {user_id, user_name} plus four wildcards.
Hoist the body into a shared free function make_keystone_acl_strategy()
and route both engines through a thin envelope adapter. The function
takes plain strings and a roles list so it is unit-testable without
constructing a Keystone TokenEnvelope.
Add the authenticated wildcard "*:*" to the allowed_items array.
Swift's keystoneauth _authorize_cross_tenant() iterates the full
{tenant_id, tenant_name, '*'} x {user_id, user_name, '*'} product, so a
container with X-Container-Read: *:* must grant read to any token-bearing
Keystone user. The previous six-element array silently denied this case
for both Swift (TokenEngine) and S3 (EC2Engine) requests.
Add unittest_rgw_auth_keystone covering each combination
(project:user, name:name, project:*, *:user, *:*), no-match,
multi-grant OR-ing, and the system-reader role grant. The
BareRoleNameIsNotHonored case pins the deliberate omission of
project-scoped role-name matching documented in PR ceph#68795: until
acl_strategy_t can see the bucket owner, matching a bare role name
would leak across projects.
Signed-off-by: Senol Colak <[email protected]>
(cherry picked from commit 0a96b7d)
(cherry picked from commit 68d8b41)
(cherry picked from commit 2da14c0)
Signed-off-by: Uwe Schwaeke <[email protected]>
Signed-off-by: Uwe Schwaeke <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes cobaltcore-dev/cloud-storage#618
Backport file
release-management/backports/<uuid>.mdadded (or updated) by this PRidin frontmatter matches the filename stemprovenance.upstream_prsset (orprovenance.type: otherwith another:block)Stage-B risk (filled per
release-management/backports/RISK-RUBRIC.md)blast— cosmetic / availability / data-lossconflict— clean / trivial / substantivecoverage— strong / partial / weakhighband)Merge
Land this via
just merge-backport PR=<N>— do not click the green merge button.The just recipe constructs the merge commit's
Backport-Idtrailer.