We're moving secrets out of our codebase and into Azure Key Vault. I'm new to Azure and AKS. What should I plan for during the migration?
What should I know before moving application secrets to Azure Key Vault?
Answers
Start with an inventory, including the repository history. Removing a secret from the current code doesn't remove it from old commits. Scan the full history, then rotate the exposed credentials as you migrate them.
Add a secret scan to your development or CI workflow too, so the same problem doesn't creep back in. For each secret you keep, identify who owns it and how rotation will be tested.
Reply to this answer
Don't assume everything needs to become a Key Vault secret. Managed identities can replace some application credentials, and federated credentials may remove the need for long-lived CI deployment secrets. That leaves fewer things to store and rotate.
For access that still needs a credential, give each application identity only the permissions it needs. Prefer a managed identity for reading from the vault where possible.
Reply to this answer
For AKS, plan both identity and networking before changing the app. Decide how the workload will authenticate to Azure and how it will get the secrets into the application. Then test that path from the cluster, not just from a developer machine.
A private endpoint is worth considering if your network supports it. Check connectivity and DNS before disabling public access to the vault, or you could lock the application out.
Reply to this answer
Set up recovery protection when you create the vault. Enable purge protection and choose the soft-delete retention period deliberately, since that period can't be changed after creation. Check the current Azure settings and defaults rather than assuming they're right for your recovery requirements.
Reply to this answer
Think about what happens at runtime. Reading from the vault adds a network dependency and latency, so caching may help. Just make sure the cache refresh strategy works with your rotation process, rather than leaving an old secret in use indefinitely.
Reply to this answer
Add your answer
Answers are reviewed before publication.
4b!ferrulecaddy_615:
Developer access needs a plan too. Local development identities may need limited read access without giving everyone the production application's permissions.