Skip to content

test: verify Requester field is the assumed-role ARN#749

Open
ShreeJejurikar wants to merge 1 commit into
ceph:masterfrom
ShreeJejurikar:wip-bucket-logging-requester-assumed-role
Open

test: verify Requester field is the assumed-role ARN#749
ShreeJejurikar wants to merge 1 commit into
ceph:masterfrom
ShreeJejurikar:wip-bucket-logging-requester-assumed-role

Conversation

@ShreeJejurikar
Copy link
Copy Markdown

Add a bucket logging test that asserts the standard access log Requester field is set to the assumed-role ARN (per AWS S3 spec) when a request is made with STS temporary credentials.

The test:

  1. Creates an IAM role with a trust policy allowing the alt user to call sts:AssumeRole, and attaches an inline s3:* policy
  2. Calls sts.AssumeRole, builds a boto3 S3 client from the temporary credentials
  3. With the assumed-role client: creates source + log buckets, sets the log-bucket policy, enables Standard bucket logging on the source bucket, then PUTs one object
  4. Flushes logs and verifies the resulting log record's Requester field starts with arn:aws:sts:: and contains assumed-role/<role>/<session>

Reuses existing helpers (get_iam_client, get_sts_client, _set_log_bucket_policy_tenant, _flush_logs, _parse_log_record, nuke_role) — no new helper code added.

Pairs with the fix in ceph/ceph#68887. The test will fail in CI against main until that lands.

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

Comment thread s3tests/functional/test_s3.py Outdated
def test_bucket_logging_requester_assumed_role():
"""verify the standard access log Requester field contains the assumed-role ARN
for requests made with STS temporary credentials
https://tracker.ceph.com/issues/71742"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably no need to mention the tracker here

Add a bucket logging test that asserts the standard access log Requester
field is set to the assumed-role ARN (per AWS S3 spec) when a request is
made with STS temporary credentials.

The test creates an IAM role assumable by the alt user, assumes it via
STS, performs an S3 PutObject with the temporary credentials, flushes the
bucket log, and verifies the log record's Requester field matches
arn:aws:sts:::assumed-role/<role>/<session>.

Tracker: https://tracker.ceph.com/issues/71742
Signed-off-by: Shree Jejurikar <shree.jejurikar@gmail.com>
@ShreeJejurikar ShreeJejurikar force-pushed the wip-bucket-logging-requester-assumed-role branch from 40db126 to aa206bc Compare May 14, 2026 09:23
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.

2 participants