DevOps Engineer interview question · Most asked
How do you secure the CI/CD pipeline itself against supply-chain attacks?
Summary
Treat the pipeline as production infrastructure: pin third-party actions and plugins to commit SHAs, minimise and scope permissions (read-only tokens by default), isolate untrusted code (forked pull requests) from secrets, use ephemeral, hardened runners, protect branches and require reviews for pipeline changes, verify dependencies, and produce signed artifacts with provenance.
Longer Answer
Real incidents (compromised GitHub Actions, malicious npm packages, the SolarWinds and Codecov breaches) show the pipeline is a high-value target because it holds credentials and produces what runs in production. Frameworks such as SLSA define increasing levels of build integrity: scripted builds, provenance, hardened isolated builders, and two-person review. Self-hosted runners on persistent machines are risky for public repositories because a malicious job can persist on the host.
Key Points
- Pin actions by SHA; least-privilege tokens.
- Isolate untrusted PRs from secrets.
- Ephemeral hardened runners.
- Signed artifacts with provenance (SLSA).
More most-asked DevOps Engineer questions
- What happens when you type a URL into a browser and press Enter?
- Pods keep restarting with OOMKilled under load. How do you investigate and fix it?
- Design a CI/CD pipeline for a containerised microservice from commit to production.
- How do you handle secrets in CI/CD pipelines securely?
- A rollback after a release made the outage worse because the database had already been migrated. How do you design releases so rollbacks are always safe?
- What are DORA metrics, and how would you use them without gaming them?
- How do you handle database schema migrations in an automated deployment pipeline?
- Every deployment produces a burst of 502s. What do you check?