iac.htora.dev · security templates

Home/Refreshers/Somewhere to keep secrets that rotates them: refresher

Somewhere to keep secrets that rotates them

A managed store with scheduled rotation, a record of every read, and a way to take access away.

Remember

  1. An application needs a secret: read when it connects, never baked in.
  2. It asks the secrets store: using its own identity.
  3. The read is recorded: who, which secret, when.
  4. A new value arrives on schedule: generated on AWS, a reminder on Google Cloud.
PlatformUsesThe part that catches people
AWSSecrets Manager with a rotation functionThe value never passes through Terraform, so it never lands in state.
AzureKey Vault with role-based accessPurge protection cannot be switched off, and a deleted vault's name stays taken until its retention ends.
Google CloudSecret Manager with versions and conditional accessTerraform creates the secret, never its value.
Oracle CloudOCI Vault with policies scoped to one vaultOCI answers a caller without permission with 404, the same as for a name that does not exist.

Run the quick start

Download providersterraform init
Previewterraform plan
Applyterraform apply

Watch out

  • A secret that never changes is a secret that stays leaked.
  • Taking access away is part of the design.
Check it worked

Rotate the secret, or add a new version. The application uses the new value on its next read, with no redeploy.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.