Kube-bench - A tool for checking if Kubernetes clusters meet security requirements and best practices based on the CIS benchmarks. https://github.com/aquasecurity/kube-bench
Kube-bench is a Go application that checks whether Kubernetes is deployed securely by running the checks documented in the CIS Kubernetes Benchmark. The CIS Kubernetes Benchmark is a set of best practices for securely configuring Kubernetes clusters. It is developed and maintained by the Center for Internet Security (CIS). Kube-bench automates the process of checking your Kubernetes cluster against the CIS Benchmark, making it easier to identify and fix security vulnerabilities.
Kube-bench is primarily a command-line tool. It also provides the ability to run checks using a Docker container. Here are some examples:
1. **Running Kube-bench on a master node:**
```bash kube-bench –version 1.23 ```
This command runs the CIS Kubernetes Benchmark checks for version 1.23 on the master node of your cluster.
2. **Running Kube-bench on a worker node:**
```bash kube-bench –version 1.23 –node ```
This command runs the CIS Kubernetes Benchmark checks for version 1.23, specifically for worker nodes.
3. **Running Kube-bench using Docker:**
```bash docker run –rm -v /etc:/host/etc:ro \
-v $(which kubectl):/usr/local/mount-from-host/bin/kubectl:ro \ aquasec/kube-bench:latest --version 1.23```
This command runs Kube-bench within a Docker container, mounting the necessary host directories for access to configuration files and the kubectl binary.