Follow the below steps to execute kube-bench on a VKS Cluster:
Login to a Guest Cluster controlplane/worker node as vmware-system-user. Reference KB: Accessing vSphere with Tanzu workload clusters using SSH
Run the command: sudo -i
Create a new directory: mkdir /home/kube-bench
Run the curl command to download the kube-bench.tar: curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.13.0/kube-bench_0.13.0_linux_amd64.tar.gz -o /home/kube-bench/kube-bench.tar
Untar the file:tar -xvf /home/kube-bench/kube-bench.tar -C /home/kube-bench
Move the file to /usr/local/bin: sudo mv /home/kube-bench/kube-bench /usr/local/bin/
Execute kube-bench and redirect the output to a file:sudo kube-bench --config-dir /home/kube-bench/cfg --config /home/kube-bench/cfg/config.yaml > kube-bench.report
Validate the kube-bench.report file.