Server-Side Encryption with Per-Bucket Keys (SSE-KMS)
MinIO Server-Side Encryption (SSE) protects objects as part of write operations, allowing clients to take advantage of server processing power to secure objects at the storage layer (encryption-at-rest). SSE also provides key functionality to regulatory and compliance requirements around secure locking and erasure.
MinIO SSE uses the PGSTY KES and a supported external Key Management Service (KMS) for performing secured cryptographic operations at scale. MinIO also supports client-managed key management, where the application takes full responsibility for creating and managing encryption keys for use with MinIO SSE.
MinIO SSE-KMS encrypts or decrypts objects using an External Key (EK) managed by a Key Management System (KMS). Each bucket and object can have a separate EK, supporting more granular cryptographic operations in the deployment. MinIO can only decrypt an object if it can access both the KMS and the EK used to encrypt that object.
You can enable bucket-default SSE-KMS encryption using the mc encrypt set command:
- Replace
EXTERNALKEYwith the name of the EK to use for encrypting objects in the bucket. - Replace
play/mybucketwith thealiasand bucket on which you want to enable automatic SSE-KMS encryption.
MinIO SSE-KMS is functionally compatible with AWS S3 Server-Side Encryption with KMS keys stored in AWS using KES as the key service. The following archived upstream integration guides describe inherited backends; the maintained integration is SILO + PGSTY KES + OpenBao KV v2:
- AWS Secrets Manager
- Azure Key Vault
- Entrust KeyControl
- Fortanix SDKMS
- Google Cloud Secret Manager
- HashiCorp Vault Keystore
- Thales CipherTrust Manager (formerly Gemalto KeySecure)
Quickstart
Use a PGSTY KES deployment you control. Complete Configure SILO with KES first, including persistent key storage, TLS trust, a SILO application policy, and a working mysilo client alias. Do not use public demonstration keys for stored data.
1) Create an Encryption Key for SSE-KMS
The KES procedure creates silo-default for backend data and SSE-S3, and silo-bucket for the SSE-KMS example. Ensure silo-bucket exists and that SILO’s KES identity may generate and decrypt data keys with it. An administrator can provision additional permitted keys with mcli admin kms key create mysilo KEYNAME.
2) Configure SILO for SSE-KMS
Every server needs the same KES configuration. For the example from the KES procedure:
Keep the API key secret and use the actual CA path on each SILO host. The API key and explicit client key/certificate settings are mutually exclusive. For an existing encrypted deployment, preserve the original default key and all keys needed by existing objects.
3) Apply the Server Configuration
If you changed the environment, restart the deployment through the service manager that owns it. For systemd EnvironmentFile changes, restart silo.service; an administrative restart alone does not reload that file unless SILO separately loads it through MINIO_CONFIG_ENV_FILE. If the KES procedure is already complete and the configuration is unchanged, no additional restart is needed.
4) Configure Automatic Bucket Encryption
Create the example bucket if it does not exist, then set its default encryption:
This setting applies to a bucket, not a prefix. Verify a new object with mcli cp, mcli stat, and a read as shown in the KES procedure. Existing objects are not rewritten by changing the default.
You can remove the bucket default with mcli encrypt clear mysilo/encryptedbucket. This does not decrypt existing objects or backend data, and does not remove the need to retain their keys. A server-wide automatic encryption setting or an explicit encryption request may still encrypt new writes.
Secure Erasure and Locking
KES and SILO can cache key material. Sealing a key store or revoking access is not guaranteed to invalidate cached keys immediately; account for cache expiry and active processes when testing revocation.
SSE-KMS protects objects using an EK specified either as part of the bucket automatic encryption settings or as part of the write operation. MinIO therefore requires access to that EK for decrypting that object.
- Disabling access to the EK prevents decryption of dependent objects once usable cached key material is also unavailable. Restoring access to the original key permits decryption again.
- Permanently losing every usable copy of the EK, including cached copies and backups, makes objects that still depend on it unrecoverable.
The scope of a single EK depends on:
- Which buckets specified that EK for automatic SSE-KMS encryption, and
- Which write operations specified that EK when requesting SSE-KMS encryption.
For example, a key used only by one bucket limits key-loss effects to objects that still depend on that key. A key shared across buckets couples their recovery requirements. Bucket defaults can change and clients can select other keys, so check object versions rather than inferring key use from the current bucket setting.
Encryption Process
Note
This section describes MinIO internal logic and functionality. This information is purely educational and is not a prerequisite for configuring or implementing any MinIO feature.
SSE-KMS uses an External Key (EK) managed by the configured Key Management System (KMS) for performing cryptographic operations and protecting objects. The table below describes each stage of the encryption process:
Stage |
Description |
|---|---|
SSE-Enabled Write Operation |
MinIO receives a write operation requesting SSE-KMS encryption. The write operation must have an associated External Key (EK) to use for encrypting the object.
|
Generate the Data Encryption Key (DEK) |
MinIO generates a Data Encryption Key (DEK) using the EK. Specifically, MinIO Key Encryption Service (KES) requests a new cryptographic key from the KMS using the EK as the “root” key. KES returns both the plain-text and an EK-encrypted representation of the DEK. MinIO stores the encrypted representation as part of the object metadata. |
Generate the Key Encryption Key (KEK) |
MinIO uses a deterministic algorithm to generate a 256-bit unique Key Encryption Key (KEK). The key-derivation algorithm uses a pseudo-random function that takes the plain-text DEK, a randomly generated initialization vector, and a context consisting of values like the bucket and object name. MinIO generates the KEK at the time of each cryptographic encryption or decryption operation and never stores the KEK to a drive. |
Generate the Object Encryption Key (OEK) |
MinIO generates a random 256-bit unique Object Encryption Key (OEK) and uses that key to encrypt the object. MinIO never stores the plaintext representation of the OEK on a drive. The plaintext OEK resides in RAM during cryptographic operations. |
Encrypt the Object |
MinIO uses the OEK to encrypt the object prior to storing the object to the drive. MinIO then encrypts the OEK with the KEK. MinIO stores the encrypted representation of the OEK and DEK as part of the metadata. |
For read operations, MinIO decrypts the object by retrieving the EK to decrypt the DEK. MinIO then regenerates the KEK, decrypts the OEK, and decrypts the object.