一键导入
kyverno-to-gatekeeper-translator
Translates Kyverno policies to OPA Gatekeeper ConstraintTemplates and Constraints with RHACM PolicyGenerator output.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Translates Kyverno policies to OPA Gatekeeper ConstraintTemplates and Constraints with RHACM PolicyGenerator output.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Deploys OPA Gatekeeper policies for BSI IT-Grundschutz compliance (SYS.1.6 Containerisation, APP.4.4 Kubernetes) following ch-stark patterns with BSI requirement labels.
Interactive Rego policy generator assistant. Analyzes requirements, recommends admission controllers (Gatekeeper/Kyverno/VAP), generates Rego code, validates with OPA, and creates RHACM-ready constraint files.
Deploys OPA Gatekeeper policies for NIST SP 800-53 compliance following ch-stark/gatekeeper-examples patterns. Adds NIST control labels and annotations to all constraints for compliance tracking.
Automates OPA Gatekeeper integration with RHACM following ch-stark/gatekeeper-examples. Reads cluster version via MCP, compares gatekeeper-library policies against OpenShift SCCs, and generates optimized PolicyGenerator with SCC-filtered library inclusion.
基于 SOC 职业分类
| name | kyverno-to-gatekeeper-translator |
| description | Translates Kyverno policies to OPA Gatekeeper ConstraintTemplates and Constraints with RHACM PolicyGenerator output. |
| allowed-tools | ["Read","Write","Bash","AskUserQuestion","WebFetch"] |
INPUT → Parse → Feasibility Check → Generate Rego → Validate → Output Files
Accept via: paste YAML, file path, or URL (use WebFetch).
| Kyverno Type | Gatekeeper Support | Action |
|---|---|---|
validate.pattern | Full | Translate |
validate.deny | Full | Translate |
validate.foreach | Full | Translate |
validate.anyPattern | Full | Translate |
validate.cel | Partial | Recommend VAP |
mutate.* | Alpha | Keep Kyverno |
generate | None | Cannot translate |
verifyImages | None | Use Sigstore |
If unsupported features exist, inform user and ask to proceed with supported parts.
See: references/KYVERNO_TO_GATEKEEPER_MAPPING.md for translation patterns.
mkdir -p /tmp/claude
# Write policy.rego and input.json
opa eval -d /tmp/claude/policy.rego -i /tmp/claude/input.json "data.{package}.violation" --format pretty
Fix errors and re-validate until passing. Show user the translated Rego.
TRACE_ID=$(python3 skills/kyverno-to-gatekeeper-translator/scripts/get_trace_id.py 2>/dev/null || echo "no-trace")
OUTPUT_DIR="skills/kyverno-to-gatekeeper-translator/assets/${TRACE_ID}"
mkdir -p ${OUTPUT_DIR}/{constraint-templates,constraints,original-kyverno}
Generate files using templates from references/TEMPLATES.md:
original-kyverno/{name}.yamlconstraint-templates/{name}-template.yamlconstraints/{name}.yamlpolicyGenerator.yamlkustomization.yamlTRANSLATION_REPORT.mdOutput: skills/kyverno-to-gatekeeper-translator/assets/{TRACE_ID}/
Deploy directly:
kubectl apply -f constraint-templates/ && kubectl apply -f constraints/
Deploy via RHACM:
kustomize build --enable-alpha-plugins . | kubectl apply -n policies -f -
| Kyverno | Gatekeeper |
|---|---|
validationFailureAction: Audit | enforcementAction: dryrun |
validationFailureAction: Enforce | enforcementAction: deny |
{{request.object.*}} | input.review.object.* |
exclude.namespaces | spec.match.excludedNamespaces |
references/KYVERNO_TO_GATEKEEPER_MAPPING.md - Translation patterns & operatorsreferences/TEMPLATES.md - Output file templatesreferences/COMMON_POLICY_TRANSLATIONS.md - Complete examples