Skip to content

rgw/logging: use assumed-role ARN as Requester for STS requests - #68887

Merged
yuvalif merged 2 commits into
ceph:mainfrom
ShreeJejurikar:wip-bucket-logging-requester-assumed-role
May 26, 2026
Merged

yuvalif merged 2 commits into
ceph:mainfrom
ShreeJejurikar:wip-bucket-logging-requester-assumed-role

Conversation

@ShreeJejurikar

Copy link
Copy Markdown
Contributor

When a request is made with STS temporary credentials, the bucket logging Requester field was being set to the underlying user ID instead of the assumed-role ARN. Per the AWS S3 server-access-log spec, the Requester field should contain the assumed-role ARN (e.g. arn:aws:sts::<account>:assumed-role/<role>/<session>) for STS-credentialed requests.

Detect TYPE_ROLE identities via s->auth.identity->get_identity_type() and use the ARN returned by Identity::get_caller_identity() (already implemented by RoleApplier in the expected AWS format) instead of falling straight through to s->user->get_id(). Existing behavior for account- and user-scoped requests is unchanged.

Verified locally against a vstart cluster: a PUT made with sts:AssumeRole credentials now produces a log record whose Requester field exactly matches the AssumedRoleUser.Arn returned by STS.

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

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

Tests for this fix will be added in a separate PR against ceph/s3-tests as agreed with the maintainer; that PR will link back here.

@ShreeJejurikar
ShreeJejurikar requested a review from a team as a code owner May 13, 2026 13:07
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

13 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@github-actions github-actions Bot added the rgw label May 13, 2026
@yuvalif
yuvalif requested a review from nbalacha May 13, 2026 14:22
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
@yuvalif

yuvalif commented May 13, 2026

Copy link
Copy Markdown
Contributor

please add test to cover this issue

@djgalloway

Copy link
Copy Markdown
Contributor

jenkins test pr

@ShreeJejurikar
ShreeJejurikar force-pushed the wip-bucket-logging-requester-assumed-role branch from d955971 to 4ca8d51 Compare May 14, 2026 09:21
@yuvalif

yuvalif commented May 19, 2026

Copy link
Copy Markdown
Contributor

@ShreeJejurikar the "assume role" test is failing with:

botocore.exceptions.ClientError: An error occurred (InvalidArgument) when calling the AssumeRole operation: None

(please ignore the other failures as they are unrelated).
log: https://qa-proxy.ceph.com/teuthology/yuvalif-2026-05-19_11:13:32-rgw:bucket-logging-wip-yuval-test1-distro-default-trial/219615/teuthology.log

@cbodley

cbodley commented May 19, 2026

Copy link
Copy Markdown
Contributor

@ShreeJejurikar the "assume role" test is failing with:

from the radosgw log,

ERROR: rgw sts key not set

you'll want to copy rgw sts key: abcdefghijklmnop from qa/suites/rgw/verify/overrides.yaml into qa/suites/rgw/bucket-logging/overrides.yaml

@github-actions github-actions Bot added the tests label May 20, 2026
@ShreeJejurikar
ShreeJejurikar force-pushed the wip-bucket-logging-requester-assumed-role branch from 0c69bec to e3900f4 Compare May 20, 2026 07:24
@yuvalif

yuvalif commented May 20, 2026

Copy link
Copy Markdown
Contributor

@yuvalif

yuvalif commented May 21, 2026

Copy link
Copy Markdown
Contributor

teuthology rerun with the sts key: https://pulpito-ng.ceph.com/runs/yuvalif-2026-05-20_08:27:19-rgw:bucket-logging-wip-yuval-test1-distro-default-trial

assume role test is passing. 2 tests are failing:

  • test_bucket_logging_bucket_auth_type
  • test_bucket_logging_request_id
    should be fixed by a rebase

When a request is made with STS temporary credentials, the bucket logging
Requester field was being set to the underlying user ID instead of the
assumed-role ARN. Per the AWS S3 server-access-log spec, the Requester
field should contain the assumed-role ARN (e.g.
arn:aws:sts::<account>:assumed-role/<role>/<session>) for STS-credentialed
requests.

Detect TYPE_ROLE identities via s->auth.identity->get_identity_type() and
use the ARN returned by Identity::get_caller_identity() (already
implemented by RoleApplier in the expected AWS format) instead of falling
straight through to s->user->get_id(). Existing behavior for account- and
user-scoped requests is unchanged.

