Skip to content

rgw/logging: use bucket policy for logging - #62284

Merged
cbodley merged 4 commits into
ceph:mainfrom
yuvalif:wip-yuval-70086
Apr 1, 2025
Merged

cbodley merged 4 commits into
ceph:mainfrom
yuvalif:wip-yuval-70086

Conversation

@yuvalif

@yuvalif yuvalif commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

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)
Show available Jenkins commands

@yuvalif

yuvalif commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor Author

to test with a vstart cluster use

  • create buckets
aws --endpoint-url http://127.0.0.1:8000 s3 mb s3://all-logs
aws --endpoint-url http://127.0.0.1:8000 s3 mb s3://fish
  • set policy on log bucket:
cat policy.json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "S3ServerAccessLogsPolicy",
            "Effect": "Allow",
            "Principal": {
                "Service": "logging.s3.amazonaws.com"
            },
            "Action": [
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::all-logs/log*",
            "Condition": {
                "StringEquals": {
                    "aws:SourceArn": "arn:aws:s3:::fish"
                },
                  "StringEquals": {
                    "aws:SourceAccount": "testid"
                }
            }
        }
    ]
}
aws --endpoint-url http://127.0.0.1:8000 s3api put-bucket-policy --bucket all-logs --policy file://policy.json
  • configure bucket logging:
aws --endpoint-url http://localhost:8000 s3api put-bucket-logging --bucket fish --bucket-logging-status '{"LoggingEnabled": {"TargetBucket": "all-logs", "TargetPrefix": "logs", "LoggingType": "Standard"}}'

Comment thread src/rgw/rgw_rest_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_rest_bucket_logging.cc Resolved
Comment thread src/rgw/rgw_iam_policy.cc Outdated
Comment on lines 1274 to 1277

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.

doesn't this just duplicate the is_identity() call on line 1253 above?

    if (ida->get_identity_type() != TYPE_ROLE && !princ.empty() && !is_identity(*ida, princ)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is pretty similar. i can merge the code.

@cbodley

cbodley commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

ArnLike conditions are not supported in our code

ok, we need to implement this part of Condition::eval()

#if 0
    // Amazon Resource Names! (Does S3 need this?)
    TokenID::ArnEquals, TokenID::ArnNotEquals, TokenID::ArnLike,
      TokenID::ArnNotLike,
#endif

edit: started on this in #62285

@yuvalif

yuvalif commented Mar 17, 2025

Copy link
Copy Markdown
Contributor Author

also adding the target policy check in RGWPostBucketLoggingOp.
even though it does not add any log records to the target, it does flush them into the target bucket.
so, should be protected by policy

@yuvalif
yuvalif marked this pull request as ready for review March 18, 2025 16:18
@yuvalif
yuvalif requested a review from a team as a code owner March 18, 2025 16:18
@yuvalif yuvalif removed the DNM label Mar 18, 2025

@cbodley cbodley left a comment

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.

looking good

are these requirements enforced?

Both the source and destination buckets must be in the same AWS Region and owned by the same account. The destination bucket must not have an S3 Object Lock default retention period configuration. The destination bucket must also not have Requester Pays enabled.

Comment thread src/rgw/rgw_bucket_logging.cc Outdated

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.

s->owner is the identity that performed the s3 operation being logged. i think this should be s->bucket_owner instead:

SOURCE-ACCOUNT-ID is the AWS account that owns the source bucket.

Comment thread src/rgw/rgw_bucket_logging.cc Outdated

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.

i would expect this to be the actual log object name. do we know its name at this point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

when logging the record we know the name. however when calling PutBucketLogging we don't have the object's name.
So, is there any point using the exact name here and the bucket+prefix in PutBucketLogging?
i don't think there is a good policy the user can write that would match only subset of objects but also the bucket+prefix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

another option is to not check the policy in PutBucketLogging

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.

for PutBucketLogging, i don't see a problem with checking policy against the prefix. but if we have the full object name when logging, we might as well use it to be consistent with how PutObject requests check for s3:PutObject permission

i don't think there is a good policy the user can write that would match only subset of objects but also the bucket+prefix

define "good"? :) you could write a single statement that Allows just the "bucket/prefix" without wildcard, so wouldn't match objects under the prefix. you could also write one statement that Allows "bucket/prefix*" and another statement that Denys some resources under the prefix like "bucket/prefix-foo*"

Comment thread src/rgw/rgw_bucket_logging.cc Outdated
Comment on lines 812 to 813

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.

target_bucket->get_key() returns the rgw_bucket, shouldn't need to pass separately

Comment thread src/rgw/rgw_iam_policy.cc Outdated
Comment on lines 1256 to 1257

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.

