Interview › Security & DevSecOps
How would you design a secure-by-default CI/CD pipeline from scratch? [Advanced]
Answer
A secure-by-default CI/CD pipeline should start with protected source control, strong identity, fast security feedback, trusted builds, signed artifacts, policy-gated deployments, least-privilege credentials, and continuous evidence. Security should be automated into each stage rather than added as a manual release checklist.
Technical explanation
Source: branch protection, reviews, CODEOWNERS, secret scanning, signed commits if required, and dependency review.
Build: ephemeral runners, SAST, SCA, tests, image scan, SBOM, provenance, and artifact signing.
Deploy: OIDC credentials, environment approvals, IaC policies, admission control, signature verification, progressive rollout, observability, and audit logging.
Hands-on example
Design: PR checks run tests/SAST/SCA/secrets. Main build creates image by digest, generates SBOM and provenance, signs with cosign. Promotion requires quality gate and approval. Kubernetes admission verifies registry, signature, provenance, nonroot securityContext, and allowed namespace policies before rollout.
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
- How do you prove to an auditor that security controls are enforced continuously, not just documented? [Advanced]
- What is the difference between a WAF, an IDS, and an IPS? [Advanced]
- Why do you hash and salt passwords rather than encrypt them? [Advanced]
- What is the difference between encoding, encryption, and hashing? [Advanced]
- How do you prevent privilege escalation in a Kubernetes cluster? [Advanced]
- What are Kubernetes Pod Security Standards (privileged, baseline, restricted)? [Advanced]
- What are Linux capabilities, and why drop them in containers? [Advanced]
- What is the difference between authentication and authorization? [Advanced]