一键导入
opa-rbac-templates
OPA RBAC policies preventing cluster-admin privilege escalation, restricting privileged verbs, and blocking wildcard permissions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
OPA RBAC policies preventing cluster-admin privilege escalation, restricting privileged verbs, and blocking wildcard permissions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Production-grade Go CLI patterns, automated release workflows with Release Please, versioned docs, and coverage enforcement for DevSecOps build pipelines.
Design CLI commands that work independently and compose well for automation. Orchestrator pattern coordinates, subcommands execute discrete tasks.
Implement idiomatic Kubernetes operations with label selectors, strategic merge patches, and proper error handling for production-grade CLI tooling.
Choose the right Go CLI framework for Kubernetes-native tools. Decision matrix compares Cobra, urfave/cli, and Kong for ecosystem alignment and features.
Build Kubernetes-native CLIs in Go with type safety, testability, and complex orchestration logic for deployment tools and cluster automation.
Integrate Go CLIs with Kubernetes using client-go. Automatic config detection works on laptops, CI runners, and cluster pods with minimal RBAC setup.
| name | opa-rbac-templates |
| description | OPA RBAC policies preventing cluster-admin privilege escalation, restricting privileged verbs, and blocking wildcard permissions. |
RBAC policies control who can perform which actions on which resources. These templates prevent privilege escalation through overly permissive roles.
Wildcards Grant Unrestricted Access
RBAC rules with
resources: ["*"]orverbs: ["*"]grant access to all current and future resources or actions. Avoid wildcards except for break-glass admin roles.
Block cluster-admin except for approved break-glass accounts:
# Enforced by: cluster-admin.yaml
# Result: Only subjects in approved list can receive cluster-admin binding
# Impact: Prevents privilege escalation to cluster-admin
Prevent use of escalate, bind, impersonate:
# Enforced by: privileged-verbs.yaml
# Result: Roles cannot include escalate/bind/impersonate verbs
# Impact: Prevents users from granting themselves additional permissions
Require explicit resource and verb lists:
# Enforced by: wildcards.yaml
# Result: Roles must specify resources: ["pods"], not resources: ["*"]
# Impact: Reduces blast radius of compromised service accounts
See the full implementation guide in the source documentation.
Grant minimum permissions required for each workload:
pods, configmaps, not *get, list, not *Block RBAC manipulation verbs:
escalate - Allows creating roles with more permissions than creator hasbind - Allows granting roles to arbitrary subjectsimpersonate - Allows acting as other users without authenticationOnly cluster admins should have these verbs.
Use annotations to enforce temporary access:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: temporary-debug-access
annotations:
rbac.expires: "2025-01-05T00:00:00Z"
subjects:
- kind: User
name: engineer@company.com
roleRef:
kind: ClusterRole
name: debug-read-only
OPA policies can validate expiration and block expired bindings.
See reference.md for additional techniques and detailed examples.
See examples.md for code examples.
See reference.md for complete documentation.