SOPS secrets files
For secrets that cannot be derived (external credentials, federation keys, LDAP bind passwords, ...), MijnBureau supports SOPS-encrypted secrets files via helm-secrets.
Note: loading of secrets files is disabled by default. The
secrets:entries inhelmfile/bases/environment.yaml.gotmplare commented out; uncomment the block for the environments that use a secrets file:demo:values:- "helmfile/environments/default/*.yaml*"- "helmfile/environments/demo/*.yaml.gotmpl"secrets:- "helmfile/environments/{{ .Environment.Name }}/*.secrets.yaml"Secrets files must be named
*.secrets.yamlin the environment directory; the defaultvalues:glob (*.yaml.gotmpl) does not pick them up.
Steps to use SOPS
-
Install the tools: SOPS, AGE, and the helm-secrets plugin. Running
helmfile initinstalls the plugin. -
Generate an AGE key pair:
age-keygen -o mykey.txt -
Update
.sops.yaml: replace theage:entry in the repository root.sops.yamlwith your public key. The path rule.*secrets.yaml$is already in place. -
Create and encrypt the secrets file:
# create helmfile/environments/<environment>/<name>.secrets.yaml with your values, then:export SOPS_AGE_KEY_FILE=./mykey.txthelm secrets encrypt -i helmfile/environments/<environment>/<name>.secrets.yamlEncrypted secrets files can be committed to git; SOPS only leaves the public values readable.
-
Deploy (helm-secrets decrypts in memory via helmfile):
export MIJNBUREAU_MASTER_PASSWORD=changethisexport SOPS_AGE_KEY_FILE=./mykey.txthelmfile -e <environment> templatehelmfile -e <environment> apply
Scripts integration
./scripts/test.shaccepts-s "$SOPS_AGE_KEY"for decryption in CI/test settings.- When available,
./scripts/policy.shreads the master password from/run/secrets/mijnbureau-master-password.
Relationship to the other options
SOPS files are overrides on top of the derived secrets: use them for the handful of values that cannot be derived. To move all secrets to a central secret manager instead, see External Secrets Operator.