Project

General

Profile

Actions

Bug #80921

open
KB KB

rgw: S3 APIs that RGW does not implement run as another bucket or object operation

Bug #80921: rgw: S3 APIs that RGW does not implement run as another bucket or object operation

Added by Kyle Bader 2 months ago. Updated 2 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
umbrella, tentacle, squid
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Found by comparing RGW's S3 dispatch against AWS's published Smithy model of S3 (aws/api-models-aws, models/s3/service/2006-03-01 at f9dcea01). Reproduced on main at 7ed73efc1be on a single-host vstart cluster, with new s3-tests cases. By code review, tentacle has the same code.

The op_get, op_put, op_delete and op_post methods of RGWHandler_REST_Bucket_S3 and RGWHandler_REST_Obj_S3 (rgw_rest_s3.cc:5416-5670) test the query arguments they know. For anything else they run the plain operation for the method. A request for an S3 API that RGW does not implement therefore runs as a different operation, and is answered success:

SDK call Request What RGW does
DeleteBucketMetricsConfiguration, DeleteBucketAnalyticsConfiguration, DeleteBucketInventoryConfiguration, DeleteBucketIntelligentTieringConfiguration DELETE /{bucket}?metrics&id=... etc. DeleteBucket: an empty bucket is deleted, 204
DeleteBucketMetadataConfiguration, DeleteBucketMetadataTableConfiguration (by code review) DELETE /{bucket}?metadataConfiguration, ?metadataTable the same
DeleteObjectAnnotation DELETE /{bucket}/{key}?annotation DeleteObject: the object is deleted, 204
PutObjectAnnotation PUT /{bucket}/{key}?annotation PutObject: the object's data is replaced by the annotation, 200
UpdateObjectEncryption PUT /{bucket}/{key}?encryption PutObject: the object's data is replaced by the request's XML, 200
RenameObject PUT /{bucket}/{key}?renameObject PutObject with no body: a 0-byte object at the destination, over any object there; the source is left; 200
GetBucketMetricsConfiguration, and the Get and List calls for analytics, inventory, intelligent-tiering, accelerate, ABAC and metadata configurations; CreateSession GET /{bucket}?metrics&id=... etc. ListObjects, 200
GetObjectAnnotation (by code review) GET /{bucket}/{key}?annotation GetObject: the object's data

Tools that manage bucket configuration, such as Terraform, call the Delete*Configuration APIs when they remove a configuration. #46263 reported this for DeleteBucketEncryption and DeleteBucketReplication. Its fix added those two sub-resources to the dispatch, so each API added to S3 since then falls through the same way.

Reproducers, in s3tests/functional/test_s3.py, each marked fails_on_rgw:
  • test_bucket_config_delete_keeps_bucket, one case each for metrics, analytics, inventory and intelligent-tiering: the bucket is gone afterwards.
  • test_object_annotation_put_keeps_object and test_update_object_encryption_keeps_data: the object's data is replaced.
  • test_object_annotation_delete_keeps_object: the object is deleted.
  • test_rename_object_keeps_destination: the rename answers success, and the destination is empty.
  • test_bucket_metrics_configuration_get_unconfigured: answered 200.

An S3 implementation that lacks an API refuses it, with 501 NotImplemented, and changes nothing. A fix could answer 501 for a request that names an S3 sub-resource the handler does not serve, checked against a list of S3's sub-resources, rather than adding guards one API at a time.


Related issues 1 (0 open — 1 closed)

Related to rgw - Bug #46263: S3 API DELETE /{bucket}?encryption or DELETE /{bucket}?replication remove bucketResolvedAbhishek Lekshmanan

Actions

KB Updated by Kyle Bader 2 months ago Actions #1

  • Related to Bug #46263: S3 API DELETE /{bucket}?encryption or DELETE /{bucket}?replication remove bucket added

MH Updated by Matthew Heler 2 months ago Actions #2

  • Status changed from New to Fix Under Review
  • Assignee set to Kyle Bader
  • Backport changed from tentacle to umbrella, tentacle, squid
  • Pull request ID set to 72114
Actions

Also available in: PDF Atom