1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2025-07-16 11:38:24 +00:00
The Kubernetes Bench for Security is a Go application that checks whether Kubernetes is deployed according to security best practices.
Go to file
dependabot[bot] a686691252
build(deps): bump k8s.io/apimachinery from 0.32.2 to 0.32.3 (#1834)
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.32.2 to 0.32.3.
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.32.2...v0.32.3)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 16:55:05 +06:00
.github ci: bump up Go version to 1.23.6 in Github workflows (#1801) 2025-02-12 20:13:43 +06:00
cfg fix: typo of applicaions which should have been applications (#1819) 2025-03-04 12:27:13 +06:00
check chore: bump up Go version to 1.23.4 (#1776) 2025-01-15 23:02:16 +06:00
cmd fix: Add default case to CIS benchmark version selection (#1823) 2025-03-05 13:43:06 +06:00
docs Updated version in documentation and using a version var (#1799) 2025-02-12 12:15:11 +06:00
hack Adding eks-stig-kubernetes-v1r6 (#1266) 2022-09-14 17:40:48 +03:00
helper_scripts FIX| RKE-CIS-1.24- CHECK 1.1.19 (#1722) 2024-11-15 18:32:24 +06:00
hooks
integration/testdata fix: typo of applicaions which should have been applications (#1819) 2025-03-04 12:27:13 +06:00
internal/findings Fix issue 1595: failed to output to ASFF (#1691) 2024-09-28 13:36:44 +06:00
.gitignore
.golangci.yaml chore: bump up Go version to 1.23.4 (#1776) 2025-01-15 23:02:16 +06:00
.goreleaser.yml VEX related improvements in the build process (#1768) 2025-01-13 10:18:02 +06:00
.yamllint.yaml
codecov.yml
CONTRIBUTING.md Adding eks-stig-kubernetes-v1r6 (#1266) 2022-09-14 17:40:48 +03:00
Dockerfile build(deps): bump golang from 1.23.6 to 1.24.0 (#1805) 2025-03-11 12:14:58 +06:00
Dockerfile.fips.ubi build(deps): bump golang from 1.23.6 to 1.24.0 (#1805) 2025-03-11 12:14:58 +06:00
Dockerfile.ubi build(deps): bump golang from 1.23.6 to 1.24.0 (#1805) 2025-03-11 12:14:58 +06:00
entrypoint.sh
fipsonly.go chore: add fips compliant images (#1473) 2023-07-24 10:02:19 +03:00
go.mod build(deps): bump k8s.io/apimachinery from 0.32.2 to 0.32.3 (#1834) 2025-03-18 16:55:05 +06:00
go.sum build(deps): bump k8s.io/apimachinery from 0.32.2 to 0.32.3 (#1834) 2025-03-18 16:55:05 +06:00
job-ack.yaml
job-aks.yaml
job-eks-asff.yaml support CIS Amazon Elastic Kubernetes Service (EKS) Benchmark v1.2.0 (#1449) 2023-05-21 17:53:58 +03:00
job-eks-stig.yaml Adding eks-stig-kubernetes-v1r6 (#1266) 2022-09-14 17:40:48 +03:00
job-eks.yaml feat: CIS EKS 1.5.0 (#1653) 2025-01-10 15:18:50 +06:00
job-gke.yaml
job-iks.yaml
job-master.yaml job.yaml: Adding /var/lib/cni mounts for proper CIS 1.1.9 and 1.1.0 checking (#1547) 2024-02-11 11:23:17 +02:00
job-node.yaml job.yaml: Adding /var/lib/cni mounts for proper CIS 1.1.9 and 1.1.0 checking (#1547) 2024-02-11 11:23:17 +02:00
job-tkgi.yaml add support VMware Tanzu(TKGI) Benchmarks v1.2.53 (#1452) 2023-06-01 16:37:50 +03:00
job.yaml release: prepare v0.10.4 (#1829) 2025-03-11 22:33:47 +06:00
LICENSE
main.go
makefile fix: address vulnerabilities in kubectl (#1828) 2025-03-11 18:06:25 +06:00
mkdocs.yml
NOTICE
OWNERS
README.md updates to the readme 2023-10-02 12:39:24 +03:00

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

kube-bench logo

kube-bench is a 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

CIS Scanning as part of Trivy and the Trivy Operator

Trivy, the all in one cloud native security scanner, can be deployed as a Kubernetes Operator inside a cluster. Both, the Trivy CLI, and the Trivy Operator support CIS Kubernetes Benchmark scanning among several other features.

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.