i still don't understand why the above isn't sufficient to match the service principal:

    if (ida->get_identity_type() != TYPE_ROLE && !princ.empty() && !is_identity(*ida, princ)) {
      return Effect::Deny;

isn't *princ_type the only difference? that should only apply to TYPE_ROLE

Comment thread src/rgw/rgw_rest_bucket_logging.cc Outdated

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.

we discussed in slack why it was ok for log_record() to do the target bucket permission checks outside of verify_permission() without admin override. maybe the same applies to this check on PutBucketLogging?

but as-is, relying on verify_permission() to load target_bucket and parse the BucketLoggingStatus is problematic: if called by an admin that isn't the bucket owner, the is_owner_of check at the top will return an error, but the admin override will go on to call execute() with uninitialized target_bucket and configuration

if necessary, you can override init_processing() for that loading/parsing step which happens before the call to verify_permission() - and any errors from init_processing() will fail the request without admin override

@yuvalif

yuvalif commented Mar 19, 2025

Copy link
Copy Markdown
Contributor Author

Both the source and destination buckets must be in the same AWS Region

i think this is supported.
if the log bucket is in a different zonegroup, the PutBucketLogging operation will fail, as it does not see it.

and owned by the same account.

if the owner of the log bucket explicitly set policy that allows a different account to log into it, why should be not allow that?

The destination bucket must not have an S3 Object Lock default retention period configuration.

wasn't sure why this is a good restriction.

The destination bucket must also not have Requester Pays enabled.

do we supprt that?

@cbodley

cbodley commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

Both the source and destination buckets must be in the same AWS Region

i think this is supported. if the log bucket is in a different zonegroup, the PutBucketLogging operation will fail, as it does not see it.

metadata sync does replicate bucket metadata to all zonegroups, so everyone can see the metadata. you'd have to compare RGWBucketInfo::zonegroup for equality. otherwise, writes to the source bucket in its zonegroup would try to write objects to a destination bucket whose data belongs to another. requests to that log bucket would redirect to the correct zonegroup, and clients wouldn't see the log objects there

@cbodley

cbodley commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

The destination bucket must not have an S3 Object Lock default retention period configuration.

wasn't sure why this is a good restriction.

a retention period means that the log objects can't be deleted. writes to the source bucket could potentially generate lots of them. i guess that could fill the bucket's or owner's quota and prevent them from fixing it?

re: quota, i wonder if bucket logging should do quota checks before committing new log objects

The destination bucket must also not have Requester Pays enabled.

do we supprt that?

yeah, you can check bool RGWBucketInfo::requester_pays

@cbodley

cbodley commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

and owned by the same account.

if the owner of the log bucket explicitly set policy that allows a different account to log into it, why should be not allow that?

in the backup use case you're targetting with this feature, does it assume an admin is enabling bucket logging on all buckets? or would end users opt into that for their own buckets?

the same-account requirement wouldn't make sense for the admin persona, but could for the user persona. if this feature is for admins, though, they won't actually want end users to be able to change/delete the bucket logging configuration

@yuvalif

yuvalif commented Mar 19, 2025 •

Copy link
Copy Markdown
Contributor Author

and owned by the same account.

if the owner of the log bucket explicitly set policy that allows a different account to log into it, why should be not allow that?

in the backup use case you're targetting with this feature, does it assume an admin is enabling bucket logging on all buckets? or would end users opt into that for their own buckets?

the same-account requirement wouldn't make sense for the admin persona, but could for the user persona. if this feature is for admins, though, they won't actually want end users to be able to change/delete the bucket logging configuration

  • i was thinking about a case where there is an application/account that provides bucket logging and allows other application/accounts to use it. if someone explicitly allows for users to use their bucket for bucket logging, why should we prevent that at code level?

  • for the case of an application/account logging into their own bucket, they don't need this restriction. if they don't allow others to use their log bucket they won't be able to do so

  • if we want that an admin feature, we would need different APIs (not in scope for now)

  • my guess is that the "same account" restriction is to simplify the cost structure of the feature in AWS. so, that the same account pays for the storage of the source and destination bucket. do you think that would apply to ceph users?

@yuvalif

yuvalif commented Mar 19, 2025

Copy link
Copy Markdown
Contributor Author

The destination bucket must not have an S3 Object Lock default retention period configuration.

wasn't sure why this is a good restriction.

a retention period means that the log objects can't be deleted. writes to the source bucket could potentially generate lots of them. i guess that could fill the bucket's or owner's quota and prevent them from fixing it?

if the owner of the log bucket have set object locks on they bucket they did that for a reason. why prevent that?
e.g. maybe there are different apps consuming the logs for different reasons and they don't want one app to accidentaly
delete the logs before the other one consumed it?

re: quota, i wonder if bucket logging should do quota checks before committing new log objects

from aws doc any log files that the system delivers to you will accrue the usual charges for storage.
so, I think this means that we should check for quota. questions is against which user/bucket?

The destination bucket must also not have Requester Pays enabled.

do we supprt that?

yeah, you can check bool RGWBucketInfo::requester_pays

any idea why this restriction is useful on the log bucket?

@cbodley

cbodley commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

re: quota, i wonder if bucket logging should do quota checks before committing new log objects

from aws doc any log files that the system delivers to you will accrue the usual charges for storage. so, I think this means that we should check for quota. questions is against which user/bucket?

for quota, all objects are counted against the bucket owner. so the log bucket owner, in this case

yeah, you can check bool RGWBucketInfo::requester_pays

any idea why this restriction is useful on the log bucket?

not really, but the restriction is consistent with "any log files that the system delivers to you will accrue the usual charges for storage" above

yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Mar 26, 2025
this commit needed to be able to run bucket logging regression
against: ceph/ceph#62284
since target bucket requires policy for bucket logging to work
this only covers the positive cases from bucket logging policy
perspective

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif
yuvalif force-pushed the wip-yuval-70086 branch 2 times, most recently from bc5c172 to 805034d Compare March 26, 2025 17:40
@yuvalif

yuvalif commented Mar 26, 2025

Copy link
Copy Markdown
Contributor Author

matching s3test PR: ceph/s3-tests#634

verifying that there is policy in place to allow the source bucket
to log to the target bucket. following:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html

additional changes:
* verify that:
  * only the bucket owner can enable/disable bucket logging on the bucket
  * src and log bucket are in the same zonegroup
  * log bucket does not have "requester_pays"
  * restricted log bucket definitions don't change
* add owner's display name to the commited object
* unify bucket names in debug logs

Signed-off-by: Yuval Lifshitz <[email protected]>
Comment thread src/rgw/rgw_bucket_logging.cc Resolved
yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Mar 28, 2025
this commit needed to be able to run bucket logging regression
against: ceph/ceph#62284
since target bucket requires policy for bucket logging to work
this only covers the positive cases from bucket logging policy
perspective

Signed-off-by: Yuval Lifshitz <[email protected]>
yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Mar 28, 2025
this is to cover these checks:
* source bucket ownership
* "requester pays" on log bucket

that were added in: ceph/ceph#62284

Signed-off-by: Yuval Lifshitz <[email protected]>
yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Mar 28, 2025
this is to cover new functionality added in:
ceph/ceph#62284

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif

yuvalif commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@yuvalif

yuvalif commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test api

@yuvalif

yuvalif commented Mar 28, 2025

Copy link
Copy Markdown
Contributor Author

@yuvalif

yuvalif commented Mar 31, 2025

Copy link
Copy Markdown
Contributor Author

full rgw test results: https://pulpito.ceph.com/yuvalif-2025-03-28_14:21:09-rgw-wip-yuval-70086-distro-default-smithi/
2 multisite failures:
rgw_multi.tests.test_null_version_id_delete
rgw_multi.tests.test_version_suspended_incremental_sync

@cbodley cbodley left a comment

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.

what did you have in mind for the needs-doc label?

* updated restriction of the features and differences with
the restrictions documented by AWS.
* document quota handling

Signed-off-by: Yuval Lifshitz <[email protected]>
@yuvalif
yuvalif requested a review from a team as a code owner April 1, 2025 08:30
@yuvalif yuvalif removed the needs-doc label Apr 1, 2025
@yuvalif

yuvalif commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

what did you have in mind for the needs-doc label?

09786e4

@yuvalif

yuvalif commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@yuvalif

yuvalif commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@yuvalif

yuvalif commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley
cbodley merged commit 444f865 into ceph:main Apr 1, 2025
yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Apr 2, 2025
this commit needed to be able to run bucket logging regression
against: ceph/ceph#62284
since target bucket requires policy for bucket logging to work
this only covers the positive cases from bucket logging policy
perspective

Signed-off-by: Yuval Lifshitz <[email protected]>
(cherry picked from commit 1992779)
yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Apr 2, 2025
this is to cover these checks:
* source bucket ownership
* "requester pays" on log bucket

that were added in: ceph/ceph#62284

Signed-off-by: Yuval Lifshitz <[email protected]>
(cherry picked from commit f8e4f39)
yuvalif added a commit to yuvalif/s3-tests that referenced this pull request Apr 2, 2025
this is to cover new functionality added in:
ceph/ceph#62284

Signed-off-by: Yuval Lifshitz <[email protected]>
(cherry picked from commit 37f188c)
cwickramanayake-dotcom added a commit to splunk/s3-tests that referenced this pull request Jan 28, 2026
* add tests for ObjectSizeGreater(Less)Than

Add tests for the new ObjectSizeGreaterThan and
ObjectSizeLessThan lifecycle operators.

Signed-off-by: Matt Benjamin <[email protected]>

* test etag on mpu complete replies

this is to cover the fix of: https://tracker.ceph.com/issues/58879

Signed-off-by: Yuval Lifshitz <[email protected]>

* a change is the RGW error-response require changes in s3-tests

Signed-off-by: Gal Salomon <[email protected]>

* add handling for EventStreamError exception

Signed-off-by: Gal Salomon <[email protected]>

* Fix wrong assertion of the test: `test_buckets_list_ctime`

TestName:
s3tests_boto3.functional.test_s3:test_buckets_list_ctime

Problem:
The test creates 5 buckets for a user but in an assertion check,
it asserts false if any bucket of the user has CreationTime less
than a day prior to current time.
Due to this reason the test fails if the user has pre-existing
buckets older than a day.

Solution:
Assert only on the CreationTime of buckets that were created with
test execution.

Signed-off-by: Sumedh A. Kulkarni <[email protected]>
Co-developed-by: Bob Ham <[email protected]>
Signed-off-by: Bob Ham <[email protected]>

* requirements: unpin pytz version

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

Signed-off-by: Casey Bodley <[email protected]>

* test Get/HeadObject with partNumber for single-multipart upload

test_multipart_get_part() tests 'normal' multipart uploads. add a new
test case for a multipart upload with a single part to tests the fix
for https://tracker.ceph.com/issues/66705

Signed-off-by: Casey Bodley <[email protected]>

* add "checksum" marker, since new checksum tests reference it

this removes a Pytest warning during execution

Signed-off-by: Matt Benjamin <[email protected]>

* test_multipart_upload_sha256: work around failures re-trying complete-multipart

As described in https://tracker.ceph.com/issues/65746, retrying complete-multipart
after having attempted to complete the same upload with a bad checksum argument
fails with an internal error.

The status code is 500, but I'm unsure if it can be retried again, or whether
the upload can be aborted later.

Signed-off-by: Matt Benjamin <[email protected]>

* add test_multipart_checksum_3parts

tests a full multipart upload cycle with 3 unique parts, which
verifies composite checksum computation and the logic to propagate
parts_count to ComleteMultipart

Signed-off-by: Matt Benjamin <[email protected]>

* add test_post_object_upload_checksum

this tests a two-megabyte binary upload with validated
(awscli-computed) SHA256 checksum, and also verifies failure when
a bad checksum is provided

Signed-off-by: Matt Benjamin <[email protected]>

* remove duplicate size assigment [rkhudov review]

Signed-off-by: Matt Benjamin <[email protected]>

* mark two tests that fail on dbstore

also add @pytest.mark.checksum for new checksum
tests

Signed-off-by: Matt Benjamin <[email protected]>

* s3select: align error codes with the new AWS format

ref. ceph/ceph#56864

Signed-off-by: Seena Fallah <[email protected]>

* BucketPolicy: donot allow NotPrincipal with Allow Effect

Ref. ceph/ceph#58686

Signed-off-by: Seena Fallah <[email protected]>

* PolicyStatus: add test for policy with Principal

Ref. ceph/ceph#58686

Signed-off-by: Seena Fallah <[email protected]>

* BlockPublicPolicy: add test when policy has principal

Ref. https://tracker.ceph.com/issues/67048

Signed-off-by: Seena Fallah <[email protected]>

* BucketPolicy: add test for sse-c in conditions

Ref. ceph/ceph#58689

Signed-off-by: Seena Fallah <[email protected]>

* BucketPolicy: decouple encryption tests from invalid algo and unencrypted

Signed-off-by: Seena Fallah <[email protected]>

* s3: reenable tenanted bucket policy test

the before-call hook url-encodes the ':' part of tenanted bucket names
to resolve SignatureDoesNotMatch errors

removed the list-v2 version of the test since it isn't relevant to
bucket policy test coverage

add a new test case that creates the bucket under the tenanted user,
then uses the main client to access it

Signed-off-by: Casey Bodley <[email protected]>

* UploadPartCopy: add test for source bucket with policy

Ref: ceph/ceph#59253

Signed-off-by: Seena Fallah <[email protected]>

* rgw: adding tests for add_client_id_to_oidc_provider
and update_thumbprint_for oidc_provider.

Signed-off-by: Pritha Srivastava <[email protected]>

* fix the assert per empty results

Signed-off-by: Gal Salomon <[email protected]>

* fix comments

Signed-off-by: galsalomon66 <[email protected]>

* Add v2 signature presigned get_object tests

This adds tests for get_object presigned URLs
using signature v2.

Also code formatting.

Signed-off-by: Tobias Urdin <[email protected]>

* s3: add v2 signature presigned put_object tests

Signed-off-by: Casey Bodley <[email protected]>

* s3: test GetObject with PartNumber and SSE-C encryption

Signed-off-by: Casey Bodley <[email protected]>

* Updating lifecycle_noncur* tests to include objects with instance empty

Signed-off-by: Soumya Koduri <[email protected]>

* BucketPublicAccessBlock: add tests for RestrictPublicBuckets

Ref. ceph/ceph#57206
Signed-off-by: Seena Fallah <[email protected]>

* rgw/s3-test: adding test to set, get, delete and then get
a bucket policy to ensure that delete correctly removes
the bucket policy

Signed-off-by: Pritha Srivastava <[email protected]>

* rgw/s3-tests: adding a test to check put, get, delete and
then get to ensure that public block access is deleted
successfully.

Signed-off-by: Pritha Srivastava <[email protected]>

* rgw/s3tests: making the tests generic to check only
for 403 error code (and not specific errors) so that
the tests pass for any order of auth engines.

Signed-off-by: Pritha Srivastava <[email protected]>

* rgw:modify testcase rgw header when bucket quota or user is disabled
By default quota is disable at user/bucket level.
if quota is disable then these value will not return so need to modify test_head_bucket_usages

'X-RGW-Quota-User-Size'
'X-RGW-Quota-User-Objects'
'X-RGW-Quota-Bucket-Size'
'X-RGW-Quota-Bucket-Objects'
to Fix: https://tracker.ceph.com/issues/68211

Signed-off-by: Raja Sharma [email protected]

* sts: remove test_get_session_token_permanent_creds_denied

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

Signed-off-by: Casey Bodley <[email protected]>

* rgw/logging: basic set of tests for bucket logging

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: tests for flush API

as well as test for object key filters

Signed-off-by: Yuval Lifshitz <[email protected]>

* HeadBucket: add read-stats query string for usage test

Refs: ceph/ceph#56756

Signed-off-by: Seena Fallah <[email protected]>

* test get_object_attributes

Signed-off-by: Matt Benjamin <[email protected]>

* multipart fallback to create-multipart checksum algorithm

there seem to be workloads which assume checksum algorithm can be
omitted from upload-part

Signed-off-by: Matt Benjamin <[email protected]>

* more tests for GetObjectAttributes

* multipart upload without checksums
* multipart upload with a single part
* pagination of multipart parts
* non-multipart upload with/without checksum
* versioned object, current and non-current
* sse-c encrypted object

Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>

* mark attribute tests as failing on dbstore (for now)

Signed-off-by: Matt Benjamin <[email protected]>

* rgw/logging: test tenant support

when source and log buckets are on a specific tenant, or
on different tenants

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: test source and log have different names

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: test log bucket encryption error

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: add cleanup tests

* use flushing api instead of sleep when possible
* test flushing concurrency

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: fix typo in readme

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw test-case to support x-expected-bucket-owner
If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).
PR: ceph/ceph#61215
Fixes: https://tracker.ceph.com/issues/64526

Signed-off-by: Raja Sharma <[email protected]>

* test-case to fix obj by multipart upload cant get tag

Signed-off-by: Raja Sharma <[email protected]>

* add test case for stacked delete-markers

Signed-off-by: Jane Zhu <[email protected]>

* rgw|BN: fix test to expect authorization failure

Signed-off-by: Ali Masarwa <[email protected]>

* requirements: unpin botocore version

Signed-off-by: Casey Bodley <[email protected]>

* s3: mark sigv2 tests with fails_on_rgw

Signed-off-by: Casey Bodley <[email protected]>

* s3: sse-kms policy tests use v4 client

Signed-off-by: Casey Bodley <[email protected]>

* s3: clean up use of tenanted bucket names

the botocore.handlers.validate_bucket_name validation is enabled by
default, but we can disable it with unregister(). this avoids having to
mess with the signature or url

Signed-off-by: Casey Bodley <[email protected]>

* s3: disable request_checksum_calculation for test_multipart_checksum_upload_fallback

the test sends create_multipart_upload() with a requested checksum
algorithm, and upload_part() requests without. newer boto automatically
adds `x-amz-sdk-checksum-algorithm: CRC32` when nothing is specified,
so we have to explicitly disable that behavior via botocore config

Signed-off-by: Casey Bodley <[email protected]>

* s3: disable multipart/ranged tests with checksum failures

boto update exposed some bugs in our checksum feature around multipart
copy and ranged requests. disabling them with fails_on_rgw until
https://tracker.ceph.com/issues/69936 is resolved

Signed-off-by: Casey Bodley <[email protected]>

* iam: remove invalid Bucket param from list_buckets()

> botocore.exceptions.ParamValidationError: Parameter validation failed:
> Unknown parameter in input: "Bucket", must be one of: MaxBuckets, ContinuationToken, Prefix, BucketRegion

Signed-off-by: Casey Bodley <[email protected]>

* s3: disable checksum calculation for test_object_create_bad_contentlength_negative

if tls is enabled, boto will switch to STREAMING-UNSIGNED-PAYLOAD-TRAILER
and omit the provided content-length header. this leads to test failure:

> ________________ test_object_create_bad_contentlength_negative _________________
>       e = assert_raises(ClientError, client.put_object, Bucket=bucket_name, Key=key_name, ContentLength=-1)
> AssertionError: ClientError not raised

Signed-off-by: Casey Bodley <[email protected]>

* sns: clear region_name for s3 clients

work around sns failures due to default region_name='':

> ERROR s3tests_boto3/functional/test_sns.py::test_account_topic_publish - botocore.exceptions.EndpointResolutionError: Invalid region: region was not a valid DNS name.
> ERROR s3tests_boto3/functional/test_sns.py::test_cross_account_topic_publish - botocore.exceptions.EndpointResolutionError: Invalid region: region was not a valid DNS name.

Signed-off-by: Casey Bodley <[email protected]>

* rgw/iam: add RemoveClientIDFromOpenIDConnectProvider

Signed-off-by: Raja Sharma <[email protected]>

* s3: reenable tests with range requests and checksums

Signed-off-by: Casey Bodley <[email protected]>

* rgw/restore: s3tests to test restore object functionality.

This tests are added to tests temporary restore, permanent restore and
read through resotre object functionality, this includes zonegroup
parameters and checks.

Signed-off-by: shreyanshjain7174 <[email protected]>
Signed-off-by: Jiffin Tony Thottan <[email protected]>

* s3: test that object lock can be enabled on an existing bucket

Signed-off-by: Casey Bodley <[email protected]>

* running cloud restore tests seperately

Signed-off-by: Jiffin Tony Thottan <[email protected]>

* rgw/s3tests: removing fails_on_rgw for
test_versioned_concurrent_object_create_concurrent_remove
as the associated tracker is marked as resolved and
the test also passes against main.

Signed-off-by: Pritha Srivastava <[email protected]>

* s3: test bucket policy evaluation for CreateMultipartUpload

test case for https://tracker.ceph.com/issues/70191

Signed-off-by: Casey Bodley <[email protected]>

* mark test_versioning_stack_delete_merkers fails_on_dbstore

Signed-off-by: Jane Zhu <[email protected]>

* cloud-restore: testcase for non-current versioned object

Signed-off-by: Soumya Koduri <[email protected]>

* rgw/s3tests: handle allow read through values in cloud transitions cases

Check the allow_read_through values for cases test_lifecycle_cloud_transition
and test_read_through

Signed-off-by: Jiffin Tony Thottan <[email protected]>

* BucketPolicy: add tests for ConfirmRemoveSelfBucketAccess header

