Skip to content

umbrella: rgw: Policy evalaution logging - #70531

Merged
batrick merged 9 commits into
ceph:umbrellafrom
adamemerson:wip-77740-umbrella
Aug 3, 2026
Merged

batrick merged 9 commits into
ceph:umbrellafrom
adamemerson:wip-77740-umbrella

Conversation

@adamemerson

Copy link
Copy Markdown
Contributor

Create a log entry where we can fill a buffer with `format` instead of
needing to go through stringstream.

Signed-off-by: Adam C. Emerson <[email protected]>
Fixes: https://tracker.ceph.com/issues/78661
(cherry picked from commit e885b11)
Signed-off-by: Adam C. Emerson <[email protected]>
@adamemerson
adamemerson requested review from a team as code owners July 24, 2026 19:16
@github-actions

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_copious_policy_logging (rgw.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@github-actions github-actions Bot added this to the umbrella milestone Jul 24, 2026
@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 24, 2026
github-actions[bot]

This comment was marked as outdated.

@adamemerson

Copy link
Copy Markdown
Contributor Author

/config check ok

@adamemerson

Copy link
Copy Markdown
Contributor Author

/audit override

@adamemerson

Copy link
Copy Markdown
Contributor Author

jenkins test config

@github-actions github-actions Bot added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

When the `rgw_copious_policy_logging` option is set to true, a
detailed trace of policy evaluation is logged.

Assisted-by: Claude Opus 4.6 <[email protected]>
(I wanted to see how it performed on rebase conflict resolution.)
Assisted-by: Claude Fable 5 <[email protected]>
(I figured I should have it look at the policy evaluation code for
bugs while it's included, and it found a few mistakes in output.)
Signed-off-by: Adam C. Emerson <[email protected]>
(cherry picked from commit 7bdb627)

Conflicts:
	src/rgw/rgw_bucket_logging.cc
 - Clash with minimal environment production from
   <ceph#69264>.

Fixes: https://tracker.ceph.com/issues/78661
Signed-off-by: Adam C. Emerson <[email protected]>
This is an identity backed by a `Principal`, for use when we don't
have any sort of RGW driver.

Signed-off-by: Adam C. Emerson <[email protected]>
(cherry picked from commit 3a1686c)
Fixes: https://tracker.ceph.com/issues/78661
Signed-off-by: Adam C. Emerson <[email protected]>
Annotated evaluation of a policy.

Signed-off-by: Adam C. Emerson <[email protected]>
(cherry picked from commit 5a176d3)
Fixes: https://tracker.ceph.com/issues/78661
Signed-off-by: Adam C. Emerson <[email protected]>
@github-actions

Copy link
Copy Markdown

⚠️ Audit Override Removed

New commits were pushed to this PR, so the previous override has been removed.

View workflow run

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

Ceph Release Engineering Audit Report

Commit Parity Visualizer

BACKPORT PR #70531 SOURCE PR SOURCE STATUS
5f8b7c4 rgw/policy: Properly spell RemoveClientIdFromOIDCProvider in table PR #67732 12d88e8 rgw/policy: Properly spell RemoveClientIdFromOIDCProvider in table
c59d2d1 rgw/policy: Add missing strings for actions c62ee11 rgw/policy: Add missing strings for actions
d6dcef3 include/types: Add std::unordered_multimap support 8191c81 include/types: Add std::unordered_multimap support
ca60299 log: Add StringEntry to avoid using ostream e885b11 log: Add StringEntry to avoid using ostream
9a2d02a rgw: Make ARNs libfmt-able 05d82da rgw: Make ARNs libfmt-able
a3a29da rgw: Make rgw::auth::Identity libfmt-able 7582c32 rgw: Make rgw::auth::Identity libfmt-able
6545d6c rgw/policy: Allow logging policy evaluation 7bdb627 rgw/policy: Allow logging policy evaluation
a4e7dd3 rgw: Add PrincipalIdentity for use in testing and utilities 3a1686c rgw: Add PrincipalIdentity for use in testing and utilities
80b3087 rgw/policy: Add rgw-policy-test command line tool 5a176d3 rgw/policy: Add rgw-policy-test command line tool

Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations

⚠️ WARNING: Cherry-pick conflicts or deviations were found that require component lead review.

A conflict or 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.

This does not necessarily indicate an issue but a maintainer should review.

**Click to expand conflict summaries.**

Deviation in Backport 6545d6c (cherry-pick of 7bdb627)

Affected File(s)

Range Diff

Click to expand
--- Original (7bdb627a)
+++ Backport (6545d6ca)
@@ -9,3 +9,12 @@
 (I figured I should have it look at the policy evaluation code for
 bugs while it's included, and it found a few mistakes in output.)
 Signed-off-by: Adam C. Emerson <[email protected]>
+(cherry picked from commit 7bdb627a85c18ea9bb24f3239e21d0aaddf1dc0e)
+
+Conflicts:
+	src/rgw/rgw_bucket_logging.cc
+ - Clash with minimal environment production from
+   <https://github.com/ceph/ceph/pull/69264>.
+
+Fixes: https://tracker.ceph.com/issues/78661
+Signed-off-by: Adam C. Emerson <[email protected]>

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

1:  7bdb627a85c ! 1:  6545d6cab37 rgw/policy: Allow logging policy evaluation
    @@ Commit message
         (I figured I should have it look at the policy evaluation code for
         bugs while it's included, and it found a few mistakes in output.)
         Signed-off-by: Adam C. Emerson <[email protected]>
    +    (cherry picked from commit 7bdb627a85c18ea9bb24f3239e21d0aaddf1dc0e)
    +
    +    Conflicts:
    +            src/rgw/rgw_bucket_logging.cc
    +     - Clash with minimal environment production from
    +       <https://github.com/ceph/ceph/pull/69264>.
    +
    +    Fixes: https://tracker.ceph.com/issues/78661
    +    Signed-off-by: Adam C. Emerson <[email protected]>
     
      ## src/common/options/rgw.yaml.in ##
     @@ src/common/options/rgw.yaml.in: options:
    @@ src/common/options/rgw.yaml.in: options:
     
      ## src/rgw/rgw_bucket_logging.cc ##
     @@ src/rgw/rgw_bucket_logging.cc: int verify_target_bucket_policy(const DoutPrefixProvider* dpp,
    -     rgw::IAM::Environment env;
    -     const auto arn_it = env.emplace("aws:SourceArn", std::move(source_bucket_arn));
    -     const auto acct_it = env.emplace("aws:SourceAccount", std::move(source_account));
    --    if (policy.eval(env, ident, rgw::IAM::s3PutObject, target_resource_arn) != rgw::IAM::Effect::Allow) {
    -+    if (policy.eval(dpp, env, ident, rgw::IAM::s3PutObject, target_resource_arn) != rgw::IAM::Effect::Allow) {
    +     const auto source_account = to_string(s->bucket_owner.id);
    +     s->env.emplace("aws:SourceArn", source_bucket_arn);
    +     s->env.emplace("aws:SourceAccount", source_account);
    +-    if (policy.eval(s->env, ident, rgw::IAM::s3PutObject, target_resource_arn) != rgw::IAM::Effect::Allow) {
    ++    if (policy.eval(dpp, s->env, ident, rgw::IAM::s3PutObject, target_resource_arn) != rgw::IAM::Effect::Allow) {
            ldpp_dout(dpp, 1) << "ERROR: logging bucket: '" << target_bucket_id <<
              "' must have a bucket policy that allows logging service principal to put objects in the following resource ARN: '" <<
    -         target_resource_arn.to_string() << "' from source bucket ARN: '" << arn_it->second <<
    +         target_resource_arn.to_string() << "' from source bucket ARN: '" << source_bucket_arn <<
     
      ## src/rgw/rgw_common.cc ##
     @@ src/rgw/rgw_common.cc: Effect eval_or_pass(const DoutPrefixProvider* dpp,

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.


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

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Jul 24, 2026
@adamemerson

Copy link
Copy Markdown
Contributor Author

/audit override

@github-actions github-actions Bot added releng-audit-override and removed releng-audit-fail Release engineering: failed backport verification audit. labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown

✅ Audit Override Applied by @adamemerson.

View workflow run

@batrick batrick modified the milestones: umbrella, v21.1.1 Jul 28, 2026
@batrick
batrick merged commit 448b045 into ceph:umbrella Aug 3, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants