CTL-039 · human

Environment Secrets With Approvals

Put production secrets in protected environments that need a reviewer and only run from protected branches.

TechnicalEffort LowEffectiveness High

Most CI platforms can bind secrets to an environment that has required reviewers and branch rules. Doing this for production keys means a branch build, a fork PR or an agent's push never sees them.

Reviewers should check the workflow run itself, not just approve the deployment. Keep the reviewer list small and separate from the people who write the pipeline. Agents and bots should never be reviewers for production environments.

Put it in place

  1. 01Move production secrets from repo or org scope into a `production` environment.
  2. 02Require at least one reviewer who is not the author, and restrict to protected branches or tags.
  3. 03Separate secrets for build, test and deploy so test jobs never get deploy keys.
  4. 04Review which workflows reference each environment.

Counters 2 techniques