Refrence: ceph/ceph#57629
Signed-off-by: Seena Fallah <[email protected]>

* rgw/logging: add missing marker to remove warnings

Signed-off-by: Yuval Lifshitz <[email protected]>

* test put_bucket_acl with group uri

Signed-off-by: Casey Bodley <[email protected]>

* rgw/logging: add basic policy to target bucket

this commit needed to be able to run bucket logging regression
against: ceph/ceph#62284
since target bucket requires policy for bucket logging to work
this only covers the positive cases from bucket logging policy
perspective

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: add more bucket logging error cases

this is to cover these checks:
* source bucket ownership
* "requester pays" on log bucket

that were added in: ceph/ceph#62284

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: add bucket logging permission tests

this is to cover new functionality added in:
ceph/ceph#62284

Signed-off-by: Yuval Lifshitz <[email protected]>

* add minimal put-object for CRC64NVME

Signed-off-by: Matt Benjamin <[email protected]>

* enhance additional checksum tests

includes tests for CRC64NVME, tests for selecting
COMPOSITE and FULL_OBJECT checksums

a decomposed matrix of tests for all checksum types

also removes the mixed checksum upload case that no longer
works in recent boto3

cleanups, add sha1

checksum validation failure (mismatch) returns BadDigest

multipart checksum matrix helper now validates checksum and checksum type
for all operations which can return them (complete-multipart, head-object,
and get-object-attributes)

Signed-off-by: Matt Benjamin <[email protected]>

* rgw/logging: fix tenant test

tests were failing in teuthology since the tenanted user name
already have the tenant in its name

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: test bucket logging with accounts

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/cloud-transition: increase time out for test cases

Fixes: https://tracker.ceph.com/issues/69411
Signed-off-by: Jiffin Tony Thottan <[email protected]>

* rgw/logging: mark test that require rollover time set

Signed-off-by: Yuval Lifshitz <[email protected]>

* add test coverage for DeleteBucketLifecycle

Signed-off-by: Casey Bodley <[email protected]>

* rgw/logging: add tests for flushed object name

when using API call to flush the pending logging object of
the bucket, the flshed object name is returned.
tests were added to verify the right name is returned.

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: add tests to verify wildcrad policy

Signed-off-by: Yuval Lifshitz <[email protected]>

* Tag copy tests

* rgw/logging: test object metadata changes in journal mode

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: test mpu complete in standard mode

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: test log object name order

verify that the names of the log objects in the log bucket
are lexicographically ordered

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: test part upload in mpu in standard mode

Signed-off-by: Yuval Lifshitz <[email protected]>

* s3: test retry after error instead of 100-continue

Signed-off-by: Casey Bodley <[email protected]>

* s3: avoid 100-continue bug for test_encryption_sse_c_deny_algo_with_bucket_policy

was failing for a reason unrelated to sse-c or bucket policy

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

Signed-off-by: Casey Bodley <[email protected]>

* s3: Add tests for test_upload_part_copy_percent_encoded_key

* s3: fix: Changed test so that it accepts the character that has % sign in it as a key

* add missing 'assert' to test_bucket_logging_roll_time

saw a failure after this:
```
        response = client.list_objects_v2(Bucket=log_bucket_name)
        keys = _get_keys(response)
        len(keys) == 1

>       key = keys[0]
E       IndexError: list index out of range

s3tests_boto3/functional/test_s3.py:16637: IndexError
```

Signed-off-by: Casey Bodley <[email protected]>

* website: use pytest parametrize for test_routing_generator()

resolves error with recent pytest:

==================================== ERRORS ====================================
____________ ERROR collecting s3tests/functional/test_s3_website.py ____________
'yield' keyword is allowed in fixtures, but not in tests (test_routing_generator)

use https://docs.pytest.org/en/7.1.x/example/parametrize.html instead to
generate a test_routing_generator() for each entry in ROUTING_RULES_TESTS

Signed-off-by: Casey Bodley <[email protected]>

* website: routing_setup() as pytest fixture

c80e9d2 had removed the use of
routing_setup() without adding a fixture to replace it. this had broken
routing_check(), but we hadn't noticed it because pytest hadn't
supported the 'yield' pattern in test_routing_generator() to call it

test_routing_generator() now uses this routing_setup fixture to provide
the kwargs that had previously been injected into routing_check() via
@common.with_setup_kwargs(setup=routing_setup, teardown=routing_teardown)

Signed-off-by: Casey Bodley <[email protected]>

* increase time out for restore op in test_restore_object_permanent
and in test_lifecycle_expiration_size_gt() for lc.

Fixes: https://tracker.ceph.com/issues/71348
Signed-off-by: Jiffin Tony Thottan <[email protected]>

* fix: Fix typo

Signed-off-by: Emin <[email protected]>

* rgw/logging: test conf last modified time

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: add tests for logging object key format

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/sts: GetAccountSummary test

Signed-off-by: Raja Sharma <[email protected]>

* readme: fix typo

Fixed typos in the example commands.

Signed-off-by: N Balachandran <[email protected]>

* s3: test_block_public_object_canned_acls() tests that 'private' works

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

Signed-off-by: Casey Bodley <[email protected]>

* bucket-logging: tests for the ACLRequired field

Tests that the AclRequired field is set correctly in the bucket logging record.

Signed-off-by: N Balachandran <[email protected]>

