policy-opa

Evaluate and enforce Rego policies for Kubernetes, CI/CD, and IaC configurations.

183|35|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/AgentSecOps/SecOpsAgentKit --skill policy-opa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: policy-opa
Source: https://github.com/AgentSecOps/SecOpsAgentKit/tree/main/skills/compliance/policy-opa
Command: npx skills add https://github.com/AgentSecOps/SecOpsAgentKit --skill policy-opa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opa, docker, kubectl, jq, yq, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Policies and compliance controls are hard to codify and enforce across cloud-native environments without a central policy framework.

Core Features & Use Cases

  • Policy authoring in Rego for Kubernetes, CI/CD, and IaC configurations.
  • Policy evaluation, unit testing, and automated drift detection.
  • CI/CD integration and cross-framework policy mapping (SOC2, PCI-DSS, GDPR, HIPAA) for automated compliance checks.
  • Use cases include enforcing Kubernetes RBAC, validating Terraform policies, and auditing configurations before deployment.

Quick Start

Install OPA and run policy evaluation against a sample config to validate policy behavior.

Frequently Asked Questions about policy-opa

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce policy-as-code in Kubernetes admission controls using OPA?

Open Policy Agent enforces policy-as-code by evaluating Rego rules against Kubernetes admission controls, validating configurations before deployment to prevent non-compliant cluster changes. It integrates directly into admission webhooks to block or flag policy violations.

Can I map Rego policies to compliance frameworks like SOC2, PCI-DSS, GDPR, and HIPAA?

Yes, OPA supports cross-framework policy mapping for SOC2, PCI-DSS, GDPR, and HIPAA. You can author Rego rules that evaluate cloud-native configurations against specific compliance controls, generating automated audit evidence for each framework.

How do I unit test Rego policies in a CI/CD pipeline?

You can unit test Rego policies by defining test cases alongside your rules and running the OPA evaluation command in your CI/CD pipeline. This validates policy behavior against sample configurations and catches drift before deployment.

Do I need Docker and kubectl to validate Terraform policies with OPA?

Docker and kubectl are required for evaluating live Kubernetes configurations and running containerized OPA environments. For validating Terraform infrastructure-as-code, you primarily need OPA, jq, and yq to parse and evaluate the plan outputs.

What's the best way to audit Kubernetes RBAC configurations for compliance?

The best way to audit Kubernetes RBAC is using OPA to evaluate role definitions against Rego policies that codify your access control requirements. This allows automated drift detection and continuous compliance auditing across cluster configurations.

Why does my OPA policy evaluation fail against real cloud-native configurations?

OPA policy evaluation often fails when Rego rules reference incorrect data structures or when input configurations lack expected fields. Use unit tests to validate policy logic against sample configs, and ensure jq and yq correctly parse input formats.