Interview › Security & DevSecOps
What is the principle of least privilege, and how do you apply it in CI/CD? [Intermediate]
Answer
Least privilege means every user, workload, and pipeline gets only the permissions required for its job, for only the time needed. In CI/CD, that means scoped tokens, environment-specific roles, approval gates for production, and no broad admin credentials in build systems.
Technical explanation
Pipeline identities should be separated by repository, environment, and action such as build, deploy-dev, deploy-prod, or rollback.
Secrets should be scoped and short-lived, ideally issued through OIDC or workload identity.
Permissions should be reviewed through IAM analysis, audit logs, and automated policy checks.
Hands-on example
Example: a PR build role can read dependencies and push test artifacts but cannot deploy. A staging deploy role can update only the staging namespace. A production deploy role requires protected branch, signed artifact, approval, and a narrowly scoped cloud/IAM role.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Security & DevSecOps interview questions
- What is workload identity, and how does it remove static credentials? [Intermediate]
- What is OPA, and what is the Rego language used for? [Intermediate]
- How do you apply least privilege to service-to-service communication (e.g., with Istio mTLS)? [Intermediate]
- What is secrets management, and how does HashiCorp Vault work at a high level? [Intermediate]
- What is vulnerability management as a lifecycle (discover, prioritise, remediate, verify)? [Intermediate]
- How do you reduce the noise of thousands of vulnerability findings? [Intermediate]
- What is encryption at rest versus in transit, and how do you ensure both? [Advanced]
- What is the difference between symmetric and asymmetric encryption? [Advanced]