Skip to content

Manage encryption in Object Storage

Last updated on

All data stored in STACKIT Object Storage is encrypted at rest using AES256. In addition, you can use server-side encryption (SSE) or server-side encryption with customer-provided keys (SSE-C) to encrypt individual objects during upload.

SSE encrypts an object with a unique key during upload. The encryption keys are managed by the storage backend.

To enable SSE for an upload, include the following header in your S3 request:

SSE is supported for the following operations:

  • PUT Object
  • PUT Object - Copy
  • Initiate Multipart Upload

Upload an object with server-side encryption

Section titled “Upload an object with server-side encryption”
Terminal window
aws s3 cp ./my-file.txt s3://my-bucket/ \
--sse AES256 \
--endpoint-url https://object.storage.eu01.onstackit.cloud

Server-side encryption with customer-provided keys

Section titled “Server-side encryption with customer-provided keys”

SSE-C encrypts objects using a key that you provide and manage yourself. The key is used during the operation and is not stored on STACKIT systems.

Key management responsibilities:

  • Track the mapping between keys and objects yourself.
  • If versioning is enabled, use a unique key for each version and track the mapping between object versions and keys yourself.
  • Rotate your keys yourself.

To use SSE-C, include the following headers in your S3 request:

SSE-C is supported for the following operations:

  • GET Object
  • PUT Object
  • PUT Object - Copy
  • HEAD Object
  • Initiate Multipart Upload
  • Upload Part
  • Upload Part - Copy

When using SSE-C, the ETag in the response is not the MD5 checksum of the object data.

Generate a random 256-bit key and encode it as base64:

Terminal window
openssl rand -base64 32
Terminal window
aws s3 cp ./my-file.txt s3://my-bucket/ \
--sse-c AES256 \
--sse-c-key <your-base64-encoded-key> \
--endpoint-url https://object.storage.eu01.onstackit.cloud

You must provide the same key that was used during upload:

Terminal window
aws s3 cp s3://my-bucket/my-file.txt ./my-file-downloaded.txt \
--sse-c AES256 \
--sse-c-key <your-base64-encoded-key> \
--endpoint-url https://object.storage.eu01.onstackit.cloud