Skip to content

squid: fix Swift ACL evaluation for Glance image sharing - #12

Merged
uw-sc merged 4 commits into
squid-19.2.6-cobaltcore-storagefrom
backport/570
Oct 1, 2026
Merged

uw-sc merged 4 commits into
squid-19.2.6-cobaltcore-storagefrom
backport/570

Conversation

@uw-sc

@uw-sc uw-sc commented Sep 11, 2026

Copy link
Copy Markdown

Closes cobaltcore-dev/cloud-storage#570

@uw-sc
uw-sc force-pushed the backport/570 branch 4 times, most recently from 413003d to c58c110 Compare September 25, 2026 11:23
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)
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)
nodeenv 1.11.0 (released 2026-09-26) no longer leaves the node-env/src
directory behind after installing a prebuilt node.  The build step runs
an unpinned `pip install nodeenv`, so as of today every build with
WITH_MGR_DASHBOARD_FRONTEND fails at

  chown: cannot access '.../node-env/src': No such file or directory
  ninja: build stopped: subcommand failed.

(e.g. ceph-pr-pipeline build 2504).  The chown is a workaround for
tarball uid mapping in containers and is only needed when the src
directory exists, so skip it when there is nothing to fix up.

Assisted-by: Claude Fable 5
Signed-off-by: David Galloway <[email protected]>
(cherry picked from commit 5aff221)

Conflicts:
	src/pybind/mgr/dashboard/frontend/CMakeLists.txt
	  squid still creates the npm cache directory with "mkdir -p" and
	  has no DEPENDS on setup-virtualenv.sh; kept those lines as they
	  are and took only the guarded chown and its comment

Signed-off-by: David Galloway <[email protected]>
Assisted-by: Claude Fable 5.1 (claude-fable-5-1)
(cherry picked from commit c96865f)
@uw-sc
uw-sc merged commit a61e6c5 into squid-19.2.6-cobaltcore-storage Oct 1, 2026
4 checks passed
uw-sc added a commit that referenced this pull request Oct 14, 2026
Backport-Id: 01a08f3a-594a-74c8-a6e7-11286099fb49
Backport-PR: #12
Upstream-PRs: ceph#68795, ceph#70997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants