Interview › Security & DevSecOps
What is policy-as-code, and what tools implement it (OPA, Sentinel, Kyverno)? [Intermediate]
Answer
Policy-as-code means security, compliance, and operational rules are written as versioned, testable code and enforced automatically. Tools include OPA/Rego, HashiCorp Sentinel, Kyverno, Conftest, Checkov, tfsec, and cloud-native policy engines.
Technical explanation
Policy-as-code gives repeatable enforcement across CI, IaC review, admission control, and audits.
Policies should be version-controlled, peer-reviewed, tested, and released like application code.
Good policies include clear failure messages and remediation guidance to reduce developer friction.
Hands-on example
Example policy lifecycle: write a rule that denies public S3 buckets, add unit tests for allowed/denied Terraform examples, run it in PR with conftest or Checkov, enforce it in Terraform Cloud/Sentinel, and verify deployed cloud resources with CSPM.
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 encryption at rest versus in transit, and how do you ensure both? [Advanced]
- What is the difference between symmetric and asymmetric encryption? [Advanced]
- What is certificate management, and how do tools like cert-manager help? [Advanced]
- What is vulnerability management as a lifecycle (discover, prioritise, remediate, verify)? [Intermediate]