Skip to main content

PutBucketEncryption

Sets the default encryption configuration for a bucket.

Description

The PutBucketEncryption operation sets the default server-side encryption configuration for a bucket. By default, all buckets have encryption enabled with QStorage-managed keys.

important

When using QKMS (SSE-KMS or DSSE-KMS), QStorage will still encrypt the data an additional time with the network's default encryption before it hits the network, regardless of the encryption configuration specified.

note
  • To use this operation, you must have permission to perform the s3:PutEncryptionConfiguration action.
  • You must be the bucket owner to use this operation.
  • The encryption configuration specified replaces any existing configuration.

Request Syntax

PUT /?encryption HTTP/1.1
Host: BucketName.qstorage.quilibrium.com
Content-MD5: Base64EncodedMD5
x-amz-expected-bucket-owner: OwnerAccountId
<?xml version="1.0" encoding="UTF-8"?> <ServerSideEncryptionConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Rule> <ApplyServerSideEncryptionByDefault> <SSEAlgorithm>verenc</SSEAlgorithm> <KMSMasterKeyID>qkms:key-id</KMSMasterKeyID> </ApplyServerSideEncryptionByDefault> <BucketKeyEnabled>true</BucketKeyEnabled> </Rule> </ServerSideEncryptionConfiguration>
Values in italics indicate user input and should be replaced with actual values.

Request Parameters

Headers

NameDescriptionRequiredType
Content-MD5The base64-encoded 128-bit MD5 digest of the request bodyYestext
x-amz-expected-bucket-ownerThe account ID of the expected bucket ownerNotext

Request Body Elements

NameTypeDescriptionRequired
ServerSideEncryptionConfigurationContainerContainer for server-side encryption configuration rulesYes
RuleServerSideEncryptionRuleContainer for a server-side encryption rule. The bucket encryption configuration can include only one rule.Yes

Examples

Example 1: Set default encryption using QStorage-managed keys (SSE-S3)

PUT /?encryption HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Content-MD5: DqB+2AhQpgX6OJAYrGA8Vw==
<?xml version="1.0" encoding="UTF-8"?> <ServerSideEncryptionConfiguration> <Rule> <ApplyServerSideEncryptionByDefault> <SSEAlgorithm>AES256</SSEAlgorithm> </ApplyServerSideEncryptionByDefault> </Rule> </ServerSideEncryptionConfiguration>
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
Values in italics indicate variable response values.

Example 2: Set default encryption using QKMS (SSE-KMS)

PUT /?encryption HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
Content-MD5: DqB+2AhQpgX6OJAYrGA8Vw==
<?xml version="1.0" encoding="UTF-8"?> <ServerSideEncryptionConfiguration> <Rule> <ApplyServerSideEncryptionByDefault> <SSEAlgorithm>verenc</SSEAlgorithm> <KMSMasterKeyID>qkms:1234abcd-12ab-34cd-56ef-1234567890ab</KMSMasterKeyID> </ApplyServerSideEncryptionByDefault> <BucketKeyEnabled>true</BucketKeyEnabled> </Rule> </ServerSideEncryptionConfiguration>
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
Values in italics indicate variable response values.

Response Syntax

HTTP/1.1 200 OK
x-amz-id-2: RequestId
x-amz-request-id: AmazonRequestId
Date: ISO8601Date
Values in italics indicate variable response values.

Response Elements

Response Headers

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
DateThe date and time at which the response was sentNoString

This operation does not return a response body.

Special Errors

Error CodeDescription
NoSuchBucketThe specified bucket does not exist
InvalidArgumentThe encryption configuration is not valid
403Forbidden. Authentication failed or you do not have permission to set the encryption configuration

Permissions

You must have the s3:PutEncryptionConfiguration permission.

Try It Out

Test PutBucketEncryption

Set the default encryption configuration of a bucket.

Coming Soon

This feature is currently under development and will be available soon.