The Kubernetes Bench for Security is a Go application that checks whether Kubernetes is deployed according to security best practices.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
Yoav Rotem fdf0bbd960
Fixing typos (#899)
3 years ago
.github mkdocs support and update docs (#884) 3 years ago
cfg Allow kube-bench to scan Bottlerocket OS (#889) 3 years ago
check Add detected kubernetes version (#869) 3 years ago
cmd Support CIS ACK 1.0.0 benchmark (#841) 3 years ago
docs mkdocs support and update docs (#884) 3 years ago
hack retire cis 1.3 and 1.4 (#693) 4 years ago
hooks adds kube-bench version to docker build hook (#524) 5 years ago
integration Fix test request timeout (#874) 3 years ago
internal/findings Aws asff (#770) 4 years ago
.gitignore Added .DS_Store and thumbs.db to .gitignore (#463) 5 years ago
.goreleaser.yml Fix issue with missing 'Maintainer' field (#875) 3 years ago
.yamllint.yaml Support Linting YAML as part of Travis CI build (#554) 4 years ago
CONTRIBUTING.md mkdocs support and update docs (#884) 3 years ago
Dockerfile upgrade base image versions in Dockerfile (#831) 3 years ago
LICENSE Initial commit 7 years ago
NOTICE Create NOTICE (#199) 5 years ago
OWNERS Create OWNERS 7 years ago
README.md mkdocs support and update docs (#884) 3 years ago
codecov.yml Improve Proxykubeconfig tests (#708) 4 years ago
entrypoint.sh Set -e to fail fast 6 years ago
go.mod Refactor group skip (#783) 3 years ago
go.sum Aws asff (#770) 4 years ago
job-ack.yaml Support CIS ACK 1.0.0 benchmark (#841) 3 years ago
job-aks.yaml cfg: add `/etc/default/kubeletconfig.json` for AKS (#865) 3 years ago
job-eks-asff.yaml Refactor of EKS and ASFF integration Job and instructions (#794) 3 years ago
job-eks.yaml Refactor of EKS and ASFF integration Job and instructions (#794) 3 years ago
job-gke.yaml CIS GKE 1.0.0 benchmark (#570) 4 years ago
job-iks.yaml Set all host-mounted volumes to be read-only. (#569) 4 years ago
job-master.yaml mount /etc/passwd and /etc/group for etcd ownership related checks (#868) 3 years ago
job-node.yaml Fix file permissions false positive (#800) 3 years ago
job.yaml Fix file permissions false positive (#800) 3 years ago
main.go Fix issue #16 about supporting verbosity. 7 years ago
makefile Fix go vet issues (#720) 4 years ago
mkdocs.yml Fixing typos (#899) 3 years ago

README.md

GitHub Release Downloads Docker Pulls Go Report Card Build Status License Docker image Source commit Coverage Status

kube-bench logo

kube-bench is tool that checks whether Kubernetes is deployed securely by running the checks documented in the CIS Kubernetes Benchmark.

Tests are configured with YAML files, making this tool easy to update as test specifications evolve.

Kubernetes Bench for Security

Quick start

There are multiple ways to run kube-bench. You can run kube-bench inside a pod, but it will need access to the host's PID namespace in order to check the running processes, as well as access to some directories on the host where config files and other files are stored.

The supplied job.yaml file can be applied to run the tests as a job. For example:

$ kubectl apply -f job.yaml
job.batch/kube-bench created

$ kubectl get pods
NAME                      READY   STATUS              RESTARTS   AGE
kube-bench-j76s9   0/1     ContainerCreating   0          3s

# Wait for a few seconds for the job to complete
$ kubectl get pods
NAME                      READY   STATUS      RESTARTS   AGE
kube-bench-j76s9   0/1     Completed   0          11s

# The results are held in the pod's logs
kubectl logs kube-bench-j76s9
[INFO] 1 Master Node Security Configuration
[INFO] 1.1 API Server
...

For more information and different ways to run kube-bench see documentation

Please Note

  1. kube-bench implements the CIS Kubernetes Benchmark as closely as possible. Please raise issues here if kube-bench is not correctly implementing the test as described in the Benchmark. To report issues in the Benchmark itself (for example, tests that you believe are inappropriate), please join the CIS community.

  2. There is not a one-to-one mapping between releases of Kubernetes and releases of the CIS benchmark. See CIS Kubernetes Benchmark support to see which releases of Kubernetes are covered by different releases of the benchmark.

By default, kube-bench will determine the test set to run based on the Kubernetes version running on the machine.

Contributing

Kindly read Contributing before contributing. We welcome PRs and issue reports.

Roadmap

Going forward we plan to release updates to kube-bench to add support for new releases of the CIS Benchmark. Note that these are not released as frequently as Kubernetes releases.