Infrastructure50 items
Kubernetes & Container Security Checklist
A pentest-oriented checklist for Kubernetes clusters and the containers running on them. Covers cluster-control-plane exposure, pod-spec hardening, network policy, runtime escape risks, and the privilege graph that ties it all together.
Aligned with the CIS Kubernetes Benchmark, NSA/CISA Kubernetes Hardening Guidance v1.2, OWASP K8s Top 10, and NIST SP 800-190.
CIS Kubernetes BenchmarkNSA/CISA Kubernetes Hardening GuidanceOWASP K8s Top 10NIST SP 800-190
Progress: 0 of 50 items
0%
Commands
kubectl config get-contextskubectl version --shortEvidence to capture
Cluster inventory with versions and managed/unmanaged flag
Commands
kubectl get pods -A -o jsonpath='{.items[*].spec.containers[*].image}' | tr " " "\n" | sort -uCommands
kubectl get validatingwebhookconfigurationskubectl get mutatingwebhookconfigurationsReferences
Commands
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yamlkubectl logs -f job/kube-benchReferences
Commands
kube-hunter --remote <api-server>kubectl run --rm -it --image=aquasec/kube-hunter kube-hunter --command -- /entrypoint.sh --podReferences
References
Commands
nmap -p 6443,443 -sV --script=ssl-cert <api-server>Commands
kubectl get --raw "/api/v1/nodes/<node>/proxy/configz" | jqCommands
kubectl get ns -o json | jq '.items[] | {ns:.metadata.name, psa:.metadata.labels}'References
Commands
kubectl get clusterrolebindings -o json | jq '.items[] | select(.roleRef.name=="cluster-admin")'Commands
kubectl get pods -A -o json | jq '.items[] | {name:.metadata.name, ns:.metadata.namespace, runAsNonRoot:.spec.securityContext.runAsNonRoot}'Commands
kubectl get pods -A -o json | jq '.items[] | select(.spec.containers[]?.securityContext.privileged==true) | {name:.metadata.name, ns:.metadata.namespace}'Commands
kubectl get pods -A -o json | jq '.items[] | select(.spec.volumes[]?.hostPath) | {name:.metadata.name, mounts:.spec.volumes}'Commands
trivy k8s --report summary clustertrivy image <image>:<tag> --severity HIGH,CRITICALReferences
Commands
kubectl get pods -A -o json | jq '.items[] | select(.spec.automountServiceAccountToken!=false) | .metadata.name' | headCommands
kubectl auth can-i list secrets --all-namespaces --as=system:serviceaccount:<ns>:<sa>Commands
kubectl run net-test --rm -it --image=nicolaka/netshoot --restart=Never -- bashCommands
kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.kernelVersion}'References
Commands
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)kubectl --token=$TOKEN auth can-i --listCommands
kubectl run meta-probe --rm -it --image=curlimages/curl --restart=Never -- curl -fsS http://169.254.169.254/latest/meta-data/iam/security-credentials/Commands
kubectl exec -it <pod> -- cat /etc/shadowReferences
Commands
rakkess --as=system:serviceaccount:<ns>:<sa>rbac-tool policy-rules -e '^system:serviceaccount:<ns>:<sa>$'References
References
References