Core Exercises (Required)
- Create and Encrypt: Use
scripts/sops-encrypt-secret.shto create a secret namedlab-secretin thedevelopnamespace. Verify that the file in Git is encrypted. - Flux Verification: Commit the new secret and verify that Flux successfully reconciles it. Check its presence using
kubectl -n develop get secret lab-secret. - Trigger a Failure: Intentionally use an incorrect public key in
.sops.yamland try to encrypt a file. Observe the error message. - Secret Exposure Drill: Simulate a secret leak by committing a plaintext dummy file (use a fake key). Follow the first 3 steps of the Leak Response Mini-Runbook.
Challenge Exercise (Optional)
Full Secret Leak Response: Simulate a full secret leak response: rotate the compromised secret, verify Flux picks up the new encrypted value, confirm the application restarts with the new secret, and document the complete response timeline.
Verification Checklist
-
backend-secrets.yamlin Git is encrypted (ENC[...]values). -
secrets-developKustomization isReadyin Flux. -
backend-secretsexists in the cluster namespace. - No plaintext values appear in the Git commit history.
- Local pre-commit
no-secretscheck passes.
Done When
You have completed this chapter when:
- You can explain why a
git revertis insufficient after a secret leak. - You have successfully demonstrated the
encrypt -> commit -> Flux decryptworkflow. - You can identify common decryption failures (missing keys, incorrect config).
Knowledge Check
Before finishing this chapter, complete the Quiz to verify your understanding of the guardrail principles.