kube-benchRuns the default CIS benchmark checks based on auto-detected Kubernetes version and node type.
Checks whether a Kubernetes cluster is deployed securely by running the CIS Kubernetes Benchmark tests against nodes and control plane.
brew install kube-benchkube-bench run --targets masterExecutes security checks specifically designed for the Kubernetes master/control plane node.
kube-bench run --targets nodeExecutes security checks specifically designed for Kubernetes worker nodes.
kube-bench run --targets etcdRuns checks specifically targeting the etcd data store configuration and security.
kube-bench run --targets policiesRuns checks aimed at validating Kubernetes policies and RBAC configurations.
kube-bench run --targets controlplaneTarget alias often used interchangeably with master to check control plane components.
kube-bench run --targets master,nodeExecutes benchmark checks for both master and worker node roles simultaneously.
kube-bench run --targets master,etcdCombines control plane and etcd checks in a single execution run.
kube-bench run --jsonOutputs the audit results in structured JSON format for parsing and automation.
kube-bench run --junitOutputs the audit results in JUnit XML format for CI/CD pipeline integration.
kube-bench run --noremediationsRuns checks but suppresses the remediation suggestions in the output to reduce clutter.
kube-bench run --noresultsSuppresses the detailed results output, useful when only interested in exit codes or logs.
kube-bench run --benchmark cis-1.5Forces the usage of the legacy CIS Kubernetes Benchmark v1.5.
kube-bench run --benchmark cis-1.6Forces the usage of the CIS Kubernetes Benchmark v1.6.
kube-bench run --benchmark cis-1.7Forces the usage of the CIS Kubernetes Benchmark v1.7.
kube-bench run --benchmark cis-1.20Forces the usage of the CIS Kubernetes Benchmark v1.20.
kube-bench run --benchmark cis-1.23Forces the usage of the CIS Kubernetes Benchmark v1.23.
kube-bench run --benchmark eks-1.2.0Runs the CIS benchmark specifically tailored for Amazon EKS v1.2.0.
kube-bench run --benchmark gke-1.0Runs the CIS benchmark specifically tailored for Google Kubernetes Engine (GKE).
kube-bench run --benchmark aks-1.0Runs the CIS benchmark specifically tailored for Azure Kubernetes Service (AKS).
kube-bench run --benchmark rh-0.0.1Runs the benchmark specifically tailored for Red Hat OpenShift environments.
kube-bench run --benchmark ack-1.0Runs the CIS benchmark specifically tailored for Alibaba Cloud Container Service.
kube-bench run --version <K8S_VER>Manually specifies the Kubernetes version to select the appropriate benchmark set.
Example
kube-bench run --version 1.24kube-bench run --config-dir <PATH>Specifies a custom directory path to look for benchmark configuration files.
Example
kube-bench run --config-dir /etc/kube-bench/cfgkube-bench run --config <FILE>Specifies a custom configuration file instead of the default config.yaml.
Example
kube-bench run --config /custom/config.yamlkube-bench run --targets master --json --noremediationsRuns master checks outputting pure JSON without remediation text for cleaner data ingestion.
kube-bench run --targets node --junit --skip <ID>Runs node checks, skips a known false positive, and outputs JUnit XML for CI pipelines.
Example
kube-bench run --targets node --junit --skip 4.1.1kube-bench run --targets etcd --check <ID_LIST> --jsonAudits specific etcd configurations and outputs the result in JSON.
Example
kube-bench run --targets etcd --check 2.1,2.2 --jsonkube-bench run --benchmark cis-1.23 --targets masterForces a specific modern CIS benchmark version on the master node regardless of detection.
kube-bench run --targets node --version <VER>Typical command used inside a Job definition to audit the node hosting the pod.
Example
kube-bench run --targets node --version 1.25kube-bench run --v 0Runs with minimal verbosity, reducing IO overhead during execution.
kube-bench run --check <CRITICAL_IDS>Rapidly validates the state of specific critical control plane configurations during an incident.
Example
kube-bench run --check 1.2.1,1.2.2kube-bench run --targets master,node,etcd --jsonFull cluster compliance sweep outputting a comprehensive JSON report.
kube-bench run --config-dir cfg/ --benchmark <CUSTOM>Runs a custom-defined benchmark suite located in a specific directory.
Example
kube-bench run --config-dir cfg/ --benchmark custom-1.0kube-bench run --check 1.1Runs all sub-checks under section 1.1 (e.g., API Server configuration).
kube-bench run --version <OLD_VER>Simulates an audit for an older Kubernetes version to test legacy compliance rules.
Example
kube-bench run --version 1.15kube-bench run --benchmark eks-1.2.0 --targets nodeValidates worker node security posture specifically against EKS standards.
kube-bench run --benchmark gke-1.0 --targets nodeValidates worker node security posture specifically against GKE standards.
kube-bench run --targets master --skip <FAILING_IDS>Runs master checks while ignoring known failing controls that are accepted risks.
Example
kube-bench run --targets master --skip 1.1.9,1.1.10kube-bench run --targets node --json --noremediations > result.jsonOptimized command for automated pipeline jobs to capture node status silently.
kube-bench run --log_level 2 --check <ID>High verbosity run on a single check to troubleshoot why a specific audit is failing.
Example
kube-bench run --log_level 2 --check 1.2.5kube-bench run --targets policies --jsonAudits RBAC and ServiceAccount policies specifically to detect permission drifts.
kube-bench run --benchmark cis-1.4Runs very old benchmark definitions for maintaining legacy system audits.
kube-bench run --targets controlplane --jsonFocuses strictly on the control plane components for managed service validations.
kube-bench run --json --noresultsGenerates JSON structure without human-readable summaries, maximizing parsing speed.
kube-bench run --targets master,node,etcd,policiesMaximum coverage command targeting every available component and policy.
kube-bench run --config-dir /opt/kube-bench/cfgDirects kube-bench to load configuration from a non-standard system location.
kube-bench run --junit --targets master --skip <FLAKY>Production gate check outputting JUnit, ignoring flaky tests to prevent build failures.
Example
kube-bench run --junit --targets master --skip 1.2.20kube-bench run --check 1.1.1,1.1.2,1.1.3Runs only the first three API server checks as a quick health signal.
kube-bench run --json > current_audit.jsonSnapshots the current security posture to a JSON file for documentation and comparison.
Hunts for security weaknesses in Kubernetes clusters from inside or outside, reporting exposed components and known issues. Archived upstream but still informative.
The Kubernetes command line: inspect and manage clusters, workloads, RBAC and secrets — and check what an identity is allowed to do.
A script that checks a Docker host against dozens of CIS Docker Benchmark best practices for production deployments.