Skip to content

Secrets, access, least privilege

Editor
Engineering leadership

Everyone who holds credentials or grants access.

When you store, share, or rotate a secret, or grant access.

  • Must: Secrets live in a secrets manager or the CI secret store, injected at run or deploy time. Not in git, images, tickets, or chat.
  • Must: If a secret was pasted into chat, a ticket, or a PR, rotate it. Treat it as public.
  • Must: Access is least privilege and named. Do not share a personal prod login. Infrastructure grants follow Infrastructure and access.
  • Should: Rotate credentials when someone leaves the project, and when you cannot say who still has a copy.
  • Should: Use short-lived roles or SSO where the host allows it, instead of long-lived keys on laptops.
  • Team decides: Which manager (cloud, CI, or password vault) holds which class of secret. AWS detail is on AWS.

A new engineer gets a role, not a screenshot of keys, and a leaked paste gets rotated the same day.

  1. Put new secrets in the agreed store. Reference them by name in config.
  2. Never commit .env files that contain real values. Commit an example with placeholders.
  3. If you find a secret in git, rotate, purge if you can, and follow report.
  4. Grant the smallest access that unblocks the work. Remove it when the work ends.