* bucket-logging: fix typo

Fixes typo in function name.

Signed-off-by: N Balachandran <[email protected]>

* bucket-logging: test the AuthType log field

Adds a test to check the value of the AuthType field.

Signed-off-by: N Balachandran <[email protected]>

* rgw/sts: GetCallerIndentity test

Signed-off-by: Raja Sharma <[email protected]>

* delete, rgwlc: delete marker tests

0. non-creation in non-versioned buckets
1. creation in versioned buckets
2. creation in versioning-suspended buckets
3. delete-marker expiration (lifecycle)

Signed-off-by: Matt Benjamin <[email protected]>

* bucket_logging: remove duplicate function

Removes the duplicate _verify_record_field function definition.

Signed-off-by: N Balachandran <[email protected]>

* s3: test put_object() with IfMatch and IfNoneMatch

Signed-off-by: Casey Bodley <[email protected]>

* s3: test delete_object() with IfMatch

Signed-off-by: Casey Bodley <[email protected]>

* s3: test delete_object() with IfMatchLastModifiedTime

Signed-off-by: Casey Bodley <[email protected]>

* s3: test delete_object() with IfMatchSize

Signed-off-by: Casey Bodley <[email protected]>

* s3: test delete_objects() with ETag

Signed-off-by: Casey Bodley <[email protected]>

* s3: test delete_objects() with LastModifiedTime

Signed-off-by: Casey Bodley <[email protected]>

* s3: test delete_objects() with Size

Signed-off-by: Casey Bodley <[email protected]>

* s3: fixed tests

we expected an error if we delete non-existent objects but that is not
true

Signed-off-by: Ali Masarwa <[email protected]>

* s3: more testing for conditional put

Signed-off-by: Ali Masarwa <[email protected]>

* a fix for empty results.for some of the queries
an empty result that may rarely happen, could cause an assertion.
the fix handle that cases.

Signed-off-by: gal salomon <[email protected]>
Co-authored-by: Copilot <[email protected]>

* rgw/cloud-restore: verify if the expiry-date is updated

This is the test-case for ceph/ceph#64804.
If the `restoe-object` request is re-issued on a cloud-restored object,
it should update restoration period accordingly from the time the request
is re-issued.

Signed-off-by: Soumya Koduri <[email protected]>

* s3: test list_buckets with MaxBuckets/ContinuationToken

Signed-off-by: Casey Bodley <[email protected]>

* s3: test for aws-chunked in Content-Encoding responses

aws-chunked should not be persisted on upload for return on download

Signed-off-by: Casey Bodley <[email protected]>

* test_s3 versioning multi object delete - add more versions for each object

Signed-off-by: Oguzhan Ozmen <[email protected]>

* test_s3: verify list_object_versions after multi-object delete with versioning

Extend test_versioning_concurrent_multi_object_delete to also verify that
list_object_versions returns no Versions or DeleteMarkers after all objects
and their versions have been deleted. This ensures both list_objects and
list_object_versions reflect an empty bucket.

* extend test_versioning_obj_suspended_copy to test copy to another non-versioned bucket

Signed-off-by: Jane Zhu <[email protected]>

* rgw/logging: modify tests to allow for committing empty objects

new tests were added and existing tests that assumed the previous
behavior were modified.
testing: ceph/ceph#65387

Signed-off-by: Yuval Lifshitz <[email protected]>

* s3: Mark tests known to fail on dbstore

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

Signed-off-by: Adam C. Emerson <[email protected]>

* rgw/logging: fix cleanup tests for rollovers

This is to test this PR: ceph/ceph#65456

Signed-off-by: Yuval Lifshitz <[email protected]>

* rgw/logging: add conf change specific tests

and also test updates while writing logs
fix: cover all src buckets in cleanup tests

Signed-off-by: Yuval Lifshitz <[email protected]>

* s3: test conditional multipart_put_object()

Signed-off-by: Ali Masarwa <[email protected]>
Signed-off-by: Ali Masarwa <[email protected]>

* rgw/logging: verify error message when AccessDenied on target

testing: ceph/ceph#65494

Signed-off-by: Yuval Lifshitz <[email protected]>

* s3: test object ownership

Signed-off-by: Casey Bodley <[email protected]>

* qa/rgw: Include rgw_restore_processor_period in restore tests

This adjusts restore period as per ceph/ceph#64933

Also deleting lifecycle post transition so that temp restored files
remain for a while without being re-transitioned immeditately.

Signed-off-by: Soumya Koduri <[email protected]>

* remove boto2 tests and dependency

boto2 import fails on recent python with:
> E   ModuleNotFoundError: No module named 'boto.vendored.six.moves'

remove all tests under s3tests/ that weren't converted to boto3

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

Signed-off-by: Casey Bodley <[email protected]>

* rename s3tests_boto3/ back to s3tests/

Signed-off-by: Casey Bodley <[email protected]>

* rgw/restore: Fixing readthrough

Signed-off-by: Soumya Koduri <[email protected]>

* s3: test checksum for get_object with part number

* rgw/logging: change test to match the new source cleanup process

* in "journal" mode, when multiple source buckets share the same log prefix,
the first one being deleted will remove the object holding the temporary
object name, and only the first would commit the temp object.
* in "standard" mode, the other buckets will recreate the object holding
the temporary object name, becase the bucket deletion operation will be
logged as well.
* added tests where only one of the buckets sharing a common prefix is
  deleted and the rest are not

