Fails generated by Kubernetes Bench for Security

9/19/2019

I run Kubernetes Bench for Security on my VM and I get a lot of fails: I checked every fail to my config file and code file and there are all set right. So I think it is a config setting wrong set which causes all the fails

1.1.6 Ensure that the --insecure-port argument is set to 0 (Scored)
1.1.8 Ensure that the --profiling argument is set to false (Scored)
1.1.9 Ensure that the --repair-malformed-updates argument is set to false (Scored)
1.1.11 Ensure that the admission control plugin AlwaysPullImages is set (Scored)
1.1.15 Ensure that the --audit-log-path argument is set as appropriate (Scored)
1.1.16 Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Scored)
1.1.17 Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Scored)
1.1.18 Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Scored)
1.1.21 Ensure that the --kubelet-certificate-authority argument is set as appropriate (Scored)
1.1.24 Ensure that the admission control plugin PodSecurityPolicy is set (Scored)
1.1.27 Ensure that the admission control plugin ServiceAccount is set(Scored)
1.1.36 Ensure that the admission control plugin EventRateLimit is set (Scored)
1.2.1 Ensure that the --profiling argument is set to false (Scored)
1.3.1 Ensure that the --terminated-pod-gc-threshold argument is set as appropriate (Scored)
1.3.2 Ensure that the --profiling argument is set to false (Scored)
1.3.6 Ensure that the RotateKubeletServerCertificate argument is set to true (Scored)
1.4.12 Ensure that the etcd data directory ownership is set to etcd:etcd (Scored)

== Summary ==
47 checks PASS
17 checks FAIL
26 checks WARN
1 checks INFO


[FAIL] 2.1.1 Ensure that the --anonymous-auth argument is set to false (Scored)
[FAIL] 2.1.2 Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored)
[FAIL] 2.1.3 Ensure that the --client-ca-file argument is set as appropriate (Scored)
[FAIL] 2.1.4 Ensure that the --read-only-port argument is set to 0 (Scored)
[FAIL] 2.1.6 Ensure that the --protect-kernel-defaults argument is set to true (Scored)
[FAIL] 2.1.9 Ensure that the --event-qps argument is set to 0 (Scored)
[FAIL] 2.1.10 Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Scored)
[FAIL] 2.1.13 Ensure that the RotateKubeletServerCertificate argument is set to true (Scored)
[FAIL] 2.2.3 Ensure that the kubelet service file permissions are set to 644 or more restrictive (Scored)
[FAIL] 2.2.4 Ensure that the kubelet service file ownership is set to root:root (Scored)
[FAIL] 2.2.5 Ensure that the proxy kubeconfig file permissions are set to 644 or more restrictive (Scored)
[FAIL] 2.2.6 Ensure that the proxy kubeconfig file ownership is set to root:root (Scored)

== Summary ==
9 checks PASS
12 checks FAIL
2 checks WARN
1 checks INFO

I checked every fail and everything is ok on the code. Also I checked the cfg/config.yaml and it seems ok:

confs:
- "/var/lib/kubelet/config.yaml"
- "/etc/kubernetes/kubelet/kubelet-config.json"
- "/home/kubernetes/kubelet-config.yaml"
- "/etc/default/kubelet"
- "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
- "/etc/systemd/system/kubelet.service"
- "/lib/systemd/system/kubelet.service"
defaultconf: "/var/lib/kubelet/config.yaml"
defaultsvc: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
defaultkubeconfig: "/etc/kubernetes/kubelet.conf"
defaultcafile: "/etc/kubernetes/pki/ca.crt"

stat -c %a /etc/kubernetes/manifests/kube-controller-manager.yaml
600

Could you help with some ideas?

Thanks!

-- Dragos Dragomir
cluster-computing
kubernetes
security

0 Answers