Skip to content

rgw/sns: ListTopics uses account root arn for policy evaluation - #68429

Merged
cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-74595
Apr 27, 2026
Merged

cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-74595

Conversation

@cbodley

@cbodley cbodley commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

when called by a non-root account user, permissions from identity policy were not being applied correctly and always resulted in:

evaluate_iam_policies: implicit deny from identity-based policy

passing a non-empty ARN argument to verify_user_permission() fixes this. while other SNS APIs use a specific topic's arn, ListTopics doesn't operate on individual topics so we use the account root user's arn

Fixes: https://tracker.ceph.com/issues/74595

Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@cbodley
cbodley requested a review from a team as a code owner April 16, 2026 17:02
@github-actions github-actions Bot added the rgw label Apr 16, 2026
@cbodley

cbodley commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

test case in ceph/s3-tests#736. without this fix applied, the final list_topics() call fails with this radosgw log output:

2026-04-16T12:46:29.137-0400 7f0ad46366c0  2 req 10991844653682506055 0.001000034s sns:pubsub_topics_list verifying op permissions
2026-04-16T12:46:29.137-0400 7f0ad46366c0 10 req 10991844653682506055 0.001000034s sns:pubsub_topics_list evaluate_iam_policies: implicit deny from identity-based policy
2026-04-16T12:46:29.137-0400 7f0ad46366c0 20 req 10991844653682506055 0.001000034s sns:pubsub_topics_list no policies for a policy mandatory op 154
2026-04-16T12:46:29.137-0400 7f0ad46366c0 20 req 10991844653682506055 0.001000034s op->ERRORHANDLER: err_no=-2225 new_err_no=-2225

with the fix applied, the identity policy evaluation succeeds:

2026-04-16T13:01:29.813-0400 7fe7adf786c0  2 req 11546952563360083766 0.001000033s sns:pubsub_topics_list verifying op permissions
2026-04-16T13:01:29.813-0400 7fe7adf786c0 20 req 11546952563360083766 0.001000033s sns:pubsub_topics_list eval_identity_or_session_policies Allow from { Version: 2012-10-17, Statements: [ { Effect: Allow, Action: [ sns:GetTopicAttributes, sns:ListTopics ], Resource: [ arn:*:*:*:*:* ] } ],  }
2026-04-16T13:01:29.813-0400 7fe7adf786c0 10 req 11546952563360083766 0.001000033s sns:pubsub_topics_list evaluate_iam_policies: allowed by identity-based policy

@cbodley
cbodley requested a review from yuvalif April 16, 2026 17:05
Comment thread src/rgw/rgw_rest_pubsub.cc Resolved
@yuvalif
yuvalif self-requested a review April 16, 2026 17:48
cbodley added 2 commits April 16, 2026 14:14
we need account root arns for various permission checks, and don't have
a consistent way to construct them

Signed-off-by: Casey Bodley <[email protected]>
when called by a non-root account user, permissions from identity policy
were not being applied correctly and always resulted in:
> evaluate_iam_policies: implicit deny from identity-based policy

passing a non-empty ARN argument to verify_user_permission() fixes this.
while other SNS APIs use a specific topic's arn, ListTopics doesn't
operate on individual topics so we use the account root user's arn

Fixes: https://tracker.ceph.com/issues/74595

Signed-off-by: Casey Bodley <[email protected]>
@cbodley cbodley added needs-separate-s3tests-qa This is a PR to RGW that, at present, needs to be QA'd against is own s3tests branch before merge. wip-cbodley-testing and removed needs-qa labels Apr 17, 2026
@cbodley

cbodley commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley

cbodley commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@cbodley

cbodley commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

qa pending in https://pulpito.ceph.com/cbodley-2026-04-23_17:26:59-rgw-wip-cbodley-testing-distro-default-trial/

^ passed qa against ceph/s3-tests#736

s3tests/functional/test_sns.py::test_account_user_policy_list_topics PASSED [ 99%]

@cbodley
cbodley merged commit c6ea09b into ceph:main Apr 27, 2026
6 checks passed
@cbodley
cbodley deleted the wip-74595 branch April 27, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix needs-separate-s3tests-qa This is a PR to RGW that, at present, needs to be QA'd against is own s3tests branch before merge. rgw wip-cbodley-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants