api-mitmproxy
Interactive HTTPS proxy for API security testing with traffic interception, modification, and replay capabilities. Supports…
Policy-as-code enforcement and compliance validation using Open Policy Agent (OPA). Use when: (1) Enforcing security and compliance policies across infrastructure and applications, (2) Validating Kubernetes admission control policies, (3) Implementing policy-as-code for
Claude Code
$ npx -y skills add AgentSecOps/SecOpsAgentKit --skill policy-opa --agent claude-code
Codex
$ npx skills add AgentSecOps/SecOpsAgentKit --skill policy-opa -a codex -y
Cursor
$ npx skills add AgentSecOps/SecOpsAgentKit --skill policy-opa -a cursor -y
Gemini CLI
$ npx skills add AgentSecOps/SecOpsAgentKit --skill policy-opa -a gemini-cli -y
GitHub Copilot
$ npx skills add AgentSecOps/SecOpsAgentKit --skill policy-opa -a github-copilot -y
OpenCode
$ npx skills add AgentSecOps/SecOpsAgentKit --skill policy-opa -a opencode -y
Windsurf
$ npx skills add AgentSecOps/SecOpsAgentKit --skill policy-opa -a windsurf -y
name: policy-opa description: > Policy-as-code enforcement and compliance validation using Open Policy Agent (OPA). Use when: (1) Enforcing security and compliance policies across infrastructure and applications, (2) Validating Kubernetes admission control policies, (3) Implementing policy-as-code for compliance frameworks (SOC2, PCI-DSS, GDPR, HIPAA), (4) Testing and evaluating OPA Rego policies, (5) Integrating policy checks into CI/CD pipelines, (6) Auditing configuration drift against organizational security standards, (7) Implementing least-privilege access controls. version: 0.1.0 maintainer: SirAppSec category: compliance tags: [opa, policy-as-code, compliance, rego, kubernetes, admission-control, soc2, gdpr, pci-dss, hipaa] frameworks: [SOC2, PCI-DSS, GDPR, HIPAA, NIST, ISO27001] dependencies: tools: [opa, docker, kubectl] packages: [jq, yq] references: - https://www.openpolicyagent.org/docs/latest/ - https://www.openpolicyagent.org/docs/latest/policy-language/ - https://www.conftest.dev/
This skill enables policy-as-code enforcement using Open Policy Agent (OPA) for compliance validation, security policy enforcement, and configuration auditing. OPA provides a unified framework for policy evaluation across cloud-native environments, Kubernetes, CI/CD pipelines, and infrastructure-as-code.
Use OPA to codify security requirements, compliance controls, and organizational standards as executable policies written in Rego. Automatically validate configurations, prevent misconfigurations, and maintain continuous compliance.
# macOS brew install opa # Linux curl -L -o opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64 chmod +x opa # Verify installation opa version
# Evaluate a policy against input data opa eval --data policy.rego --input input.json 'data.example.allow' # Test policies with unit tests opa test policy.rego policy_test.rego --verbose # Run OPA server for live policy evaluation opa run --server --addr localhost:8181
Identify compliance requirements and security controls to enforce:
Create policy files in Rego language. Use the provided templates in `assets/` for common patterns:
**Example: Kubernetes Pod Security Policy**
package kubernetes.admission
import future.keywords.contains
import future.keywords.if
deny[msg] {
input.request.kind.kind == "Pod"
container := input.request.object.spec.containers[_]
container.securityContext.privileged == true
msg := sprintf("Privileged containers are not allowed: %v", [container.name])
}
deny[msg] {
input.request.kind.kind == "Pod"
container := input.request.object.spec.containers[_]
not container.securityContext.runAsNonRoot
msg := sprintf("Container must run as non-root: %v", [container.name])
}**Example: Compliance Control Validation (SOC2)**
package compliance.soc2
import future.keywords.if
# CC6.1: Logical and physical access controls
deny[msg] {
input.kind == "Deployment"
not input.spec.template.metadata.labels["data-classification"]
msg := "SOC2 CC6.1: All deployments must have data-classification label"
}
# CC6.6: Encryption in transit
deny[msg] {
input.kind == "Service"
input.spec.type == "LoadBalancer"
not input.metadata.annotations["service.beta.kubernetes.io/aws-load-balancer-ssl-cert"]
msg := "SOC2 CC6.6: LoadBalancer services must use SSL/TLS encryption"
}Write comprehensive tests for policy validation:
package kubernetes.admission_test
import data.kubernetes.admission
test_deny_privileged_container {
input := {
"request": {
"kind": {"kind": "Pod"},
"object": {
"spec": {
"containers": [{
"name": "nginx",
"securityContext": {"privileged": true}
}]
}
}
}
}
count(admission.deny) > 0
}
test_allow_unprivileged_container {
input := {
"request": {
"kind": {"kind": "Pod"},
"object": {
"spec": {
"containers": [{
"name": "nginx",
"securityContext": {"privileged": false, "runAsNonRoot": true}
}]
}
}
}
}
count(admission.deny) == 0
}Run tests:
opa test . --verbose
Use the bundled evaluation script for policy validation:
# Evaluate single file ./scripts/evaluate_policy.py --policy policies/ --input config.yaml # Evaluate directory of configurations ./scripts/evaluate_policy.py --policy policies/ --input configs/ --recursive # Output results in JSON format for CI/CD integration ./scripts/evaluate_policy.py --policy policies/ --input config.yaml --format json
Or use OPA directly:
# Evaluate with formatted output opa eval --data policies/ --input config.yaml --format pretty 'data.compliance.violations' # Bundle evaluation for complex policies opa eval --bundle policies.tar.gz --input config.yaml 'data'
Add policy validation to your CI/CD workflow:
**GitHub Actions Example:**
- name: Validate Policies
uses: open-policy-agent/setup-opa@v2
with:
version: latest
- name: Run Policy Tests
run: opa test poAn assortment of security operations skills for AI coding agents. A collaborative approach to shift-left security using Claude Code skills.
Interactive HTTPS proxy for API security testing with traffic interception, modification, and replay capabilities. Supports…
API specification linting and security validation using Stoplight's Spectral with support for OpenAPI, AsyncAPI, and Arazzo…
Fast web fuzzer for DAST testing with directory enumeration, parameter fuzzing, and virtual host discovery. Written in Go for…
Fast, template-based vulnerability scanning using ProjectDiscovery's Nuclei with extensive community templates covering CVEs,…
Dynamic application security testing (DAST) using OWASP ZAP (Zed Attack Proxy) with passive and active scanning, API testing, and…
Python security vulnerability detection using Bandit SAST with CWE and OWASP mapping. Use when: (1) Scanning Python code for…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…