| name | k8s-assessment |
| description | READ-ONLY Kubernetes security assessment based on CIS Kubernetes Benchmark using kubectl |
| category | security-assessment |
| tags | ["kubernetes","k8s","cis-benchmark","rbac","network-policy","pod-security","secrets","ingress","security-audit"] |
| tech_stack | ["kubernetes","kubectl"] |
| cwe_ids | ["CWE-269","CWE-284","CWE-311","CWE-732","CWE-693"] |
| chains_with | ["T1613","T1087.004","T1078.004"] |
| prerequisites | ["kubectl-access"] |
| version | 1.0 |
Kubernetes Security Assessment Methodology
READ-ONLY Kubernetes security assessment using kubectl CLI. No resources are created, modified, or deleted — all checks use get/list/describe/auth can-i verbs only. Based on CIS Kubernetes Benchmark v1.8+.
Prerequisites
- kubectl installed —
kubectl version --client
- kubeconfig with read access — cluster-viewer or equivalent ClusterRole
- Verify read-only — ALWAYS run
k8s_audit verify_readonly first
kubectl version --client
kubectl cluster-info
kubectl auth can-i list pods --all-namespaces
Assessment Phases
Phase 0 — Safety Check (MANDATORY FIRST STEP)
k8s_audit verify_readonly
Confirms current identity has no write/modify/delete permissions via kubectl auth can-i. If write permissions are detected, STOP and request a read-only kubeconfig.
Phase 1 — RBAC Analysis
| Check | Command | CIS Benchmark |
|---|
| cluster-admin bindings | k8s_audit rbac_audit | 5.1.1 |
| Wildcard ClusterRoles | k8s_audit rbac_audit | 5.1.3 |
| Default SA permissions | k8s_audit rbac_audit --namespace NS | 5.1.5 |
Phase 2 — Pod Security
| Check | Command | CIS Benchmark |
|---|
| Privileged containers | k8s_audit pod_security_audit | 5.2.1 |
| hostPID / hostNetwork | k8s_audit pod_security_audit | 5.2.2, 5.2.3 |
| Dangerous capabilities | k8s_audit pod_security_audit | 5.2.7-9 |
| Root execution | k8s_audit pod_security_audit | 5.2.6 |
|