Skip to main content

GetBucketEncryption

GetBucketEncryption returns a bucket's default server-side encryption configuration: the encryption applied to new objects uploaded without an encryption header of their own. On STRG that default is server-side encryption with STRG-managed keys (AES256), so the answer is simple to read and always the same. PutBucketEncryption is its counterpart for setting it.

Good to know on STRG
  • The answer is always AES256: we manage the keys for you, so there is no KMS key ID to return.
  • A bucket that was never given a default answers 200 with AES256 as well, so a client never has to handle 404 ServerSideEncryptionConfigurationNotFoundError.
  • x-amz-expected-bucket-owner is welcome and has nothing to check.

When you'd use it​

  • A security review asks whether data at rest is encrypted. An audit script goes through every bucket, calls GetBucketEncryption on each and records the AES256 answer as evidence.
  • Infrastructure-as-code and backup tools often read a bucket's settings before working with it, encryption among them. STRG answers with the bucket's default, so they carry on as usual.
  • An agent setting up a bucket for a new project calls PutBucketEncryption and then reads the configuration back to confirm it before reporting the bucket ready.

Request​

GET /?encryption HTTP/1.1
Host: my-bucket.s3.eu-central-1.strg.com
Authorization: AWS4-HMAC-SHA256 Credential=...
x-amz-date: 20260926T120000Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Path-style, the same request is GET /my-bucket?encryption on s3.eu-central-1.strg.com. Addressing describes both styles.

Permissions​

The access key needs Read encryption settings (bucket-encryption:read). A key limited to certain buckets can hold it too, and then reaches only those buckets. Access keys has the details.

URI parameters​

NameTypeRequiredDescription
BucketStringYesThe bucket whose default encryption is read.
encryptionFlagYesSelects the encryption subresource. Sent without a value.

Any other query parameter is answered 501 NotImplemented, so a client knows straight away that it has no effect here.

Request headers​

NameTypeRequiredDescription
x-amz-expected-bucket-ownerStringNoWelcome, and has nothing to check: an access key only ever reaches its own account's buckets.

Request body​

None.

Response​

A successful request answers 200 OK with the configuration as XML.

Response headers​

NameDescription
x-amz-request-idThe request ID, for support requests.

Response body​

The configuration holds one rule, and its elements are these.

ElementTypeDescription
ServerSideEncryptionConfigurationContainerThe root element.
RuleContainerOne rule. STRG always returns exactly one.
ApplyServerSideEncryptionByDefaultContainerThe default applied to new objects.
SSEAlgorithmStringAlways AES256: server-side encryption with STRG-managed keys. aws:kms and aws:kms:dsse never appear.
KMSMasterKeyIDStringNever returned: STRG manages the keys, so there is no KMS key to name.
BucketKeyEnabledBooleanNot used. Bucket keys belong to SSE-KMS, which STRG's managed keys make unnecessary.
BlockedEncryptionTypesContainerNever returned. STRG has no setting for blocking encryption types.
<?xml version="1.0" encoding="UTF-8"?>
<ServerSideEncryptionConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Rule>
<ApplyServerSideEncryptionByDefault>
<SSEAlgorithm>AES256</SSEAlgorithm>
</ApplyServerSideEncryptionByDefault>
</Rule>
</ServerSideEncryptionConfiguration>

Errors​

These are the errors this operation can answer, and the situation behind each.

CodeHTTP statusWhen
NoSuchBucket404The bucket does not exist, it is in a region other than the endpoint's, or your account has no storage in this endpoint's region yet.
AccessDenied403The access key lacks Read encryption settings, or is limited to buckets that do not include this one.
InvalidAccessKeyId403The access key does not exist, has expired or been revoked, or was created so recently that it is not yet usable in this endpoint's region - a moment later it is.
SignatureDoesNotMatch403The request signature is wrong.
RequestTimeTooSkewed403The request time is more than 15 minutes from the server's.
AuthorizationHeaderMalformed400The signature's credential scope names a region other than the endpoint's.
NotImplemented501The request carries a query parameter this operation does not accept.
SlowDown503Too many requests at once; a retry after the Retry-After interval goes through.
ServiceUnavailable503A temporary failure; a retry usually succeeds.

Differences from Amazon S3​

A few things work a little differently on STRG, each listed here with what it means for your requests.

AspectAmazon S3STRG
AlgorithmsAES256 (SSE-S3), aws:kms, aws:kms:dsseAES256, server-side encryption with STRG-managed keys - one answer, with no keys for you to manage
Bucket never configuredAES256, the S3 defaultAES256 as well, never 404 ServerSideEncryptionConfigurationNotFoundError
BucketKeyEnabled, BlockedEncryptionTypesReturned where setNot part of the answer: neither setting exists on STRG
Bucket in another region301 redirect with x-amz-bucket-region404 NoSuchBucket. Each bucket answers on its own regional endpoint.
x-amz-expected-bucket-ownerChecked against the bucket ownerWelcome, with nothing to check: a key only ever reaches buckets of its own account

Examples​

Each example reads the default encryption of my-bucket; the SDK examples print its algorithm.

aws s3api get-bucket-encryption \
--bucket my-bucket \
--endpoint-url https://s3.eu-central-1.strg.com \
--region eu-central-1
View as Markdown