Fixes: https://tracker.ceph.com/issues/71742
Signed-off-by: Shree Jejurikar <[email protected]>
@ShreeJejurikar
ShreeJejurikar force-pushed the wip-bucket-logging-requester-assumed-role branch from e3900f4 to ab9d278 Compare May 21, 2026 06:34
@ShreeJejurikar

Copy link
Copy Markdown
Contributor Author

@yuvalif

  • should be fixed by a rebase

Rebased

assume role test is passing

I tried searching for test_bucket_logging_requester_assumed_role in the teuthology logs but couldn't find it, can you point me to where the log is please?

@yuvalif

yuvalif commented May 23, 2026

Copy link
Copy Markdown
Contributor

assume role test is passing

I tried searching for test_bucket_logging_requester_assumed_role in the teuthology logs but couldn't find it, can you point me to where the log is please?

you are right. i was running againts the wrong s3tests branch. will re-test

@yuvalif

yuvalif commented May 25, 2026

Copy link
Copy Markdown
Contributor

reran the test, this time against the right s3tests branch:
https://pulpito-ng.ceph.com/runs/yuvalif-2026-05-25_09:13:37-rgw:bucket-logging-wip-yuval-test1-distro-default-trial

test is now failing on bucket creation:

botocore.exceptions.ClientError: An error occurred (InvalidAccessKeyId) when calling the CreateBucket operation: None

i see this in the rgw log:

28471:2026-05-25T09:26:54.885+0000 7f99cf612640  5 req 4759934539616021995 0.000000000s s3:create_bucket error reading user info, uid=iPkiLwCp15pR4duwEBc9 can't authenticate

this is the tethology rgw "overrides" yaml:

overrides:
  ceph:
    conf:
      client:
        setuser: ceph
        setgroup: ceph
        debug rgw: 20
        rgw bucket logging obj roll time: 5
        rgw sts key: abcdefghijklmnop
  rgw:
    storage classes:
      LUKEWARM:
      FROZEN:
  s3tests:
    accounts:
      iam root: RGW88888888888888888
      iam alt root: RGW99999999999999999

@yuvalif
yuvalif requested a review from cbodley May 25, 2026 09:59
@ShreeJejurikar

Copy link
Copy Markdown
Contributor Author

ig the bucket-logging overrides yaml might be missing this? Don;t know for sure tho

rgw s3 auth use sts: true

@yuvalif

yuvalif commented May 25, 2026

Copy link
Copy Markdown
Contributor

ig the bucket-logging overrides yaml might be missing this? Don;t know for sure tho

rgw s3 auth use sts: true

teuthology run with this extra lines: https://pulpito-ng.ceph.com/runs/yuvalif-2026-05-25_13:17:23-rgw:bucket-logging-wip-yuval-test1-distro-default-trial

@ShreeJejurikar

Copy link
Copy Markdown
Contributor Author
test_bucket_logging_requester_assumed_role	PASSED

The test Passes, but these 2 still fail, even though I did do rebase:

test_bucket_logging_bucket_auth_type
test_bucket_logging_request_id

Set rgw sts key and enable rgw s3 auth use sts, both needed by
test_bucket_logging_requester_assumed_role. Mirrors the existing
settings in qa/suites/rgw/verify/overrides.yaml.

Signed-off-by: ShreeJejurikar <[email protected]>
@ShreeJejurikar
ShreeJejurikar force-pushed the wip-bucket-logging-requester-assumed-role branch from ab9d278 to 6ff6a55 Compare May 25, 2026 13:55
@yuvalif

yuvalif commented May 25, 2026

Copy link
Copy Markdown
Contributor
test_bucket_logging_requester_assumed_role	PASSED

The test Passes, but these 2 still fail, even though I did do rebase:

test_bucket_logging_bucket_auth_type
test_bucket_logging_request_id

i did not build a new shaman image after the rebase. so it makes sense.

@yuvalif

yuvalif commented May 25, 2026

Copy link
Copy Markdown
Contributor

@yuvalif

yuvalif commented May 25, 2026

Copy link
Copy Markdown
Contributor

@yuvalif

yuvalif commented May 25, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@yuvalif
yuvalif merged commit 265b354 into ceph:main May 26, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log 265b354a31502d84499e94b7f3f6485a866cf799^..265b354a31502d84499e94b7f3f6485a866cf799

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/26433204961

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.

6 participants