Data & Integrity

Secrets Management

Intermediate

This is the day-to-day side of handling secrets: how the application gets the credentials it needs at runtime, how they rotate, and how the team shares access. It is the practical workflow behind the strict rules in Secrets at Rest & in Transit. The vault is the single source of truth, and everything else points to it.

Good secrets management makes the secure way the only easy way. The application reads secrets from a managed vault at runtime using its own identity. Developers never hold production secrets. Rotation is routine and automated. Access is granted, scoped, and revoked through the vault, not passed around. With that workflow in place, secrets have nowhere to leak from.

The Finperiti sample kept secrets in raw configuration, with no Key Vault. The workflow itself was the vulnerability. Fixing it is less about any one secret and more about adopting the pattern: vault-held secrets, identity-based access, and managed rotation. Then no human and no repo ever needs to hold a production credential.

Source secrets from a vault

Secret in shipped config // appsettings.Production.json, in the repo
"Stripe": { "ApiKey": "sk_live_51H..." }

A live payment key in source control: readable by everyone with repo access, impossible to rotate without a redeploy, and one leak away from disaster.

Vault reference plus managed identity // config holds a reference, resolved at runtime via the app's managed identity
"Stripe": { "ApiKey": "@Microsoft.KeyVault(SecretUri=https://kv.../stripe-key)" }

No secret in the repo. Rotation happens in the vault with no redeploy, and every read is authenticated and audited.

Rotate, audit, and respond

Self-review checklist

Why it matters: Secrets are the keys to everything else. One leaked credential can expose the database, the payment gateway, or customer data. A vault-centred workflow with identity-based access and automated rotation removes the places secrets leak from, so a mistake elsewhere does not hand an attacker the keys.