NEW350+ rooms now have a live terminal, so you can learn by typing the commands, right in your browser.Learn in a live terminal. 350+ rooms.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
[>_] ROOM · Cybersecurity
Policy as Code with OPA
Master Policy as Code using Open Policy Agent (OPA) and Rego to enforce custom, organization-specific security rules across your infrastructure.
Room tasks
1What Is Policy as Code and Why Does It Matter
2Rego Language Basics
3Evaluating Terraform Plans with Conftest
4Enforcing Kubernetes Admission Policies with OPA Gatekeeper
5Guided Lab: Blocking a Non-Compliant Terraform Plan in CI
Frequently Asked Questions
What is policy as code?
Policy as code defines rules in a machine-readable language so they can be versioned, tested and enforced automatically. It replaces manual reviews with consistent checks across infrastructure, pipelines and applications.
What is Open Policy Agent used for?
Open Policy Agent is a general-purpose policy engine. Teams use it to make allow or deny decisions for Kubernetes admission, Terraform plans, API authorization and CI/CD gates, using policies written in Rego.
Is there a free way to practice Rego?
Yes. The Policy as Code with OPA room on Codelivly is free and hands-on, taking you through writing Rego rules, testing them and applying custom organizational policies to real configurations.