Signed-off-by: Yuval Lifshitz <[email protected]>

* CopyObject: add test for encrypted objects

Add test for copy on sse-s3 and sse-c encrypted objects.

Signed-off-by: Seena Fallah <[email protected]>

* CopyObject: add storage class copy tests

Signed-off-by: Seena Fallah <[email protected]>

* lc-transition: add test with encrypted objects

Signed-off-by: Seena Fallah <[email protected]>

* UploadPart: add copy part with encryption

Signed-off-by: Seena Fallah <[email protected]>

* CompleteMultipartUpload: test to verify sse-c headers

Signed-off-by: Seena Fallah <[email protected]>

* UploadPart: test to verify sse-c headers

Signed-off-by: Seena Fallah <[email protected]>

* refactor: merge test_copy_enc_ with test_copy_enc_storage_class

Signed-off-by: Seena Fallah <[email protected]>

* test_multipart_sse_c_get_part: pass enc attrs on mp complete

Based on the new fixes around copy enc, those headers are required
when completing mp upload.

Signed-off-by: Seena Fallah <[email protected]>

* functional: fix invalid escape sequence deprication warning

This change address multiple messages in the log:

    DeprecationWarning: invalid escape sequence '\$'

Signed-off-by: Kyr Shatskyy <[email protected]>

* rgw/bucket-logging: handle async log commits

Modified to work with the new asynchronous buckt logging commit
mechanism.

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

Signed-off-by: Nithya Balachandran <[email protected]>

* s3: update etag for get_part tests

* Revert "SPL-170872 mark few false negative tests for splunk skip. (#6)"

This reverts commit 3dc9362.

* Revert "Mark false negative tests in s3-test"

This reverts commit ec2aef0.

* Revert "update requirements.txt && fix README typo"

This reverts commit 4b10f5a.

* Revert "splunk S3-compatibility checking tool v1"

This reverts commit 69b2678.

* Update to latest ceph/s3-tests, fix all tests, and introduce core S3 compliance tests

- Rebased branch to latest upstream ceph/s3-tests
- Fixed all test failures for compatibility
- Added Splunk-specific compliance test lists and skip logic
- Updated README with Splunk S3 compliance instructions
- Introduced core test set for S3 compliance validation
- Improved configuration and test selection for Splunk environments

This update ensures the branch is up-to-date, core compliance tests are clearly defined for S3 validation."

* s3 core tests shell script after deselecting some tests

* fixed the test sets

---------

Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Gal Salomon <[email protected]>
Signed-off-by: Sumedh A. Kulkarni <[email protected]>
Signed-off-by: Bob Ham <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Seena Fallah <[email protected]>
Signed-off-by: Pritha Srivastava <[email protected]>
Signed-off-by: galsalomon66 <[email protected]>
Signed-off-by: Tobias Urdin <[email protected]>
Signed-off-by: Soumya Koduri <[email protected]>
Signed-off-by: Raja Sharma [email protected]
Signed-off-by: Raja Sharma <[email protected]>
Signed-off-by: Jane Zhu <[email protected]>
Signed-off-by: Ali Masarwa <[email protected]>
Signed-off-by: shreyanshjain7174 <[email protected]>
Signed-off-by: Jiffin Tony Thottan <[email protected]>
Signed-off-by: Emin <[email protected]>
Signed-off-by: N Balachandran <[email protected]>
Signed-off-by: gal salomon <[email protected]>
Signed-off-by: Oguzhan Ozmen <[email protected]>
Signed-off-by: Adam C. Emerson <[email protected]>
Signed-off-by: Ali Masarwa <[email protected]>
Signed-off-by: Kyr Shatskyy <[email protected]>
Signed-off-by: Nithya Balachandran <[email protected]>
Co-authored-by: Matt Benjamin <[email protected]>
Co-authored-by: Yuval Lifshitz <[email protected]>
Co-authored-by: Casey Bodley <[email protected]>
Co-authored-by: Gal Salomon <[email protected]>
Co-authored-by: Sumedh A. Kulkarni <[email protected]>
Co-authored-by: Casey Bodley <[email protected]>
Co-authored-by: Seena Fallah <[email protected]>
Co-authored-by: Pritha Srivastava <[email protected]>
Co-authored-by: Tobias Urdin <[email protected]>
Co-authored-by: Soumya Koduri <[email protected]>
Co-authored-by: Raja Sharma <[email protected]>
Co-authored-by: Adam Emerson <[email protected]>
Co-authored-by: Yuval Lifshitz <[email protected]>
Co-authored-by: Jane Zhu <[email protected]>
Co-authored-by: Raja <[email protected]>
Co-authored-by: Ali Masarwa <[email protected]>
Co-authored-by: shreyanshjain7174 <[email protected]>
Co-authored-by: Jiffin Tony Thottan <[email protected]>
Co-authored-by: Andrew Gaul <[email protected]>
Co-authored-by: Emin <[email protected]>
Co-authored-by: N Balachandran <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Oguzhan Ozmen <[email protected]>
Co-authored-by: sungjoon_koh <[email protected]>
Co-authored-by: Kyr Shatskyy <[email protected]>
Co-authored-by: chamara-splunk <[email protected]>
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.

2 participants