SOPS (Secrets OPerationS) encryption allows you to securely store sensitive values like passwords, API keys, and credentials in your GitOps repository. Encrypted values are automatically decrypted during deployment.
What is SOPS?
SOPS is an editor for encrypted files that supports YAML, JSON, ENV, INI and BINARY formats. Ankra uses SOPS with AGE encryption to protect sensitive values in your Stack configurations.How It Works
- In the Stack Builder: You enter secrets in plaintext
- On Save: Ankra encrypts marked fields with your organisation’s AGE public key
- In Git: Encrypted values appear as
ENC[AES256_GCM,...]- safe to commit - On Deploy: ArgoCD’s helm-secrets plugin decrypts values using the private key
Setting Up SOPS
SOPS encryption works at two levels: organisation (key management) and cluster (decryption capability).Step 1: Initialize Organisation Encryption
1
Navigate to Encryption Settings
Go to Organisation Settings → Encryption.
2
Initialize Encryption
Click Initialize Encryption. This generates an AGE key pair:
- Public key: Used to encrypt values (visible to you)
- Private key: Used to decrypt values (stored securely in Ankra’s vault)
3
Copy the Public Key
The AGE public key is displayed. You can copy it for use with external SOPS tools if needed.
age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
Step 2: Enable Cluster Decryption
For each cluster that needs to decrypt SOPS-encrypted values:1
Navigate to Cluster Encryption Settings
Go to your cluster → Settings → Encryption.
2
Enable SOPS Decryption
Toggle on Enable SOPS Decryption.
3
Wait for Deployment
Ankra deploys the decryption key to your cluster and configures ArgoCD with helm-secrets.
Encrypting Values in Stacks
Using the Stack Builder
When editing a manifest or add-on values in the Stack Builder:- Look for the Encrypted Keys (SOPS) section
- Add key names that should be encrypted (e.g.,
password,apiKey,token) - Enter the plaintext value as normal
- On save, Ankra encrypts those specific keys
Common Keys to Encrypt
| Key Name | Use Case |
|---|---|
password | Database passwords, admin credentials |
apiKey | Third-party API keys |
token | Authentication tokens, tunnel tokens |
secretKey | Encryption keys, signing keys |
connectionString | Database connection strings with credentials |
privateKey | SSH keys, TLS private keys |
Example: Encrypting a Database Password
Before encryption (what you see in the editor):Encrypting Helm Values
For add-ons (Helm charts), you can encrypt specific values:- Open the add-on in the Stack Builder
- In the values editor, find the Encrypted Keys (SOPS) section
- Add paths to sensitive values
Helm Values Path Examples
| Path | Description |
|---|---|
adminPassword | Top-level key |
auth.password | Nested key (uses dot notation) |
credentials.apiKey | Deeply nested key |
adminPassword to the encrypted keys list.
Key Rotation
Periodically rotating encryption keys is a security best practice.Initiating Key Rotation
1
Go to Encryption Settings
Navigate to Organisation Settings → Encryption.
2
Click Rotate Keys
This generates a new AGE key pair while preserving the old one temporarily.
3
Re-encrypt Existing Content
Before confirming, you must re-encrypt all existing SOPS-encrypted content in your Git repositories with the new public key.
4
Confirm Rotation
Once all content is re-encrypted, click Confirm Rotation to finalize. The old private key is then securely deleted.
Cancelling Key Rotation
If you need to abort a rotation in progress, click Cancel Rotation. The new key pair is discarded and the existing key remains active.How Decryption Works
When SOPS is enabled on a cluster, Ankra:- Deploys the AGE private key as a Kubernetes Secret in the ArgoCD namespace
- Configures helm-secrets plugin on the ArgoCD repo-server
- Sets up automatic decryption during Helm template rendering
What Gets Deployed
| Component | Namespace | Purpose |
|---|---|---|
ankra-sops-age-key Secret | argocd | Stores the AGE private key |
| helm-secrets plugin | ArgoCD repo-server | Enables SOPS decryption in Helm |
| SOPS binary | ArgoCD repo-server | Performs the actual decryption |
ArgoCD Integration
The helm-secrets plugin is automatically configured with:HELM_SECRETS_BACKEND=sops- Use SOPS for decryptionSOPS_AGE_KEY_FILE=/ankra-sops-age-key/age.agekey- Path to the private key- Support for
secrets://value file scheme
Best Practices
Troubleshooting
Deployment Fails with Decryption Error
Deployment Fails with Decryption Error
- Verify SOPS is enabled on the cluster (Settings → Encryption)
- Check that ArgoCD repo-server has restarted after enabling SOPS
- Ensure the content was encrypted with the current organisation key (not a rotated key)
SOPS Toggle is Disabled
SOPS Toggle is Disabled
The cluster doesn’t have ArgoCD installed. Install ArgoCD first, then enable SOPS:
- Create a Stack with the ArgoCD add-on
- Deploy and wait for ArgoCD to become ready
- Return to Settings → Encryption and enable SOPS
Values Not Being Encrypted
Values Not Being Encrypted
- Check that the key name matches exactly (case-sensitive)
- Verify SOPS is initialized at the organisation level
- Ensure the key is added to the Encrypted Keys list before saving
Key Rotation Stuck
Key Rotation Stuck
If you initiated key rotation but can’t complete it:
- Cancel the rotation if you haven’t re-encrypted content yet
- If content is already re-encrypted, verify by checking the
sops.age.recipientfield matches the new public key - Click Confirm Rotation to finalize
AI Prompts
Press⌘+J to open the AI Assistant and use these prompts:
Set Up SOPS for a Stack
Set Up SOPS for a Stack
Enable SOPS on a Cluster
Enable SOPS on a Cluster
Troubleshoot Decryption Failure
Troubleshoot Decryption Failure