Repository navigation
rgw/keystone: fix Swift ACL evaluation and add EC2Engine ACL strategy - #70997
senolcolak wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Automated Redmine Linkage Audit
The following tracking irregularities were found:
- Missing Original PR(s): Could not identify any
mainPRs associated with this backport. Ensure the backport commits properly reference the original PRs. - Orphaned Backport PR: Could not find any Redmine tracker linked directly to this backport PR #70997.
Automated Backport Parity Review - Invalid Commit Format
The following commits have an invalid format. Backport commits must either include a standard (cherry picked from commit ...) line or start with the target branch name (e.g., squid:).
f4e53556rgw/keystone: fix Swift ACL evaluation and add EC2Engine ACL strategy
Be familiar with the rules and guidelines for writing backports.
Automated Backport Parity Review
Discrepancies detected between the backport PR and the original source PR(s). Please see the Commit Parity Visualizer below.
Commit Parity Visualizer
| BACKPORT PR #70997 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| f4e5355 rgw/keystone: fix Swift ACL evaluation and add EC2Engine ACL strategy | <<<< EXTRA IN BACKPORT >>>> |
🛟 Need Help?
If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.
📋 Component Lead / Release Manager
To override the audit failure, apply releng-audit-override label or comment /audit override.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
2825a9d to
2007dec
Compare
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)
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)
2007dec to
68d8b41
Compare
|
we validated the patch is working on our Swift Glance environment. |
Backport-Id: 01a08f3a-594a-74c8-a6e7-11286099fb49 Backport-PR: #12 Upstream-PRs: ceph#68795, ceph#70997
Backport-Id: 01a08f3a-594a-74c8-a6e7-11286099fb49 Backport-PR: #12 Upstream-PRs: ceph#68795, ceph#70997
Backport-Id: 01a14449-fa55-75f8-a119-93a83c111aec Backport-PR: #35 Upstream-PRs: ceph#68795, ceph#70997
Backport of the fix from PR #68795 (targeting main) to squid.
Two bugs fixed:
*:*wildcard missing from TokenEngine's allowed_items — containers with X-Container-Read: : returned 403 to any cross-project Keystone token.Both caused Glance shared image downloads to return zero bytes with swift_store_multi_tenant = True.
Fixes: https://tracker.ceph.com/issues/68492
Fixes: https://tracker.ceph.com/issues/68476