OPA and Rego Fundamentals | Builder Session
What if you could catch an insecure cloud configuration before Terraform deploys it? In this DevSec Blueprint Builder Session, Damien Burks introduces Open Policy Agent (OPA) and Rego by writing a policy that flags Amazon EC2 instances configured without requiring Instance Metadata Service Version 2 (IMDSv2). Follow the demo from a first Rego policy in the OPA Playground to a local check against two Terraform plans. Along the way, you’ll see how Damien troubleshoots an `undefined` result and verifies that the policy flags only the noncompliant configuration. You’ll learn how to: - Understand how OPA evaluates JSON input against policies written in Rego. - Set up OPA locally and use the VS Code extension to write and format Rego. - Export a Terraform plan as JSON and pass it to `opa eval`. - Write a Rego rule that flags EC2 instances that don’t require IMDSv2. - Troubleshoot an `undefined` result by checking the package and rule path. - Compare compliant and noncompliant plans to verify that the rule behaves as expected. The session closes with a discussion of how the same approach applies to Terraform plans for Azure and Google Cloud, and where OPA fits into other workflows such as Kubernetes admission control.
Topics Covered
Video Details
- Duration
- 48m
- Recorded
- 11/7/2026
- Published
- 11/7/2026
- Topics
- 12
Watch This Video
This video is available to Builder members. Sign up or upgrade your membership to watch the full video.