CI/CD Secrets Management: Best Practices

OIDC federation is the modern way CI/CD authenticates to clouds. Long-lived secrets are 2020s; OIDC is 2026.

Why OIDC over static

Static secrets are the 2020s pattern: long-lived keys shared via env vars, rotated rarely, leaked easily. OIDC is the 2026 pattern: short-lived tokens issued per CI run, cryptographically tied to the run, no static keys to leak in the first place.

Four patterns

Four OIDC patterns cover most CI/CD-to-cloud authentication needs. Each maps to a specific cloud or secret store; together they replace the static-key model entirely.

Migration from static

Phase 1: enable OIDC for one critical pipeline. Phase 2: migrate cloud-auth pipelines. Phase 3: remove static cloud keys.

Phase 4: extend to non-cloud secrets via Vault.

Audit trail

OIDC tokens are tied to specific repo/branch/workflow. Audit log shows which CI run authenticated when.

SOC 2 evidence: cryptographic chain from auth event to action.

Antipatterns

What to do this week

Three moves. (1) Apply this to one pipeline first. (2) Measure deploy frequency / MTTR before/after. (3) Document the outcome so the next team starts from data.