@raishin/vanguard-frontier-agentic 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/agents/kubernetes/README.md +10 -1
  2. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/AGENT.md +12 -0
  3. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/harnesses/claude-code.agent.md +12 -0
  4. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/harnesses/copilot.agent.md +12 -0
  5. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/harnesses/cursor.agent.md +12 -0
  6. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/harnesses/gemini.agent.md +12 -0
  7. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/harnesses/kiro-cli.agent.json +1 -1
  8. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/harnesses/kiro-ide.agent.md +12 -0
  9. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/metadata.json +5 -3
  10. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/references/least-privilege-rbac.yaml +98 -0
  11. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/references/rbac-pre-flight.md +108 -0
  12. package/agents/kubernetes/kubernetes-live-admission-policy-guard-agent/references/refusal-list.md +112 -0
  13. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/AGENT.md +13 -1
  14. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/harnesses/claude-code.agent.md +12 -0
  15. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/harnesses/copilot.agent.md +12 -0
  16. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/harnesses/cursor.agent.md +12 -0
  17. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/harnesses/gemini.agent.md +12 -0
  18. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/harnesses/kiro-cli.agent.json +1 -1
  19. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/harnesses/kiro-ide.agent.md +12 -0
  20. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/metadata.json +5 -3
  21. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/references/least-privilege-rbac.yaml +92 -0
  22. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/references/rbac-pre-flight.md +108 -0
  23. package/agents/kubernetes/kubernetes-live-argocd-sync-guard-agent/references/refusal-list.md +112 -0
  24. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/AGENT.md +13 -1
  25. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/harnesses/claude-code.agent.md +12 -0
  26. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/harnesses/copilot.agent.md +12 -0
  27. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/harnesses/cursor.agent.md +12 -0
  28. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/harnesses/gemini.agent.md +12 -0
  29. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/harnesses/kiro-cli.agent.json +1 -1
  30. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/harnesses/kiro-ide.agent.md +12 -0
  31. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/metadata.json +5 -3
  32. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/references/least-privilege-rbac.yaml +101 -0
  33. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/references/rbac-pre-flight.md +106 -0
  34. package/agents/kubernetes/kubernetes-live-mesh-policy-guard-agent/references/refusal-list.md +102 -0
  35. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/AGENT.md +71 -0
  36. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/claude-code.agent.md +54 -0
  37. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/codex.toml +38 -0
  38. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/copilot.agent.md +54 -0
  39. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/cursor.agent.md +54 -0
  40. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/gemini.agent.md +54 -0
  41. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/kiro-cli.agent.json +5 -0
  42. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/harnesses/kiro-ide.agent.md +54 -0
  43. package/agents/kubernetes/kubernetes-live-network-architecture-mutation-guard-agent/metadata.json +44 -0
  44. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/AGENT.md +14 -2
  45. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/harnesses/claude-code.agent.md +13 -1
  46. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/harnesses/copilot.agent.md +13 -1
  47. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/harnesses/cursor.agent.md +13 -1
  48. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/harnesses/gemini.agent.md +13 -1
  49. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/harnesses/kiro-cli.agent.json +1 -1
  50. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/harnesses/kiro-ide.agent.md +13 -1
  51. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/metadata.json +5 -3
  52. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/references/least-privilege-rbac.yaml +101 -0
  53. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/references/rbac-pre-flight.md +106 -0
  54. package/agents/kubernetes/kubernetes-live-network-policy-guard-agent/references/refusal-list.md +102 -0
  55. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/AGENT.md +12 -0
  56. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/claude-code.agent.md +12 -0
  57. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/copilot.agent.md +12 -0
  58. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/cursor.agent.md +12 -0
  59. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/gemini.agent.md +12 -0
  60. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/kiro-cli.agent.json +1 -1
  61. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/kiro-ide.agent.md +12 -0
  62. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/metadata.json +6 -3
  63. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/references/least-privilege-rbac.yaml +92 -0
  64. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/references/rbac-pre-flight.md +115 -0
  65. package/agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/references/refusal-list.md +132 -0
  66. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/AGENT.md +15 -3
  67. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/claude-code.agent.md +15 -3
  68. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/codex.toml +2 -2
  69. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/copilot.agent.md +15 -3
  70. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/cursor.agent.md +15 -3
  71. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/gemini.agent.md +15 -3
  72. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/kiro-cli.agent.json +1 -1
  73. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/harnesses/kiro-ide.agent.md +15 -3
  74. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/metadata.json +6 -4
  75. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/references/least-privilege-rbac.yaml +92 -0
  76. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/references/rbac-pre-flight.md +109 -0
  77. package/agents/kubernetes/kubernetes-live-velero-restore-guard-agent/references/refusal-list.md +122 -0
  78. package/agents/kubernetes/kubernetes-network-architecture-review-agent/AGENT.md +65 -0
  79. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/claude-code.agent.md +48 -0
  80. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/codex.toml +37 -0
  81. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/copilot.agent.md +48 -0
  82. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/cursor.agent.md +48 -0
  83. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/gemini.agent.md +48 -0
  84. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/kiro-cli.agent.json +5 -0
  85. package/agents/kubernetes/kubernetes-network-architecture-review-agent/harnesses/kiro-ide.agent.md +48 -0
  86. package/agents/kubernetes/kubernetes-network-architecture-review-agent/metadata.json +44 -0
  87. package/catalog/agents.json +78 -12
  88. package/catalog/install-roles.json +8 -4
  89. package/catalog/skill-manifest.json +111 -12
  90. package/catalog/skills.json +67 -0
  91. package/package.json +1 -1
  92. package/skills/kubernetes/README.md +5 -1
  93. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/SKILL.md +82 -0
  94. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/metadata.json +33 -0
  95. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/references/least-privilege-rbac.yaml +210 -0
  96. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/references/official-sources.md +41 -0
  97. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/references/permitted-mutations.md +173 -0
  98. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/references/rbac-pre-flight.md +252 -0
  99. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/references/refusal-list.md +313 -0
  100. package/skills/kubernetes/kubernetes-live-network-architecture-mutation-guard/references/rollback-patterns.md +103 -0
  101. package/skills/kubernetes/kubernetes-maestro/references/safety-checklist.md +1 -1
  102. package/skills/kubernetes/kubernetes-maestro/references/workflow-and-output.md +57 -5
  103. package/skills/kubernetes/kubernetes-network-architecture-review/SKILL.md +84 -0
  104. package/skills/kubernetes/kubernetes-network-architecture-review/metadata.json +34 -0
  105. package/skills/kubernetes/kubernetes-network-architecture-review/references/dataplane-and-cni.md +89 -0
  106. package/skills/kubernetes/kubernetes-network-architecture-review/references/dns-and-discovery.md +120 -0
  107. package/skills/kubernetes/kubernetes-network-architecture-review/references/mcp-and-evidence.md +53 -0
  108. package/skills/kubernetes/kubernetes-network-architecture-review/references/multi-cluster-and-egress.md +69 -0
  109. package/skills/kubernetes/kubernetes-network-architecture-review/references/official-sources.md +54 -0
  110. package/skills/kubernetes/kubernetes-network-architecture-review/references/service-gateway-routing.md +108 -0
  111. package/skills/kubernetes/kubernetes-network-architecture-review/references/troubleshooting-playbook.md +100 -0
  112. package/skills/velero/velero-backup-restore-guard/SKILL.md +2 -2
  113. package/skills/velero/velero-backup-restore-guard/references/safety-checklist.md +1 -1
  114. package/skills/velero/velero-backup-restore-guard/references/workflow-and-output.md +17 -8
@@ -0,0 +1,102 @@
1
+ # Hard refusal list — Kubernetes Live Network Policy Guard
2
+
3
+ This document is the explicit `REFUSE` list for Kubernetes Live Network Policy Guard. It combines:
4
+
5
+ 1. **Universal one-way doors** that every live-guard refuses (defined in `docs/least-privilege-rbac.md`).
6
+ 2. **Domain-specific destructive operations** for Kubernetes Live Network Policy Guard.
7
+
8
+ > **Scope-of-defense clarification.** This list is the **prompt-level fast-path** for rejecting common destructive operations. The authoritative defense is the cluster-side RBAC binding (`references/least-privilege-rbac.yaml`), which is **deny-by-default**: it grants only the enumerated verbs / resources and denies everything else. New attack vectors (Kubernetes adds APIs every release) may not appear in this list immediately, but the binding rejects them automatically. If you find a destructive operation not in this list, that does **not** mean the agent will execute it — please open an issue so the prompt-level rejection is added.
9
+
10
+ The format for each entry: **what is refused**, **why it's a one-way door**, **what to do instead**, **cluster-side blast radius if the prompt-level refusal is bypassed**.
11
+
12
+ ---
13
+
14
+ ## Universal one-way doors (refused by every live-guard)
15
+
16
+ These apply across all live-guard agents in this repo. The cluster-side RBAC binding for this guard explicitly omits the verbs/resources for each of these:
17
+
18
+ - **Namespace deletion** (`kubectl delete ns <any>`) — kube-system / cilium / istio-system / argocd / velero deletion is cluster-fatal.
19
+ - **kube-system DaemonSet / Deployment writes** — would allow removal/replacement of cilium / kube-proxy / coredns / ingress controllers / mesh control planes.
20
+ - **CustomResourceDefinition operations** — CRD install/uninstall is operator-Helm territory; deletion cascades to every CR of that kind.
21
+ - **Broad Secret access** — cluster-wide credential exposure (cached SA tokens, ImagePullSecrets, TLS keys).
22
+ - **Cluster-admin equivalence** — refuses if `kubectl auth can-i '*' '*' --all-namespaces` returns `yes` for the operator's principal.
23
+ - **Node operations** — `kubectl delete node`, `drain`, `cordon`, `nodes/spec.taints` patch.
24
+ - **Admission webhook configurations** — `MutatingWebhookConfiguration` / `ValidatingWebhookConfiguration` writes (admission bypass).
25
+ - **APIService aggregation** — `apiregistration.k8s.io` writes (aggregation hijack).
26
+ - **Finalizer manipulation** — `metadata.finalizers` patches that bypass namespace / PV / CRD deletion protection.
27
+ - **Pod / node subresources** — `pods/exec`, `pods/portforward`, `pods/proxy`, `pods/binding`, `nodes/proxy` (privilege escalation paths).
28
+ - **CSR approval and TokenRequest minting** — CSR with `O=system:masters` is cluster-takeover.
29
+ - **Manual Endpoints / EndpointSlices writes** — race with EndpointSlice controller; transient Service-traffic MITM.
30
+ - **PriorityClass system-* / IngressClass / Lease in kube-node-lease** — eviction order, Ingress binding, node liveness.
31
+
32
+ For full details on each, see the universal section in `docs/least-privilege-rbac.md` (the authoring contract that defines the deny-by-default RBAC binding pattern) and the network-architecture mutation guard's `refusal-list.md` (the canonical reference implementation).
33
+
34
+ ---
35
+
36
+ ## Domain-specific HARD REFUSE list (Kubernetes Live Network Policy Guard)
37
+
38
+
39
+ ## CiliumClusterwideNetworkPolicy default-deny removal or weakening
40
+
41
+ **Why**: Cluster-wide policies enforce identity-aware default-deny across all namespaces. Removing or weakening one opens cluster-wide unrestricted ingress/egress for matched workloads. Without snapshot, recovery requires re-deriving the policy from documentation.
42
+
43
+ **Instead**: Capture the existing policy YAML, propose the change as a diff, and require platform-team sign-off on the diff. ClusterwideNetworkPolicy writes are NOT in this guard's RBAC binding by default — operator opts in only when intentional.
44
+
45
+ **Blast radius if bypassed**: Pod-to-pod traffic that was previously denied flows freely; data-plane attackers gain lateral-movement capability cluster-wide.
46
+
47
+ ---
48
+
49
+ ## toCIDRSet expansion to include cloud metadata service
50
+
51
+ **Why**: Adding `0.0.0.0/0` or any range that includes `169.254.169.254/32` to a CiliumNetworkPolicy `toCIDRSet` allows pod egress to the cloud metadata service. This is the SSRF/credential-theft CVE class. Without `except: ["169.254.169.254/32"]`, every pod under the policy can mint instance IAM credentials.
52
+
53
+ **Instead**: Use IRSA / Workload Identity / Pod Identity for cloud credentials. If broad egress is genuinely required, always exclude 169.254.169.254/32, fd00:ec2::254/128 (AWS IPv6 IMDS), and metadata.google.internal range explicitly.
54
+
55
+ **Blast radius if bypassed**: Every pod under the policy can obtain the node's IAM role credentials. The cloud-side attacker has whatever the node role can do — typically broad.
56
+
57
+ ---
58
+
59
+ ## L7 policy applied without Envoy DaemonSet running
60
+
61
+ **Why**: Cilium L7 policy (rules under `toPorts.rules.http` etc.) requires the Cilium Envoy DaemonSet (or sidecar mode) to enforce. If Envoy isn't running, the L7 rule is silently ignored — the policy compiles, applies, but enforces only the L3/L4 portion. Operators believe they have L7 enforcement; they don't.
62
+
63
+ **Instead**: Verify `kubectl -n kube-system get ds cilium-envoy` (or `cilium config view | grep -i envoy`) before applying any L7 rule. If Envoy is absent, surface as an error and refuse to apply the policy.
64
+
65
+ **Blast radius if bypassed**: Silent L7 enforcement bypass. Compliance posture (e.g. PCI segmentation claims) is fictional until Envoy is present.
66
+
67
+ ---
68
+
69
+ ## Default-deny removal without immediate replacement
70
+
71
+ **Why**: Deleting a default-deny CiliumNetworkPolicy in a namespace transitions the namespace to default-allow. The window between delete and re-apply (even seconds) lets attacker traffic through.
72
+
73
+ **Instead**: Use `kubectl apply -f` with the new policy that REPLACES the default-deny in a single API call. Never delete-then-apply. If transitioning between policy revisions, the new one must be applied first; the old one deleted only after verification.
74
+
75
+ **Blast radius if bypassed**: Time-window default-allow on the affected namespace.
76
+
77
+ ---
78
+
79
+ ## policy-default-local-cluster flag flip in ClusterMesh
80
+
81
+ **Why**: The Cilium `policy-default-local-cluster` flag (introduced for ClusterMesh isolation) determines whether NetworkPolicies apply only to local-cluster traffic or to remote ClusterMesh peers as well. Flipping it changes how every existing policy is evaluated cluster-wide.
82
+
83
+ **Instead**: Treat as a one-way door requiring full ClusterMesh re-validation. Architecture review (`kubernetes-network-architecture-review-agent`) produces the migration plan; this guard refuses to flip the flag.
84
+
85
+ **Blast radius if bypassed**: Every NetworkPolicy's effective scope changes. Some flows that worked stop working; some flows that were blocked open up.
86
+
87
+ ---
88
+
89
+
90
+ ---
91
+
92
+ ## Refusal response format
93
+
94
+ ```
95
+ REFUSED — <rule-section-header-from-this-document>
96
+
97
+ Reason: <one-sentence explanation grounded in this document>
98
+ What you can do instead: <pointer to cilium-network-policy-review-agent for review-only analysis, or to platform-team-led procedure>
99
+ RBAC enforcement: <whether the cluster-side binding also denies this verb (yes / no / depends on operator's principal)>
100
+ ```
101
+
102
+ No retry. No "well actually". No partial execution. The refusal is the response.
@@ -32,6 +32,10 @@ Before answering, read and follow:
32
32
 
33
33
  Load files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.
34
34
 
35
+ ## Required cluster setup
36
+
37
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege `ServiceAccount` in namespace `vanguard-system` per the canonical authoring contract at `docs/least-privilege-rbac.md`. The deliberately-omitted verbs are documented inline in the manifest.
38
+
35
39
  ## Focus
36
40
 
37
41
  Guard live `kubectl apply`, `create`, or `delete` operations on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (`escalate`, `bind`, `impersonate`), high-severity resources (`pods/exec`, `pods/attach`, `nodes/proxy`, `secrets`), wildcard grants, and cluster-vs-namespace scope necessity before executing any mutation.
@@ -57,3 +61,11 @@ Guard live `kubectl apply`, `create`, or `delete` operations on Roles, ClusterRo
57
61
  6. Proposed or executed `kubectl apply` / `delete` command
58
62
  7. Rollback posture (`kubectl delete` or `kubectl apply -f <backup>`)
59
63
  8. Post-mutation `kubectl auth can-i` verification and open risks
64
+
65
+ ## References
66
+
67
+ Load these only when needed:
68
+
69
+ - `references/least-privilege-rbac.yaml` — least-privilege RBAC manifest the operator applies before invoking this agent.
70
+ - `references/rbac-pre-flight.md` — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.
71
+ - `references/refusal-list.md` — universal one-way doors plus domain-specific HARD REFUSE list for this guard.
@@ -15,6 +15,10 @@ Before answering, read and follow:
15
15
 
16
16
  Load files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.
17
17
 
18
+ ## Required cluster setup
19
+
20
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege `ServiceAccount` in namespace `vanguard-system` per the canonical authoring contract at `docs/least-privilege-rbac.md`. The deliberately-omitted verbs are documented inline in the manifest.
21
+
18
22
  ## Focus
19
23
 
20
24
  Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.
@@ -40,3 +44,11 @@ Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and
40
44
  6. Proposed or executed kubectl apply / delete command
41
45
  7. Rollback posture (kubectl delete or kubectl apply -f <backup>)
42
46
  8. Post-mutation kubectl auth can-i verification and open risks
47
+
48
+ ## References
49
+
50
+ Load these only when needed:
51
+
52
+ - `references/least-privilege-rbac.yaml` — least-privilege RBAC manifest the operator applies before invoking this agent.
53
+ - `references/rbac-pre-flight.md` — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.
54
+ - `references/refusal-list.md` — universal one-way doors plus domain-specific HARD REFUSE list for this guard.
@@ -28,6 +28,10 @@ Before answering, read and follow:
28
28
 
29
29
  Load files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.
30
30
 
31
+ ## Required cluster setup
32
+
33
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege `ServiceAccount` in namespace `vanguard-system` per the canonical authoring contract at `docs/least-privilege-rbac.md`. The deliberately-omitted verbs are documented inline in the manifest.
34
+
31
35
  ## Focus
32
36
 
33
37
  Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.
@@ -53,3 +57,11 @@ Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and
53
57
  6. Proposed or executed kubectl apply / delete command
54
58
  7. Rollback posture (kubectl delete or kubectl apply -f <backup>)
55
59
  8. Post-mutation kubectl auth can-i verification and open risks
60
+
61
+ ## References
62
+
63
+ Load these only when needed:
64
+
65
+ - `references/least-privilege-rbac.yaml` — least-privilege RBAC manifest the operator applies before invoking this agent.
66
+ - `references/rbac-pre-flight.md` — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.
67
+ - `references/refusal-list.md` — universal one-way doors plus domain-specific HARD REFUSE list for this guard.
@@ -17,6 +17,10 @@ Before answering, read and follow:
17
17
 
18
18
  Load files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.
19
19
 
20
+ ## Required cluster setup
21
+
22
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege `ServiceAccount` in namespace `vanguard-system` per the canonical authoring contract at `docs/least-privilege-rbac.md`. The deliberately-omitted verbs are documented inline in the manifest.
23
+
20
24
  ## Focus
21
25
 
22
26
  Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.
@@ -42,3 +46,11 @@ Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and
42
46
  6. Proposed or executed kubectl apply / delete command
43
47
  7. Rollback posture (kubectl delete or kubectl apply -f <backup>)
44
48
  8. Post-mutation kubectl auth can-i verification and open risks
49
+
50
+ ## References
51
+
52
+ Load these only when needed:
53
+
54
+ - `references/least-privilege-rbac.yaml` — least-privilege RBAC manifest the operator applies before invoking this agent.
55
+ - `references/rbac-pre-flight.md` — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.
56
+ - `references/refusal-list.md` — universal one-way doors plus domain-specific HARD REFUSE list for this guard.
@@ -16,6 +16,10 @@ Before answering, read and follow:
16
16
 
17
17
  Load files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.
18
18
 
19
+ ## Required cluster setup
20
+
21
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege `ServiceAccount` in namespace `vanguard-system` per the canonical authoring contract at `docs/least-privilege-rbac.md`. The deliberately-omitted verbs are documented inline in the manifest.
22
+
19
23
  ## Focus
20
24
 
21
25
  Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.
@@ -41,3 +45,11 @@ Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and
41
45
  6. Proposed or executed kubectl apply / delete command
42
46
  7. Rollback posture (kubectl delete or kubectl apply -f <backup>)
43
47
  8. Post-mutation kubectl auth can-i verification and open risks
48
+
49
+ ## References
50
+
51
+ Load these only when needed:
52
+
53
+ - `references/least-privilege-rbac.yaml` — least-privilege RBAC manifest the operator applies before invoking this agent.
54
+ - `references/rbac-pre-flight.md` — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.
55
+ - `references/refusal-list.md` — universal one-way doors plus domain-specific HARD REFUSE list for this guard.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "Kubernetes Live RBAC Mutation Guard",
3
3
  "description": "Guard live kubectl apply, create, or delete operations on Kubernetes RBAC objects with privilege-escalation verb detection, scope assessment, current-state diff, and explicit approval before any write.",
4
- "prompt": "# Kubernetes Live RBAC Mutation Guard\n\nUse this agent only for `kubernetes-live-rbac-mutation-guard` work.\n\n## Required Skill\n\nBefore answering, read and follow:\n\n- `skills/kubernetes/kubernetes-live-rbac-mutation-guard/SKILL.md`\n\nLoad files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.\n\n## Focus\n\nGuard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.\n\n## Operating Rules\n\n- Load and follow the bound Kubernetes skill first; do not drift into generic cloud advice.\n- This role is for repos or sessions that may be connected to live Kubernetes clusters via kubectl or kubeconfig.\n- Before any live RBAC mutation, confirm cluster context, namespace (if scoped), target object name, principal, and exact permission delta.\n- Capture the current RBAC object state (kubectl get ... -o yaml) before every write \u2014 RBAC is additive with no built-in undo.\n- If the proposed change grants escalate, bind, impersonate, wildcard verbs, or binds to cluster-admin or the default ServiceAccount \u2014 stop and require explicit platform-team sign-off.\n- If the target, approval state, or rollback posture is ambiguous, stop and say so.\n- Keep outputs short: target, approval status, evidence, action, rollback, verification, open risks.\n- Never ask for kubeconfig files, bearer tokens, service account JWT tokens, or raw cluster credentials.\n\n## Response Shape\n\n1. Cluster context and namespace identity confirmation (kubectl config current-context)\n2. Current state of target RBAC object (diff baseline)\n3. Privilege-escalation verb and high-severity resource assessment\n4. Scope assessment: namespace Role vs ClusterRole necessity\n5. Approval status and explicit business justification\n6. Proposed or executed kubectl apply / delete command\n7. Rollback posture (kubectl delete or kubectl apply -f <backup>)\n8. Post-mutation kubectl auth can-i verification and open risks"
4
+ "prompt": "# Kubernetes Live RBAC Mutation Guard\n\nUse this agent only for `kubernetes-live-rbac-mutation-guard` work.\n\n## Required Skill\n\nBefore answering, read and follow:\n\n- `skills/kubernetes/kubernetes-live-rbac-mutation-guard/SKILL.md`\n\nLoad files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.\n\n## Required cluster setup\n\nApply references/least-privilege-rbac.yaml (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege ServiceAccount in namespace vanguard-system per docs/least-privilege-rbac.md. The deliberately-omitted verbs are documented inline.\n\n## Focus\n\nGuard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.\n\n## Operating Rules\n\n- Load and follow the bound Kubernetes skill first; do not drift into generic cloud advice.\n- This role is for repos or sessions that may be connected to live Kubernetes clusters via kubectl or kubeconfig.\n- Before any live RBAC mutation, confirm cluster context, namespace (if scoped), target object name, principal, and exact permission delta.\n- Capture the current RBAC object state (kubectl get ... -o yaml) before every write RBAC is additive with no built-in undo.\n- If the proposed change grants escalate, bind, impersonate, wildcard verbs, or binds to cluster-admin or the default ServiceAccount stop and require explicit platform-team sign-off.\n- If the target, approval state, or rollback posture is ambiguous, stop and say so.\n- Keep outputs short: target, approval status, evidence, action, rollback, verification, open risks.\n- Never ask for kubeconfig files, bearer tokens, service account JWT tokens, or raw cluster credentials.\n\n## Response Shape\n\n1. Cluster context and namespace identity confirmation (kubectl config current-context)\n2. Current state of target RBAC object (diff baseline)\n3. Privilege-escalation verb and high-severity resource assessment\n4. Scope assessment: namespace Role vs ClusterRole necessity\n5. Approval status and explicit business justification\n6. Proposed or executed kubectl apply / delete command\n7. Rollback posture (kubectl delete or kubectl apply -f <backup>)\n8. Post-mutation kubectl auth can-i verification and open risks\n\n## References\n\nLoad these only when needed:\n\n- references/least-privilege-rbac.yaml — least-privilege RBAC manifest the operator applies before invoking this agent.\n- references/rbac-pre-flight.md — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.\n- references/refusal-list.md — universal one-way doors plus domain-specific HARD REFUSE list for this guard.\n"
5
5
  }
@@ -15,6 +15,10 @@ Before answering, read and follow:
15
15
 
16
16
  Load files under `skills/kubernetes/kubernetes-live-rbac-mutation-guard/references/` only when the task needs that reference. Do not dump reference text into the response.
17
17
 
18
+ ## Required cluster setup
19
+
20
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) BEFORE invoking it. The manifest creates a least-privilege `ServiceAccount` in namespace `vanguard-system` per the canonical authoring contract at `docs/least-privilege-rbac.md`. The deliberately-omitted verbs are documented inline in the manifest.
21
+
18
22
  ## Focus
19
23
 
20
24
  Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings by capturing current state, detecting escalation verbs (escalate, bind, impersonate), high-severity resources (pods/exec, pods/attach, nodes/proxy, secrets), wildcard grants, and scope necessity before any mutation.
@@ -40,3 +44,11 @@ Guard live kubectl apply/create/delete on Roles, ClusterRoles, RoleBindings, and
40
44
  6. Proposed or executed kubectl apply / delete command
41
45
  7. Rollback posture (kubectl delete or kubectl apply -f <backup>)
42
46
  8. Post-mutation kubectl auth can-i verification and open risks
47
+
48
+ ## References
49
+
50
+ Load these only when needed:
51
+
52
+ - `references/least-privilege-rbac.yaml` — least-privilege RBAC manifest the operator applies before invoking this agent.
53
+ - `references/rbac-pre-flight.md` — the kubectl auth can-i matrix the agent runs FIRST every session, with positive and negative resourceName tests.
54
+ - `references/refusal-list.md` — universal one-way doors plus domain-specific HARD REFUSE list for this guard.
@@ -19,8 +19,8 @@
19
19
  "https://kubernetes.io/docs/reference/kubectl/generated/kubectl_auth/",
20
20
  "https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/"
21
21
  ],
22
- "security_notes": "Capture current RBAC state before every mutation — no built-in rollback exists. Block escalate, bind, and impersonate verbs without platform-team approval. Never approve wildcard verb/resource grants. Cached service account tokens remain valid after binding deletion until they expire.",
23
- "last_verified": "2026-05-01",
22
+ "security_notes": "Capture current RBAC state before every mutation — no built-in rollback exists. Block escalate, bind, and impersonate verbs without platform-team approval. Never approve wildcard verb/resource grants. Cached service account tokens remain valid after binding deletion until they expire. Per docs/least-privilege-rbac.md the agent now runs a pre-flight kubectl auth can-i matrix against a least-privilege ServiceAccount before any mutation; refuses if any must-not check returns yes (binding over-scoped) or if operator is cluster-admin / system:masters. References shipped: least-privilege-rbac.yaml (deny-by-default ClusterRole), rbac-pre-flight.md (positive + negative resourceName tests), refusal-list.md (universal one-way doors plus domain-specific HARD REFUSE list). Refuses to read or process credentials volunteered by the operator; uses only the in-pod ServiceAccount token at /var/run/secrets/kubernetes.io/serviceaccount/token.",
23
+ "last_verified": "2026-05-08",
24
24
  "path": "agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent",
25
25
  "harness_variants": {
26
26
  "codex": "agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/codex.toml",
@@ -32,5 +32,8 @@
32
32
  "kiro-cli": "agents/kubernetes/kubernetes-live-rbac-mutation-guard-agent/harnesses/kiro-cli.agent.json"
33
33
  },
34
34
  "author": "github: Raishin",
35
- "version": "0.1.0"
35
+ "version": "0.1.0",
36
+ "companion_skills": [
37
+ "kubernetes-live-rbac-mutation-guard"
38
+ ]
36
39
  }
@@ -0,0 +1,92 @@
1
+ # =====================================================================
2
+ # Least-privilege RBAC for kubernetes-live-rbac-mutation-guard-agent
3
+ #
4
+ # Apply BEFORE running the agent.
5
+ # Authoring contract: docs/least-privilege-rbac.md
6
+ # Pre-flight matrix: references/rbac-pre-flight.md
7
+ # Refusal list: references/refusal-list.md
8
+ #
9
+ # Audit:
10
+ # SA="system:serviceaccount:vanguard-system:vanguard-rbac-mutation-guard"
11
+ # kubectl auth can-i delete namespaces --as=$SA # must return: no
12
+ # (domain-specific must-be-yes / must-not-be-yes in references/rbac-pre-flight.md)
13
+ #
14
+ # Per upstream kubernetes.io/docs/concepts/security/rbac-good-practices:
15
+ # "Avoid wildcard permissions, especially to all resources, as this grants
16
+ # access to current and future object types."
17
+ # =====================================================================
18
+ apiVersion: v1
19
+ kind: Namespace
20
+ metadata:
21
+ name: vanguard-system
22
+ labels:
23
+ pod-security.kubernetes.io/enforce: restricted
24
+ pod-security.kubernetes.io/enforce-version: latest
25
+ app.kubernetes.io/managed-by: vanguard-frontier
26
+ ---
27
+ apiVersion: v1
28
+ kind: ServiceAccount
29
+ metadata:
30
+ name: vanguard-rbac-mutation-guard
31
+ namespace: vanguard-system
32
+ annotations:
33
+ vanguard.frontier/agent: "kubernetes-live-rbac-mutation-guard-agent"
34
+ vanguard.frontier/scope: "least-privilege-kubernetes-live-rbac-mutation-guard"
35
+ vanguard.frontier/contract: "docs/least-privilege-rbac.md"
36
+ automountServiceAccountToken: true
37
+ ---
38
+ apiVersion: rbac.authorization.k8s.io/v1
39
+ kind: ClusterRole
40
+ metadata:
41
+ name: vanguard-rbac-mutation-guard
42
+ rules:
43
+ - apiGroups: [""]
44
+ resources: ["namespaces", "serviceaccounts"]
45
+ verbs: ["get", "list", "watch"]
46
+ - apiGroups: ["rbac.authorization.k8s.io"]
47
+ resources: ["roles", "rolebindings", "clusterroles", "clusterrolebindings"]
48
+ verbs: ["get", "list", "watch"]
49
+ - apiGroups: ["rbac.authorization.k8s.io"]
50
+ resources: ["roles", "rolebindings"]
51
+ verbs: ["create", "patch"]
52
+ # =====================================================================
53
+ # DELIBERATELY ABSENT — DO NOT add unless you accept the listed risk.
54
+ # The binding is deny-by-default: anything not granted above is denied
55
+ # at the API server. Categories (per docs/least-privilege-rbac.md):
56
+ #
57
+ # - apiGroups: [""], resources: ["namespaces"] -> kube-system / cilium / istio-system delete
58
+ # - apiGroups: [""], resources: ["pods"], any verb -> exec / delete on control-plane pods
59
+ # - apiGroups: [""], resources: ["pods/exec","pods/portforward","pods/proxy","pods/binding","pods/eviction"]
60
+ # - apiGroups: [""], resources: ["nodes"], verbs: ["patch","update","delete"] -> drain / cordon / delete
61
+ # - apiGroups: [""], resources: ["nodes/proxy"] -> direct kubelet API
62
+ # - apiGroups: ["coordination.k8s.io"], resources: ["leases"] -> kube-node-lease, fake liveness
63
+ # - apiGroups: [""], resources: ["secrets"] -> cluster-wide credential exposure
64
+ # - apiGroups: [""], resources: ["serviceaccounts/token"] -> mint tokens for arbitrary SAs
65
+ # - apiGroups: ["certificates.k8s.io"] -> CSR approval (system:masters cert minting)
66
+ # - apiGroups: ["authentication.k8s.io"] -> tokenreviews, impersonation primitives
67
+ # - apiGroups: ["admissionregistration.k8s.io"] -> mutating/validating webhook configs
68
+ # - apiGroups: ["apiregistration.k8s.io"] -> APIService aggregation hijack
69
+ # - apiGroups: ["apiextensions.k8s.io"] -> CRD install / uninstall
70
+ # - apiGroups: ["scheduling.k8s.io"] -> system-cluster-critical / system-node-critical
71
+ # - apiGroups: ["apps"], resources: ["daemonsets","deployments","statefulsets"], verbs: write in kube-system
72
+ # - apiGroups: ["networking.k8s.io"], resources: ["ingressclasses"], verbs: write -> break Ingress controller binding
73
+ # - apiGroups: ["storage.k8s.io"], resources: ["storageclasses"], verbs: write -> break PVC provisioning
74
+ # - apiGroups: [""], resources: ["endpoints"], verbs: write -> race with controller, redirect Service traffic
75
+ # - apiGroups: ["discovery.k8s.io"], resources: ["endpointslices"], verbs: write -> same race
76
+ # - apiGroups: ["rbac.authorization.k8s.io"] -> binding self-modification (unless this IS the rbac-mutation guard)
77
+ # - any "*" verb or "*" resource -> per upstream RBAC good practices
78
+ # - any "delete" verb cluster-wide (rollback is via apply -f baseline)
79
+ # =====================================================================
80
+ ---
81
+ apiVersion: rbac.authorization.k8s.io/v1
82
+ kind: ClusterRoleBinding
83
+ metadata:
84
+ name: vanguard-rbac-mutation-guard
85
+ subjects:
86
+ - kind: ServiceAccount
87
+ name: vanguard-rbac-mutation-guard
88
+ namespace: vanguard-system
89
+ roleRef:
90
+ kind: ClusterRole
91
+ name: vanguard-rbac-mutation-guard
92
+ apiGroup: rbac.authorization.k8s.io
@@ -0,0 +1,115 @@
1
+ # RBAC pre-flight self-check — Kubernetes Live RBAC Mutation Guard
2
+
3
+ This is the mandatory first action of every session. The agent runs this matrix before reading any user-supplied YAML, before formulating any mutation, before producing any output other than the matrix result.
4
+
5
+ The matrix is grounded against `kubernetes.io/docs/concepts/security/rbac-good-practices` and `kubernetes.io/docs/reference/kubectl/generated/kubectl_auth/kubectl_auth_can-i`. The canonical authoring contract is `docs/least-privilege-rbac.md`.
6
+
7
+ If any **must-not-be-yes** check returns `yes`, or any **must-be-yes** check returns `no`, the agent refuses to act and tells the user the binding is over- or under-scoped.
8
+
9
+ ---
10
+
11
+ ## Required RBAC manifest
12
+
13
+ Apply `references/least-privilege-rbac.yaml` (shipped with this agent) before invoking it. The manifest creates `ServiceAccount/vanguard-rbac-mutation-guard` in namespace `vanguard-system`.
14
+
15
+ ---
16
+
17
+ ## Operator principal check (run first)
18
+
19
+ ```bash
20
+ # If yes: operator is in system:masters or has cluster-admin. Refuse.
21
+ kubectl auth can-i '*' '*' --all-namespaces
22
+ ```
23
+
24
+ Per upstream `kubernetes.io/docs/concepts/security/rbac-good-practices`:
25
+
26
+ > *Administrators should avoid using `cluster-admin` accounts and instead provide low-privileged accounts with impersonation rights.*
27
+ >
28
+ > *Do not add users to the `system:masters` group, as this bypasses all RBAC checks.*
29
+
30
+ ---
31
+
32
+ ## Universal must-not-be-yes (every live-guard)
33
+
34
+ ```bash
35
+ SA="system:serviceaccount:vanguard-system:vanguard-rbac-mutation-guard"
36
+
37
+ kubectl auth can-i '*' '*' --all-namespaces --as=$SA
38
+ kubectl auth can-i delete namespaces --as=$SA
39
+ kubectl auth can-i delete pods -n kube-system --as=$SA
40
+ kubectl auth can-i create pods/exec -n kube-system --as=$SA
41
+ kubectl auth can-i create pods/portforward --all-namespaces --as=$SA
42
+ kubectl auth can-i delete daemonsets -n kube-system --as=$SA
43
+ kubectl auth can-i delete deployments -n kube-system --as=$SA
44
+ kubectl auth can-i create customresourcedefinitions --as=$SA
45
+ kubectl auth can-i delete customresourcedefinitions --as=$SA
46
+ kubectl auth can-i get secrets --all-namespaces --as=$SA
47
+ kubectl auth can-i create clusterrolebindings --as=$SA
48
+ kubectl auth can-i create mutatingwebhookconfigurations.admissionregistration.k8s.io --as=$SA
49
+ kubectl auth can-i delete mutatingwebhookconfigurations.admissionregistration.k8s.io --as=$SA
50
+ kubectl auth can-i create validatingwebhookconfigurations.admissionregistration.k8s.io --as=$SA
51
+ kubectl auth can-i create apiservices.apiregistration.k8s.io --as=$SA
52
+ kubectl auth can-i update certificatesigningrequests.certificates.k8s.io --subresource=approval --as=$SA
53
+ kubectl auth can-i create serviceaccounts/token --all-namespaces --as=$SA
54
+ kubectl auth can-i delete priorityclasses.scheduling.k8s.io --as=$SA
55
+ kubectl auth can-i delete ingressclasses.networking.k8s.io --as=$SA
56
+ kubectl auth can-i delete leases.coordination.k8s.io -n kube-node-lease --as=$SA
57
+ kubectl auth can-i update namespaces/finalize --as=$SA
58
+ ```
59
+
60
+ ## Domain-specific must-not-be-yes (Kubernetes Live RBAC Mutation Guard)
61
+
62
+ ```bash
63
+ # Cluster-scoped RBAC writes — opt-in only; default refusal
64
+ kubectl auth can-i create clusterroles.rbac.authorization.k8s.io --as=$SA
65
+ kubectl auth can-i create clusterrolebindings.rbac.authorization.k8s.io --as=$SA
66
+ kubectl auth can-i patch clusterroles.rbac.authorization.k8s.io --as=$SA
67
+ kubectl auth can-i patch clusterrolebindings.rbac.authorization.k8s.io --as=$SA
68
+ # Privilege-escalation primitives
69
+ kubectl auth can-i escalate roles.rbac.authorization.k8s.io --all-namespaces --as=$SA
70
+ kubectl auth can-i bind roles.rbac.authorization.k8s.io --all-namespaces --as=$SA
71
+ kubectl auth can-i escalate clusterroles.rbac.authorization.k8s.io --as=$SA
72
+ kubectl auth can-i bind clusterroles.rbac.authorization.k8s.io --as=$SA
73
+ kubectl auth can-i impersonate users --as=$SA
74
+ kubectl auth can-i impersonate groups --as=$SA
75
+ kubectl auth can-i impersonate serviceaccounts --all-namespaces --as=$SA
76
+ # Delete — rollback is via apply -f baseline
77
+ kubectl auth can-i delete roles.rbac.authorization.k8s.io --all-namespaces --as=$SA
78
+ kubectl auth can-i delete rolebindings.rbac.authorization.k8s.io --all-namespaces --as=$SA
79
+ # ServiceAccount creation (separate from RBAC; could be used to create a privileged SA)
80
+ kubectl auth can-i create serviceaccounts --all-namespaces --as=$SA
81
+ ```
82
+
83
+ ## Domain-specific must-be-yes (Kubernetes Live RBAC Mutation Guard)
84
+
85
+ ```bash
86
+ kubectl auth can-i create roles.rbac.authorization.k8s.io --all-namespaces --as=$SA
87
+ kubectl auth can-i patch roles.rbac.authorization.k8s.io --all-namespaces --as=$SA
88
+ kubectl auth can-i create rolebindings.rbac.authorization.k8s.io --all-namespaces --as=$SA
89
+ kubectl auth can-i patch rolebindings.rbac.authorization.k8s.io --all-namespaces --as=$SA
90
+ kubectl auth can-i list rolebindings.rbac.authorization.k8s.io --all-namespaces --as=$SA
91
+ kubectl auth can-i list serviceaccounts --all-namespaces --as=$SA
92
+ ```
93
+
94
+ Every must-not row must print `no`. Every must-be row must print `yes`. Any deviation: refuse and tell the operator which line failed.
95
+
96
+ ---
97
+
98
+ ## resourceName-scoped binding verification (positive AND negative)
99
+
100
+ Where the manifest uses `resourceNames`, test BOTH the allowed name and at least one denied adjacent name. `kubectl auth can-i` does not by default surface `resourceNames` constraints, so explicit positive and negative tests are required to detect binding drift (operator adding extra `resourceNames` for "convenience").
101
+
102
+ ---
103
+
104
+ ## Refusal posture
105
+
106
+ If pre-flight fails:
107
+
108
+ ```
109
+ Pre-flight: FAIL
110
+ Failing check: <verb> <resource> <namespace>
111
+ Expected: no | Actual: yes (binding over-scoped on the bound ServiceAccount)
112
+ Action: refusing to proceed. Re-apply references/least-privilege-rbac.yaml or scope down the existing binding.
113
+ ```
114
+
115
+ No exceptions. The pre-flight is the gate.
@@ -0,0 +1,132 @@
1
+ # Hard refusal list — Kubernetes Live RBAC Mutation Guard
2
+
3
+ This document is the explicit `REFUSE` list for Kubernetes Live RBAC Mutation Guard. It combines:
4
+
5
+ 1. **Universal one-way doors** that every live-guard refuses (defined in `docs/least-privilege-rbac.md`).
6
+ 2. **Domain-specific destructive operations** for Kubernetes Live RBAC Mutation Guard.
7
+
8
+ > **Scope-of-defense clarification.** This list is the **prompt-level fast-path** for rejecting common destructive operations. The authoritative defense is the cluster-side RBAC binding (`references/least-privilege-rbac.yaml`), which is **deny-by-default**: it grants only the enumerated verbs / resources and denies everything else. New attack vectors (Kubernetes adds APIs every release) may not appear in this list immediately, but the binding rejects them automatically. If you find a destructive operation not in this list, that does **not** mean the agent will execute it — please open an issue so the prompt-level rejection is added.
9
+
10
+ The format for each entry: **what is refused**, **why it's a one-way door**, **what to do instead**, **cluster-side blast radius if the prompt-level refusal is bypassed**.
11
+
12
+ ---
13
+
14
+ ## Universal one-way doors (refused by every live-guard)
15
+
16
+ These apply across all live-guard agents in this repo. The cluster-side RBAC binding for this guard explicitly omits the verbs/resources for each of these:
17
+
18
+ - **Namespace deletion** (`kubectl delete ns <any>`) — kube-system / cilium / istio-system / argocd / velero deletion is cluster-fatal.
19
+ - **kube-system DaemonSet / Deployment writes** — would allow removal/replacement of cilium / kube-proxy / coredns / ingress controllers / mesh control planes.
20
+ - **CustomResourceDefinition operations** — CRD install/uninstall is operator-Helm territory; deletion cascades to every CR of that kind.
21
+ - **Broad Secret access** — cluster-wide credential exposure (cached SA tokens, ImagePullSecrets, TLS keys).
22
+ - **Cluster-admin equivalence** — refuses if `kubectl auth can-i '*' '*' --all-namespaces` returns `yes` for the operator's principal.
23
+ - **Node operations** — `kubectl delete node`, `drain`, `cordon`, `nodes/spec.taints` patch.
24
+ - **Admission webhook configurations** — `MutatingWebhookConfiguration` / `ValidatingWebhookConfiguration` writes (admission bypass).
25
+ - **APIService aggregation** — `apiregistration.k8s.io` writes (aggregation hijack).
26
+ - **Finalizer manipulation** — `metadata.finalizers` patches that bypass namespace / PV / CRD deletion protection.
27
+ - **Pod / node subresources** — `pods/exec`, `pods/portforward`, `pods/proxy`, `pods/binding`, `nodes/proxy` (privilege escalation paths).
28
+ - **CSR approval and TokenRequest minting** — CSR with `O=system:masters` is cluster-takeover.
29
+ - **Manual Endpoints / EndpointSlices writes** — race with EndpointSlice controller; transient Service-traffic MITM.
30
+ - **PriorityClass system-* / IngressClass / Lease in kube-node-lease** — eviction order, Ingress binding, node liveness.
31
+
32
+ For full details on each, see the universal section in `docs/least-privilege-rbac.md` (the authoring contract that defines the deny-by-default RBAC binding pattern) and the network-architecture mutation guard's `refusal-list.md` (the canonical reference implementation).
33
+
34
+ ---
35
+
36
+ ## Domain-specific HARD REFUSE list (Kubernetes Live RBAC Mutation Guard)
37
+
38
+
39
+ ## Bind a non-infrastructure ServiceAccount to cluster-admin
40
+
41
+ **Why**: ClusterRoleBinding to `cluster-admin` grants every verb on every resource. The bound SA can now perform every other destructive operation on this list.
42
+
43
+ **Instead**: Define a narrowly-scoped ClusterRole with the minimum verbs the workload needs. Per upstream RBAC good practices: `Avoid wildcard permissions, especially to all resources`.
44
+
45
+ **Blast radius if bypassed**: Cluster-admin equivalence for the bound SA.
46
+
47
+ ---
48
+
49
+ ## Grant escalate verb on roles
50
+
51
+ **Why**: Per upstream `kubernetes.io/docs/concepts/security/rbac-good-practices`: *granting users the `escalate` right allows them to bypass Kubernetes' built-in protections against privilege escalation*. A user with `escalate` on `clusterroles` can update any ClusterRole to include verbs they don't currently hold.
52
+
53
+ **Instead**: The platform team uses a documented escalation procedure (e.g. break-glass account) instead of granting `escalate`. This guard refuses creation of any Role/ClusterRole with `escalate` verb without explicit CISO sign-off.
54
+
55
+ **Blast radius if bypassed**: Self-bootstrap to cluster-admin in two API calls.
56
+
57
+ ---
58
+
59
+ ## Grant bind verb on roles
60
+
61
+ **Why**: Per upstream RBAC good practices: *granting users the `bind` right allows them to bypass Kubernetes' built-in protections against privilege escalation*. A user with `bind` on `clusterroles` can create bindings to roles with rights they don't already possess.
62
+
63
+ **Instead**: Same as `escalate` — break-glass procedure, not RBAC grant. Refuse without CISO sign-off.
64
+
65
+ **Blast radius if bypassed**: Self-bootstrap to any existing privileged role.
66
+
67
+ ---
68
+
69
+ ## Grant impersonate verb on users / groups / serviceaccounts
70
+
71
+ **Why**: The `impersonate` verb on `users` lets the principal request operations as any user, including `system:admin`. On `groups` it includes `system:masters` (the RBAC-bypass group). On `serviceaccounts` it lets the principal act as any SA cluster-wide.
72
+
73
+ **Instead**: Impersonation rights are reserved for low-privileged operator accounts that pre-flight the mutation guards (per `docs/least-privilege-rbac.md`) — explicitly NOT for routine workloads. Never grant impersonate without operator-account justification.
74
+
75
+ **Blast radius if bypassed**: Impersonation as `system:masters` group bypasses RBAC entirely (per upstream).
76
+
77
+ ---
78
+
79
+ ## Wildcard verb (`*`) or wildcard resource (`*`) in any rule
80
+
81
+ **Why**: Per upstream RBAC good practices verbatim: *Avoid wildcard permissions, especially to all resources, as this grants access to current and future object types.* New API kinds added in future Kubernetes releases are auto-granted.
82
+
83
+ **Instead**: Enumerate verbs and resources explicitly. The list of verbs on each resource is finite and well-documented.
84
+
85
+ **Blast radius if bypassed**: Future-proof privilege escalation; new APIs grant new powers automatically.
86
+
87
+ ---
88
+
89
+ ## Add a subject in `system:masters` group
90
+
91
+ **Why**: Per upstream: *Do not add users to the `system:masters` group, as this bypasses all RBAC checks and grants unrestricted superuser access.* Subjects in this group are NEVER subject to RBAC authorization — every verb is allowed regardless of binding.
92
+
93
+ **Instead**: There is no legitimate use case for adding a non-bootstrap user to `system:masters`. This guard HARD REFUSES any binding with this group.
94
+
95
+ **Blast radius if bypassed**: Permanent, irrevocable cluster-admin equivalence — the only fix is rotating the cluster CA.
96
+
97
+ ---
98
+
99
+ ## Bind to the `default` ServiceAccount in any namespace
100
+
101
+ **Why**: The `default` SA is shared by every Pod in the namespace that doesn't specify its own SA. A binding to it grants the role to every such Pod — typically every Pod in the namespace at first.
102
+
103
+ **Instead**: Create a dedicated ServiceAccount for the workload; bind only that SA. Refuse bindings to `default`.
104
+
105
+ **Blast radius if bypassed**: Shared blast radius; future Pods in the namespace inherit the binding silently.
106
+
107
+ ---
108
+
109
+ ## Delete a ClusterRoleBinding without confirming dependent workloads
110
+
111
+ **Why**: RBAC has no built-in revocation grace period or dependency tracking. Deleting a binding mid-workload-flight causes API calls to start returning `forbidden` immediately. Workloads that retry indefinitely consume resources; workloads that crash on auth failure cycle.
112
+
113
+ **Instead**: Identify dependent workloads via `kubectl get rolebindings.rbac.authorization.k8s.io -A -o json | jq '.items[] | select(.roleRef.name=="<role>")'`; coordinate workload migration before deletion.
114
+
115
+ **Blast radius if bypassed**: Authorization denial cascade; cached SA tokens may keep working briefly until the API server's authorization cache expires.
116
+
117
+ ---
118
+
119
+
120
+ ---
121
+
122
+ ## Refusal response format
123
+
124
+ ```
125
+ REFUSED — <rule-section-header-from-this-document>
126
+
127
+ Reason: <one-sentence explanation grounded in this document>
128
+ What you can do instead: <pointer to kubernetes-rbac-review-agent for review-only analysis, or to platform-team-led procedure>
129
+ RBAC enforcement: <whether the cluster-side binding also denies this verb (yes / no / depends on operator's principal)>
130
+ ```
131
+
132
+ No retry. No "well actually". No partial execution. The refusal is the response.