kubebench

by joaquinito2051

Helm chartv1.0.5App 1.0

A helm chart to run kube-bench regularly and export any findings as a datadog event.

About this chart

kubebench Helm Chart (Beta)

This chart installs a CronJob that will run kube-bench on a regular basis and upload the event to datadog.

** Note: This chart is still beta - proceed with caution! **

Configuration

ParameterDescriptionDefault
image.repositorykube-bench docker repoaquasec/kube-bench
image.tagkube-bench image tagv0.15.0
image.pullPolicypull policy for the kubebench imageAlways
cron.scheduleCron schedule to run kube-bench30 8 * * 1
exporter.image.repositorydocker repo for the exporter that exports the results to datadogquay.io/reactiveops/kubebench-exporter
exporter.image.tagexporter image tagv1.0
datadog.api_keydatadog api key for your accountfoo
datadog.app_keydatadog app key for your accountfoo
kubernetes.versionKubernetes version of your cluster. Note that only a few versions are supported by kube-bench. You can see the supported versions to use here. If your version isn't defined set it to the closest version available.1.11
skipped_checkslist of check ids that shoudl be ignored in scoring.see values.yml

Datadog

The following is an example monitor definition that can be used to monitor the audit events emitted from this chart.

{
	"name": "Kubebench - Audit Failure",
	"type": "event alert",
	"query": "events('priority:all status:error \"kubebench\"').rollup('count').last('5m') > 0",
	"message": "Kubebench Audit Failures!\nEvent Id: {{event.id}} \n\n{{event.text}} \n@slack-alerts ",
	"tags": [],
	"options": {
		"renotify_interval": 0,
		"timeout_h": 0,
		"thresholds": {},
		"notify_no_data": false,
		"no_data_timeframe": 2,
		"notify_audit": false
	}
}

Deploy kubebench with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubebench on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkubebench is pinned at v1.0.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply