1---2name: kubernetes-security3description: Kubernetes and container security skill for cluster hardening, RBAC review, admission control (OPA Gatekeeper, Kyverno), Pod Security Standards, network policies, secrets management, runtime defense (Falco, Tetragon), image supply chain (cosign, SLSA, in-toto), and CIS benchmark compliance. Use to assess and harden clusters you operate.4---56# Kubernetes Security78## Authorization Boundary910- Require cluster context, namespace scope, and read-only kubeconfig before live queries.11- Avoid disruptive runtime probes on production; prefer staging or ephemeral clusters.1213## Hardening Workflow14151. Inventory: API server flags, node OS, CNI, CSI, ingress, service mesh, admission plugins, controllers.162. Scan: `kube-bench`, `kubescape`, `trivy k8s`, `polaris`, `kubeaudit`, `popeye`.173. RBAC: enumerate `ClusterRole`/`RoleBinding`; flag wildcard verbs, `system:masters`, `escalate`, `bind`, `impersonate`, secret reads from broad subjects.184. Workloads: enforce Pod Security `restricted`, drop capabilities, read-only rootfs, non-root UID, seccomp `RuntimeDefault`, no `hostPath`/`hostNetwork`/`hostPID`.195. Network: default-deny `NetworkPolicy`; explicit egress to known services; mTLS via mesh where applicable.206. Supply chain: signed images (`cosign verify`), provenance attestations (SLSA), admission policy that blocks unsigned.217. Runtime: Falco/Tetragon rules for exec-in-container, reverse shells, crypto miners, sensitive mounts.2223## Multi-Tenant Patterns2425- Namespace-per-tenant with quotas, limit ranges, and `NetworkPolicy` isolation.26- Separate node pools for untrusted workloads; gVisor or Kata for sandboxing.27- Per-tenant audit log filters; secrets via external KMS, never inline.2829## Output Contract3031- `inventory.yaml`, `findings.csv`, `policies/` (Gatekeeper/Kyverno), `netpol/`, `runtime/falco-rules.yaml`.32- `runbook.md`: incident response for compromised pod, leaked token, miner detection.33- `gap.md`: missing telemetry and proposed fixes.