How to run kube-bench in my cluster?

First, you have to exec in Deckhouse Pod:

kubectl -n d8-system exec -ti deploy/deckhouse -- bash

Then you have to select which node you want to run kube-bench.

  • Run on random node:
    curl -s | kubectl create -f -
  • Run on specific node, e.g. control-plane node:
    curl -s | yq r - -j | jq '.spec.template.spec.tolerations=[{"operator": "Exists"}] | .spec.template.spec.nodeSelector={"": ""}' | kubectl create -f -

Then you can check report:

kubectl logs job.batch/kube-bench