Encryption
+Protect data at rest with server-side encryption using AES-256-GCM. Objects are encrypted before being written to disk and decrypted transparently on read.
+ +Encryption Types
+| Type | +Description | +
|---|---|
| AES-256 (SSE-S3) | +Server-managed encryption using a local master key | +
| KMS (SSE-KMS) | +Encryption using customer-managed keys via the built-in KMS | +
Enabling Encryption
+-
+
-
+ Set environment variables:
+
+# PowerShell +$env:ENCRYPTION_ENABLED = "true" +$env:KMS_ENABLED = "true" # Optional +python run.py + +# Bash +export ENCRYPTION_ENABLED=true +export KMS_ENABLED=true +python run.py
+ - + Configure bucket encryption: Navigate to your bucket → Properties tab → Default Encryption card → Click Enable Encryption. + +
- + Choose algorithm: Select AES-256 for server-managed keys or aws:kms to use a KMS-managed key. + +
KMS Key Management
+When KMS_ENABLED=true, manage encryption keys via the API:
# Create a new KMS key
+curl -X POST {{ api_base }}/kms/keys \
+ -H "Content-Type: application/json" \
+ -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>" \
+ -d '{"alias": "my-key", "description": "Production key"}'
+
+# List all keys
+curl {{ api_base }}/kms/keys \
+ -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>"
+
+# Rotate a key (creates new key material)
+curl -X POST {{ api_base }}/kms/keys/{key-id}/rotate \
+ -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>"
+
+# Disable/Enable a key
+curl -X POST {{ api_base }}/kms/keys/{key-id}/disable \
+ -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>"
+
+# Schedule key deletion (30-day waiting period)
+curl -X DELETE "{{ api_base }}/kms/keys/{key-id}?waiting_period_days=30" \
+ -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>"
+
+ How It Works
++ Envelope Encryption: Each object is encrypted with a unique Data Encryption Key (DEK). The DEK is then encrypted (wrapped) by the master key or KMS key and stored alongside the ciphertext. On read, the DEK is unwrapped and used to decrypt the object transparently. +
+