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.

Preparing for an interview?

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

← All Security & DevSecOps questions