Skip to content

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

Merged
neha-ojha merged 2 commits into
ceph:squidfrom
cbodley:wip-76276-squid
Jun 24, 2026
Merged

neha-ojha merged 2 commits into
ceph:squidfrom
cbodley:wip-76276-squid

Conversation

@cbodley

@cbodley cbodley commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

cbodley added 2 commits June 3, 2026 15:42
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]>
(cherry picked from commit ccdbebd)

Conflicts:
	src/rgw/rgw_rest_iam_account.cc  does not exist on squid
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]>
(cherry picked from commit b81bc95)
@cbodley
cbodley requested a review from a team as a code owner June 3, 2026 19:42
@cbodley cbodley added this to the squid milestone Jun 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Backport Parity Review - Backport Deviation Alert

A conflict or unapproved deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

Deviation in Backport 91fc6b6 (cherry-pick of ccdbebd)

Affected File(s)

Range Diff

Click to expand
--- Original (ccdbebd9)
+++ Backport (91fc6b69)
@@ -4,3 +4,7 @@
 a consistent way to construct them
 
 Signed-off-by: Casey Bodley <[email protected]>
+(cherry picked from commit ccdbebd925b77eb7c5d0ba9a3a175642babcf291)
+
+Conflicts:
+	src/rgw/rgw_rest_iam_account.cc  does not exist on squid

================================================================================
RANGE DIFF
================================================================================

1:  ccdbebd925b ! 1:  91fc6b69c6e rgw/iam: add helper rgw::account::root_arn()
    @@ Commit message
         a consistent way to construct them
     
         Signed-off-by: Casey Bodley <[email protected]>
    +    (cherry picked from commit ccdbebd925b77eb7c5d0ba9a3a175642babcf291)
    +
    +    Conflicts:
    +            src/rgw/rgw_rest_iam_account.cc  does not exist on squid
     
      ## src/rgw/rgw_account.cc ##
     @@
    @@ src/rgw/rgw_account.h: bool validate_id(std::string_view id, std::string* err_ms
      
      struct AdminOpState {
        std::string account_id;
    -
    - ## src/rgw/rgw_rest_iam_account.cc ##
    -@@
    - // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
    - // vim: ts=8 sw=2 sts=2 expandtab ft=cpp
    - 
    -+#include "rgw_account.h"
    - #include "rgw_process_env.h"
    - #include "rgw_rest_iam_account.h"
    - 
    -@@ src/rgw/rgw_rest_iam_account.cc: int RGWGetAccountSummary::verify_permission(optional_yield y)
    -   } else {
    -     return -ERR_METHOD_NOT_ALLOWED;
    -   }
    --  const rgw::ARN arn{"", "root", account_id, true};
    -+  const auto arn = rgw::account::root_arn(account_id);
    -   if (verify_user_permission(this, s, arn, rgw::IAM::iamGetAccountSummary)) {
    -     return 0;
    -   }

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.


Commit Parity Visualizer

BACKPORT PR #69274 SOURCE PR SOURCE STATUS
91fc6b6 rgw/iam: add helper rgw::account::root_arn() PR #68429 ccdbebd rgw/iam: add helper rgw::account::root_arn()
a4e4cc8 rgw/sns: ListTopics uses account root arn for policy evaluation b81bc95 rgw/sns: ListTopics uses account root arn for policy evaluation

🛟 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.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

CI Run Log: View Workflow Details

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jun 3, 2026
@yuriw

yuriw commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri9-testing-20260622.172413-squid.

@neha-ojha
neha-ojha merged commit ef88785 into ceph:squid Jun 24, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa releng-audit-fail Release engineering: failed backport verification audit. rgw wip-yuri9-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants