kube-bench — CIS Kubernetes Security Benchmark
Automated checks that verify whether Kubernetes clusters are deployed according to CIS Benchmark security guidelines, scanning master and worker node configurations.
Instalación con revisión previa
Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.
npx -y tokrepo@latest install 1b8a27ea-397e-11f1-9bc6-00163e2b0d79 --target codexPrimero dry-run, confirma las escrituras y luego ejecuta este comando.
What it is
kube-bench is a Go application by Aqua Security that checks whether Kubernetes clusters are deployed according to CIS Benchmark security guidelines. It scans master and worker node configurations, verifying settings like API server flags, kubelet parameters, and etcd encryption. Results are categorized as PASS, FAIL, WARN, or INFO.
kube-bench targets cluster administrators and security teams who need automated compliance checks against the CIS Kubernetes Benchmark.
How it saves time or tokens
kube-bench automates hundreds of manual security checks that would take hours to perform by hand. Each check includes a rationale and remediation command, so you fix issues without researching each CIS control separately.
How to use
- Run as a Kubernetes Job:
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml
kubectl logs job.batch/kube-bench
- Or run directly on a node:
kube-bench run --targets master
kube-bench run --targets node
- Review the PASS/FAIL/WARN output and apply remediations.
Example
# Run as Kubernetes Job
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml
# View results
kubectl logs job.batch/kube-bench
# Run on a specific node
kube-bench run --targets master
# Output as JSON for CI integration
kube-bench run --json
# Run specific CIS section
kube-bench run --targets master --check 1.2
Related on TokRepo
- AI Tools for Security — Security scanning and compliance tools
- AI Tools for DevOps — Kubernetes and infrastructure tools
Key considerations
When evaluating kube-bench for your workflow, consider the following factors. First, assess whether your team has the technical prerequisites to adopt this tool effectively. Second, evaluate the maintenance burden against the productivity gains. Third, check community activity and documentation quality to ensure long-term viability. Integration with your existing toolchain matters more than feature count alone. Start with a small pilot project before rolling out across the organization. Monitor resource usage during the initial adoption phase to identify bottlenecks early. Document your configuration decisions so team members can onboard independently.
Common pitfalls
- kube-bench must run on cluster nodes (or with access to node configs) to check kubelet and etcd settings; running from outside the cluster provides limited results.
- Managed Kubernetes (EKS, GKE, AKS) restricts access to master node configurations; some CIS checks cannot run on managed clusters.
- WARN results are not failures but indicate checks that could not be automatically evaluated; review them manually.
Preguntas frecuentes
The CIS Benchmark is a set of security best practices published by the Center for Internet Security. It defines specific configuration checks for Kubernetes components including API server, controller manager, scheduler, kubelet, and etcd.
Partially. kube-bench can check worker node and pod security configurations on managed clusters. Master node checks are limited because cloud providers manage the control plane. EKS, GKE, and AKS have specific benchmark profiles.
Each failed check includes a remediation description with the specific flag or configuration change needed. Apply the change to the relevant Kubernetes component configuration and restart the service.
Yes. kube-bench automatically detects the Kubernetes version and runs the appropriate CIS Benchmark. You can also specify a version explicitly with the --version flag.
Yes. Run kube-bench with --json output and parse results programmatically. Many teams run kube-bench as a periodic Job or after cluster provisioning to ensure ongoing compliance.
Referencias (3)
- kube-bench GitHub— CIS Benchmark checks for Kubernetes by Aqua Security
- kube-bench README— Scans master and worker node configurations
- CIS Benchmarks— CIS Kubernetes Benchmark specification
Relacionados en TokRepo
Discusión
Activos relacionados
kube-hunter — Kubernetes Security Testing from an Attacker Perspective
kube-hunter is an open-source tool by Aqua Security that hunts for security weaknesses in Kubernetes clusters by simulating an attacker's discovery and exploitation process.
Kubescape — Kubernetes Security Platform from CNCF
Kubescape scans Kubernetes clusters, YAML manifests, and Helm charts against NSA, CIS, and MITRE frameworks. Built by ARMO and a CNCF Sandbox project, it catches misconfigurations and vulnerabilities before they reach production.
kube-state-metrics — Kubernetes Cluster State Metrics Exporter
kube-state-metrics is a Kubernetes add-on that listens to the API server and generates Prometheus metrics about the state of Kubernetes objects like deployments, nodes, and pods.
Terrascan — Static Analysis for Infrastructure as Code Security
Terrascan detects security vulnerabilities and compliance violations across Terraform, Kubernetes, Helm, CloudFormation, and Dockerfiles before you deploy, with over 500 built-in policies based on industry benchmarks.