The build was failing. Not from bad code. From bad access.
Least privilege in a secure CI/CD pipeline is not optional. It is the baseline. Without it, one compromised credential can unlock every environment, every deploy, every secret. The result is total breach.
A least privilege model means every identity—human or machine—gets only the permissions required to complete its task. Nothing more. In CI/CD, this principle must follow through from source control to production workloads. Each pipeline stage needs isolated access. Code checkout should not have deploy credentials. Test runners should not have production secrets. Deployment jobs should trigger with temporary, scoped tokens that expire fast.
Secure CI/CD pipeline access starts with strict role segmentation. First, define clear boundaries for build, test, and deploy stages. Second, enforce short-lived credentials through automated rotation. Third, integrate continuous monitoring with instant alerting on permission changes or credential use outside defined workflows.