Your own encryption key (BYOK)
Encrypt your organization's storage files and database backups with a key you hold in AWS KMS. Revoke it and that data can no longer be read — by anyone, Sovaria included.
On Enterprise, an organization can bring its own AWS KMS key. Sovaria then encrypts the organization's storage files and database backups under that key, and can only use it with your organization's encryption context — so no other organization's requests can. You stay in control in AWS: every use of the key shows in your CloudTrail, and disabling or revoking it makes that data unreadable.
How it works
- Files are written with S3 server-side encryption under your key (SSE-KMS); reading one needs your key.
- Backups and pause archives are encrypted with AES-256-GCM using an organization data key. Sovaria stores that data key only wrapped by your KMS key and keeps the unwrapped copy in memory for a few minutes at most.
- Every file and backup is bound to your organization: the encryption context
sovaria:org_idmust match, and the key policy only allows that context.
What it covers — and what it doesn't
| Data | Under your key? | How it is protected |
|---|---|---|
| Storage files | Yes | S3 SSE-KMS with your key. Files from before you added the key stay under Sovaria's key until you re-encrypt them. |
| Database backups and pause archives | Yes | AES-256-GCM with the organization data key, wrapped by your key. |
| Database files of your running Postgres | No | Encrypted at rest by the server's disk encryption (AWS-managed key). Dedicated Enterprise instances can use your key for the volume — ask your account team. |
| Function secrets, project secrets, database passwords | No | Encrypted with Sovaria's keys (AES-256-GCM / Fernet), never stored in plain text. |
Set it up
Create a key in AWS KMS
A symmetric key (key spec
SYMMETRIC_DEFAULT, usageENCRYPT_DECRYPT) in any region and account. Turn on automatic key rotation if you want it — that is transparent to Sovaria.Add Sovaria to the key policy
Open Organization settings › Security › Your own encryption key, click Show key policy statement, and add that statement to the key's policy. It names Sovaria's AWS role and only allows your organization's encryption context. Optionally also allow
kms:DescribeKey(without the condition) so Sovaria can show the key's state.Paste the key ARN
Paste
arn:aws:kms:<region>:<account>:key/<id>and confirm. Sovaria checks it end to end first — wraps and unwraps a data key, and writes and reads a file under it. Nothing changes if any check fails.Re-encrypt existing files
New files and backups use your key immediately. Click Re-encrypt files to rewrite files stored before; progress shows on the card.
{
"Sid": "SovariaOrg<your-org-id>",
"Effect": "Allow",
"Principal": { "AWS": "<Sovaria's role ARN, shown in the console>" },
"Action": ["kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey"],
"Resource": "*",
"Condition": { "StringEquals": { "kms:EncryptionContext:sovaria:org_id": "<your-org-id>" } }
}Only organization owners can set, rotate or re-encrypt; owners and admins can view the status and run a check. App users and API keys of your projects can't reach these endpoints.
Disabling or revoking the key
Disable the key, schedule its deletion, or remove the policy statement in AWS and Sovaria can no longer use it — within a few minutes, once its in-memory copy of the data key expires. From then on:
- Uploading, downloading and copying files in the organization's projects fail with
403 ENCRYPTION_KEY_UNAVAILABLE. - New backups can't be taken and existing ones can't be restored.
- Your databases, functions and auth keep running — they don't depend on the key.
- The console card shows Not usable with the reason from KMS (for example
KEY_DISABLEDorKEY_ACCESS_DENIED).
Re-enable the key or restore the statement and click Check now; everything works again. If the key is deleted in AWS, data under it is gone for good — Sovaria can't recover it.
Rotation and changing keys
- AWS automatic rotation needs nothing from you or Sovaria; KMS keeps old key material for decryption.
- Rotate data key makes a new organization data key version for new backups. Older versions stay, wrapped by your key, to decrypt older backups.
- Use a different key (a new ARN): new files and backups go under the new key. Keep the old key enabled until you have re-encrypted files and no longer need older backups — they still need it.
Signed upload URLs
For organizations with their own key, signed upload URLs point at api.sovaria.in/api/v1/store/signed/… instead of directly at S3, so every write is encrypted under your key. The URLs work the same way for your app; download URLs are unchanged.
Errors
| Code | Meaning |
|---|---|
PLAN_FEATURE_REQUIRED | Your plan doesn't include your own key (Enterprise only). |
KEY_REF_INVALID | Not a KMS key ARN. Use the key's full ARN, arn:aws:kms:<region>:<account>:key/<id> — an alias isn't accepted. |
KEY_ACCESS_DENIED | The key policy doesn't let Sovaria use the key with your encryption context — add the statement. |
KEY_DISABLED / KEY_NOT_FOUND | The key is disabled, pending deletion or doesn't exist. |
STORAGE_KEY_DENIED | KMS allowed Sovaria but S3 couldn't use the key — usually a key in a different region without a multi-region replica, or a policy that excludes S3. |
ENCRYPTION_KEY_UNAVAILABLE | A storage or backup call was refused because the key isn't usable right now. |
What Sovaria staff see
Staff see which organizations use their own key, the key ARN, its data key version and whether it was usable at the last check (Control Center › Compliance › Customer keys). They can ask KMS to check it again — audited with a reason — but can't change, rotate or remove your key, and never see key material.
Plans
| Free | Pro | Ultra | Team | Enterprise | |
|---|---|---|---|---|---|
| Bring your own key (your KMS key encrypts files and backups) | — | — | — | — | ✓ |
Coming from Firebase or Supabase?
| Platform | What this is called there |
|---|---|
| Firebase | Customer-managed encryption keys (CMEK) on Google Cloud |
| Sovaria | Your own encryption key (BYOK) |
Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.