What practices keep API tokens (PATs) used by CI under control?
IntermediateProductionSecrets and Credentials
Answer
Avoid personal access tokens: use GitHub Apps or fine-grained tokens, GitLab project/group access tokens or deploy tokens with minimal scopes, and machine identities rather than a person's account (people leave). Set short expirations, store in the secret manager, inventory tokens, alert on expiring and unused tokens, and remove tokens when a repo is archived.
More on Secrets and Credentials
Why are long-lived credentials in CI a problem, and what is the modern alternative?BeginnerHow do you manage application secrets from build to runtime?IntermediateHow do you store secrets in Git safely for GitOps?IntermediateHow do you detect secrets committed to a repo?BeginnerWhat do you do after a secret is committed to Git?IntermediateHow do you use HashiCorp Vault with CI/CD?Advanced