2020-11-27 11:02:34,247 - xtesting.ci.run_tests - INFO - Deployment description: +-------------------------+-----------------------------------------------------------+ | ENV VAR | VALUE | +-------------------------+-----------------------------------------------------------+ | TEST_DB_EXT_URL | http://testresults.opnfv.org/test/api/v1/results | | S3_DST_URL | s3://artifacts.opnfv.org/functest- | | | kubernetes/1VXXZ36663JI/functest-kubernetes-pi- | | | ollivier-functest-kubernetes-security-arm-hunter- | | | kube_bench_master-run-11 | | S3_ENDPOINT_URL | https://storage.googleapis.com | | DEPLOY_SCENARIO | k8-nosdn-nofeature-noha | | BUILD_TAG | 1VXXZ36663JI | | DEBUG | true | | INSTALLER_TYPE | unknown | | CI_LOOP | daily | | TEST_DB_URL | http://testresults.opnfv.org/test/api/v1/results | | HTTP_DST_URL | http://artifacts.opnfv.org/functest- | | | kubernetes/1VXXZ36663JI/functest-kubernetes-pi- | | | ollivier-functest-kubernetes-security-arm-hunter- | | | kube_bench_master-run-11 | | NODE_NAME | lf-virtual1-1 | +-------------------------+-----------------------------------------------------------+ 2020-11-27 11:02:34,391 - xtesting.ci.run_tests - INFO - Loading test case 'kube_bench_master'... 2020-11-27 11:02:35,528 - xtesting.ci.run_tests - INFO - Running test case 'kube_bench_master'... 2020-11-27 11:02:35,923 - functest_kubernetes.security.security - INFO - Job kube-bench-master created 2020-11-27 11:02:41,265 - functest_kubernetes.security.security - INFO - kube-bench-master started in 5.74 sec 2020-11-27 11:02:41,754 - functest_kubernetes.security.security - INFO - [{u'tests': [{u'info': 1, u'section': u'1.1', u'results': [{u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'WARN', u'scored': False, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--anonymous-auth=false\n'], u'test_desc': u'Ensure that the --anonymous-auth argument is set to false (Not Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--anonymous-auth=false\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.1'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the documentation and configure alternate mechanisms for authentication. Then,\nedit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --basic-auth-file=\nparameter.\n'], u'test_desc': u'Ensure that the --basic-auth-file argument is not set (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the documentation and configure alternate mechanisms for authentication. Then,\nedit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --basic-auth-file=\nparameter.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--basic-auth-file' is not present", u'type': u'', u'test_number': u'1.1.2'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --insecure-allow-any-token\nparameter.\n'], u'test_desc': u'Ensure that the --insecure-allow-any-token argument is not set (Not Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --insecure-allow-any-token\nparameter.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--insecure-allow-any-token' is not present", u'type': u'', u'test_number': u'1.1.3'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --kubelet-https parameter.\n'], u'test_desc': u'Ensure that the --kubelet-https argument is set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --kubelet-https parameter.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--kubelet-https' is present OR '--kubelet-https' is not present", u'type': u'', u'test_number': u'1.1.4'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --insecure-bind-address\nparameter.\n'], u'test_desc': u'Ensure that the --insecure-bind-address argument is not set (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --insecure-bind-address\nparameter.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--insecure-bind-address' is not present", u'type': u'', u'test_number': u'1.1.5'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\napiserver.yaml on the master node and set the below parameter.\n--insecure-port=0\n'], u'test_desc': u'Ensure that the --insecure-port argument is set to 0 (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\napiserver.yaml on the master node and set the below parameter.\n--insecure-port=0\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'0' is equal to '0'", u'type': u'', u'test_number': u'1.1.6'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and either remove the --secure-port parameter or\nset it to a different (non-zero) desired port.\n'], u'test_desc': u'Ensure that the --secure-port argument is not set to 0 (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and either remove the --secure-port parameter or\nset it to a different (non-zero) desired port.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"6443 is greater than 0 OR '--secure-port' is not present", u'type': u'', u'test_number': u'1.1.7'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--profiling=false\n'], u'test_desc': u'Ensure that the --profiling argument is set to false (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--profiling=false\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.8'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--repair-malformed-updates=false\n'], u'test_desc': u'Ensure that the --repair-malformed-updates argument is set to false (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--repair-malformed-updates=false\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.9'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that does not include AlwaysAdmit.\n'], u'test_desc': u'Ensure that the admission control plugin AlwaysAdmit is not set (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that does not include AlwaysAdmit.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u" 'NodeRestriction' not have 'AlwaysAdmit' OR '--enable-admission-plugins' is not present", u'type': u'', u'test_number': u'1.1.10'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins to\ninclude AlwaysPullImages.\n--enable-admission-plugins=...,AlwaysPullImages,...\n'], u'test_desc': u'Ensure that the admission control plugin AlwaysPullImages is set (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins to\ninclude AlwaysPullImages.\n--enable-admission-plugins=...,AlwaysPullImages,...\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.11'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'INFO', u'scored': False, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes DenyEscalatingExec.\n--enable-admission-plugins=...,DenyEscalatingExec,...\n'], u'test_desc': u'[DEPRECATED] Ensure that the admission control plugin DenyEscalatingExec is set (Not Scored)', u'reason': u'Test marked as skip', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes DenyEscalatingExec.\n--enable-admission-plugins=...,DenyEscalatingExec,...\n', u'actual_value': u'', u'expected_result': u'', u'type': u'skip', u'test_number': u'1.1.12'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'WARN', u'scored': False, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to\ninclude SecurityContextDeny.\n--enable-admission-plugins=...,SecurityContextDeny,...\n'], u'test_desc': u'Ensure that the admission control plugin SecurityContextDeny is set (Not Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to\ninclude SecurityContextDeny.\n--enable-admission-plugins=...,SecurityContextDeny,...\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.13'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --disable-admission-plugins parameter to\nensure it does not include NamespaceLifecycle.\n--disable-admission-plugins=...,NamespaceLifecycle,...\n'], u'test_desc': u'Ensure that the admission control plugin NamespaceLifecycle is set (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --disable-admission-plugins parameter to\nensure it does not include NamespaceLifecycle.\n--disable-admission-plugins=...,NamespaceLifecycle,...\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--disable-admission-plugins' is present OR '--disable-admission-plugins' is not present", u'type': u'', u'test_number': u'1.1.14'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-path parameter to a suitable\npath and file where you would like audit logs to be written, for example:\n--audit-log-path=/var/log/apiserver/audit.log\n'], u'test_desc': u'Ensure that the --audit-log-path argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-path parameter to a suitable\npath and file where you would like audit logs to be written, for example:\n--audit-log-path=/var/log/apiserver/audit.log\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.15'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-maxage parameter to 30 or\nas an appropriate number of days: --audit-log-maxage=30\n'], u'test_desc': u'Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-maxage parameter to 30 or\nas an appropriate number of days: --audit-log-maxage=30\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.16'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-maxbackup parameter to 10\nor to an appropriate value.\n--audit-log-maxbackup=10\n'], u'test_desc': u'Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-maxbackup parameter to 10\nor to an appropriate value.\n--audit-log-maxbackup=10\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.17'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-maxsize parameter to an\nappropriate size in MB. For example, to set it as 100 MB:\n--audit-log-maxsize=100\n'], u'test_desc': u'Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --audit-log-maxsize parameter to an\nappropriate size in MB. For example, to set it as 100 MB:\n--audit-log-maxsize=100\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.18'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --authorization-mode parameter to\nvalues other than AlwaysAllow. One such example could be as below.\n--authorization-mode=RBAC\n'], u'test_desc': u'Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --authorization-mode parameter to\nvalues other than AlwaysAllow. One such example could be as below.\n--authorization-mode=RBAC\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u" 'Node,RBAC' not have 'AlwaysAllow'", u'type': u'', u'test_number': u'1.1.19'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the documentation and configure alternate mechanisms for authentication. Then,\nedit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --token-auth-file=\nparameter.\n'], u'test_desc': u'Ensure that the --token-auth-file parameter is not set (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the documentation and configure alternate mechanisms for authentication. Then,\nedit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --token-auth-file=\nparameter.\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--token-auth-file' is not present", u'type': u'', u'test_number': u'1.1.20'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and setup the TLS connection between the\napiserver and kubelets. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --kubelet-certificate-authority\nparameter to the path to the cert file for the certificate authority.\n--kubelet-certificate-authority=\n'], u'test_desc': u'Ensure that the --kubelet-certificate-authority argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and setup the TLS connection between the\napiserver and kubelets. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --kubelet-certificate-authority\nparameter to the path to the cert file for the certificate authority.\n--kubelet-certificate-authority=\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.21'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set up the TLS connection between the\napiserver and kubelets. Then, edit API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the\nkubelet client certificate and key parameters as below.\n--kubelet-client-certificate=\n--kubelet-client-key=\n'], u'test_desc': u'Ensure that the --kubelet-client-certificate and --kubelet-client-key arguments are set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set up the TLS connection between the\napiserver and kubelets. Then, edit API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the\nkubelet client certificate and key parameters as below.\n--kubelet-client-certificate=\n--kubelet-client-key=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--kubelet-client-certificate' is present AND '--kubelet-client-key' is present", u'type': u'', u'test_number': u'1.1.22'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--service-account-lookup=true\n'], u'test_desc': u'Ensure that the --service-account-lookup argument is set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--service-account-lookup=true\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--service-account-lookup' is not present OR '--service-account-lookup' is present", u'type': u'', u'test_number': u'1.1.23'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Follow the documentation and create Pod Security Policy objects as per your environment.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes PodSecurityPolicy :\n--enable-admission-plugins=...,PodSecurityPolicy,...\nThen restart the API Server.\n'], u'test_desc': u'Ensure that the admission control plugin PodSecurityPolicy is set (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the documentation and create Pod Security Policy objects as per your environment.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes PodSecurityPolicy :\n--enable-admission-plugins=...,PodSecurityPolicy,...\nThen restart the API Server.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.24'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --service-account-key-file parameter\nto the public key file for service accounts:\n--service-account-key-file=\n'], u'test_desc': u'Ensure that the --service-account-key-file argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --service-account-key-file parameter\nto the public key file for service accounts:\n--service-account-key-file=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--service-account-key-file' is present", u'type': u'', u'test_number': u'1.1.25'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set up the TLS connection between the\napiserver and etcd. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the etcd\ncertificate and key file parameters.\n--etcd-certfile=\n--etcd-keyfile=\n'], u'test_desc': u'Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set up the TLS connection between the\napiserver and etcd. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the etcd\ncertificate and key file parameters.\n--etcd-certfile=\n--etcd-keyfile=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--etcd-certfile' is present AND '--etcd-keyfile' is present", u'type': u'', u'test_number': u'1.1.26'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the documentation and create ServiceAccount objects as per your environment.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes ServiceAccount.\n--enable-admission-plugins=...,ServiceAccount,...\n'], u'test_desc': u'Ensure that the admission control plugin ServiceAccount is set(Scored)', u'AuditConfig': u'', u'remediation': u'Follow the documentation and create ServiceAccount objects as per your environment.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes ServiceAccount.\n--enable-admission-plugins=...,ServiceAccount,...\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--disable-admission-plugins' is present OR '--disable-admission-plugins' is not present", u'type': u'', u'test_number': u'1.1.27'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set up the TLS connection on the apiserver.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the TLS certificate and private key file\nparameters.\n--tls-cert-file=\n--tls-private-key-file=\n'], u'test_desc': u'Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set up the TLS connection on the apiserver.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the TLS certificate and private key file\nparameters.\n--tls-cert-file=\n--tls-private-key-file=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--tls-cert-file' is present AND '--tls-private-key-file' is present", u'type': u'', u'test_number': u'1.1.28'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set up the TLS connection on the apiserver.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the client certificate authority file.\n--client-ca-file=\n'], u'test_desc': u'Ensure that the --client-ca-file argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set up the TLS connection on the apiserver.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the client certificate authority file.\n--client-ca-file=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--client-ca-file' is present", u'type': u'', u'test_number': u'1.1.29'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set up the TLS connection between the\napiserver and etcd. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the etcd\ncertificate authority file parameter.\n--etcd-cafile=\n'], u'test_desc': u'Ensure that the --etcd-cafile argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set up the TLS connection between the\napiserver and etcd. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the etcd\ncertificate authority file parameter.\n--etcd-cafile=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--etcd-cafile' is present", u'type': u'', u'test_number': u'1.1.30'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'WARN', u'scored': False, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256\n'], u'test_desc': u'Ensure that the API Server only makes use of Strong Cryptographic Ciphers (Not Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.31'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --authorization-mode parameter to a\nvalue that includes Node.\n--authorization-mode=Node,RBAC\n'], u'test_desc': u'Ensure that the --authorization-mode argument is set to Node (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --authorization-mode parameter to a\nvalue that includes Node.\n--authorization-mode=Node,RBAC\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'Node,RBAC' has 'Node'", u'type': u'', u'test_number': u'1.1.32'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and configure NodeRestriction plug-in on\nkubelets. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes NodeRestriction.\n--enable-admission-plugins=...,NodeRestriction,...\n'], u'test_desc': u'Ensure that the admission control plugin NodeRestriction is set (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and configure NodeRestriction plug-in on\nkubelets. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --enable-admission-plugins parameter to a\nvalue that includes NodeRestriction.\n--enable-admission-plugins=...,NodeRestriction,...\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'NodeRestriction' has 'NodeRestriction'", u'type': u'', u'test_number': u'1.1.33'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'[Manual test]\nFollow the Kubernetes documentation and configure a EncryptionConfig file.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the\nmaster node and set the --encryption-provider-config parameter\nto the path of that file:\n--encryption-provider-config=\n'], u'test_desc': u'Ensure that the --encryption-provider-config argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the Kubernetes documentation and configure a EncryptionConfig file.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the\nmaster node and set the --encryption-provider-config parameter\nto the path of that file:\n--encryption-provider-config=\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.34'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'WARN', u'scored': True, u'test_info': [u'[Manual test]\nFollow the Kubernetes documentation and configure a EncryptionConfig file. In this file,\nchoose aescbc as the encryption provider.\nFor example,\nkind: EncryptionConfig\napiVersion: v1\nresources:\n - resources:\n - secrets\n providers:\n - aescbc:\n keys:\n - name: key1\n secret: <32-byte base64-encoded secret>\n'], u'test_desc': u'Ensure that the encryption provider is set to aescbc (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the Kubernetes documentation and configure a EncryptionConfig file. In this file,\nchoose aescbc as the encryption provider.\nFor example,\nkind: EncryptionConfig\napiVersion: v1\nresources:\n - resources:\n - secrets\n providers:\n - aescbc:\n keys:\n - name: key1\n secret: <32-byte base64-encoded secret>\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.1.35'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set the desired limits in a\nconfiguration file. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml and set the below parameters.\n--enable-admission-plugins=...,EventRateLimit,...\n--admission-control-config-file=\n'], u'test_desc': u'Ensure that the admission control plugin EventRateLimit is set (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set the desired limits in a\nconfiguration file. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml and set the below parameters.\n--enable-admission-plugins=...,EventRateLimit,...\n--admission-control-config-file=\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.36'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set the desired audit policy in the\n/etc/kubernetes/audit-policy.yaml file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameters.\n--audit-policy-file=/etc/kubernetes/audit-policy.yaml\n'], u'test_desc': u'Ensure that the AdvancedAuditing argument is not set to false (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set the desired audit policy in the\n/etc/kubernetes/audit-policy.yaml file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameters.\n--audit-policy-file=/etc/kubernetes/audit-policy.yaml\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--feature-gates' is present OR '--feature-gates' is not present", u'type': u'', u'test_number': u'1.1.37a'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Follow the Kubernetes documentation and set the desired audit policy in the\n/etc/kubernetes/audit-policy.yaml file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameters.\n--audit-policy-file=/etc/kubernetes/audit-policy.yaml\n'], u'test_desc': u'Ensure that the AdvancedAuditing argument is not set to false (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the Kubernetes documentation and set the desired audit policy in the\n/etc/kubernetes/audit-policy.yaml file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameters.\n--audit-policy-file=/etc/kubernetes/audit-policy.yaml\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.1.37b'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameter as appropriate and if needed. For example,\n--request-timeout=300s\n'], u'test_desc': u'Ensure that the --request-timeout argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameter as appropriate and if needed. For example,\n--request-timeout=300s\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'--request-timeout' is not present OR '--request-timeout' is present", u'type': u'', u'test_number': u'1.1.38'}, {u'audit': u'/bin/ps -ef | grep kube-apiserver | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the API server pod specification file kube-apiserver on the master node and set the --authorization-mode parameter to a value that includes RBAC, for example: --authorization-mode=Node,RBAC\n'], u'test_desc': u'Ensure that the --authorization-mode argument includes RBAC (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the API server pod specification file kube-apiserver on the master node and set the --authorization-mode parameter to a value that includes RBAC, for example: --authorization-mode=Node,RBAC\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', u'expected_result': u"'Node,RBAC' has 'RBAC'", u'type': u'', u'test_number': u'1.1.39'}], u'warn': 4, u'pass': 23, u'fail': 12, u'desc': u'API Server'}, {u'info': 0, u'section': u'1.2', u'results': [{u'audit': u'/bin/ps -ef | grep kube-scheduler | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml\nfile on the master node and set the below parameter.\n--profiling=false\n'], u'test_desc': u'Ensure that the --profiling argument is set to false (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml\nfile on the master node and set the below parameter.\n--profiling=false\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.2.1'}, {u'audit': u'/bin/ps -ef | grep kube-scheduler | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml\nfile on the master node and ensure the correct value for the\n--address parameter.\n'], u'test_desc': u'Ensure that the --address argument is set to 127.0.0.1 (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml\nfile on the master node and ensure the correct value for the\n--address parameter.\n', u'actual_value': u'root 3536472 679 1 Nov26 ? 00:14:19 kube-scheduler --address=127.0.0.1 --kubeconfig=/etc/kubernetes/scheduler.conf --leader-elect=true\n', u'expected_result': u"'127.0.0.1' is equal to '127.0.0.1' OR '--address' is not present", u'type': u'', u'test_number': u'1.2.2'}], u'warn': 0, u'pass': 1, u'fail': 1, u'desc': u'Scheduler'}, {u'info': 0, u'section': u'1.3', u'results': [{u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --terminated-pod-gc-threshold to an appropriate threshold, for example:\n--terminated-pod-gc-threshold=10\n'], u'test_desc': u'Ensure that the --terminated-pod-gc-threshold argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --terminated-pod-gc-threshold to an appropriate threshold, for example:\n--terminated-pod-gc-threshold=10\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.3.1'}, {u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the below parameter.\n--profiling=false\n'], u'test_desc': u'Ensure that the --profiling argument is set to false (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the below parameter.\n--profiling=false\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.3.2'}, {u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node to set the below parameter.\n--use-service-account-credentials=true\n'], u'test_desc': u'Ensure that the --use-service-account-credentials argument is set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node to set the below parameter.\n--use-service-account-credentials=true\n', u'actual_value': u'root 3536478 653 5 Nov26 ? 01:02:21 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --node-cidr-mask-size=24 --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/sa.key --use-service-account-credentials=true\n', u'expected_result': u"'true' is not equal to 'false'", u'type': u'', u'test_number': u'1.3.3'}, {u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --service-account-private-\nkey-file parameter to the private key file for service accounts.\n--service-account-private-key-file=\n'], u'test_desc': u'Ensure that the --service-account-private-key-file argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --service-account-private-\nkey-file parameter to the private key file for service accounts.\n--service-account-private-key-file=\n', u'actual_value': u'root 3536478 653 5 Nov26 ? 01:02:21 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --node-cidr-mask-size=24 --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/sa.key --use-service-account-credentials=true\n', u'expected_result': u"'--service-account-private-key-file' is present", u'type': u'', u'test_number': u'1.3.4'}, {u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --root-ca-file parameter to\nthe certificate bundle file.\n--root-ca-file=\n'], u'test_desc': u'Ensure that the --root-ca-file argument is set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --root-ca-file parameter to\nthe certificate bundle file.\n--root-ca-file=\n', u'actual_value': u'root 3536478 653 5 Nov26 ? 01:02:21 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --node-cidr-mask-size=24 --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/sa.key --use-service-account-credentials=true\n', u'expected_result': u"'--root-ca-file' is present", u'type': u'', u'test_number': u'1.3.5'}, {u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'FAIL', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\ncontroller-manager.yaml on the master node and set the --feature-gates parameter to\ninclude RotateKubeletServerCertificate=true.\n--feature-gates=RotateKubeletServerCertificate=true\n'], u'test_desc': u'Ensure that the RotateKubeletServerCertificate argument is set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\ncontroller-manager.yaml on the master node and set the --feature-gates parameter to\ninclude RotateKubeletServerCertificate=true.\n--feature-gates=RotateKubeletServerCertificate=true\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.3.6'}, {u'audit': u'/bin/ps -ef | grep kube-controller | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\ncontroller-manager.yaml on the master node and ensure the correct value\nfor the --address parameter.\n'], u'test_desc': u'Ensure that the --address argument is set to 127.0.0.1 (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\ncontroller-manager.yaml on the master node and ensure the correct value\nfor the --address parameter.\n', u'actual_value': u'root 3536478 653 5 Nov26 ? 01:02:21 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --node-cidr-mask-size=24 --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/sa.key --use-service-account-credentials=true\n', u'expected_result': u"'127.0.0.1' is equal to '127.0.0.1' OR '--address' is not present", u'type': u'', u'test_number': u'1.3.7'}], u'warn': 0, u'pass': 4, u'fail': 3, u'desc': u'Controller Manager'}, {u'info': 0, u'section': u'1.4', u'results': [{u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-apiserver.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/kube-apiserver.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/kube-apiserver.yaml\n'], u'test_desc': u'Ensure that the API server pod specification file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/kube-apiserver.yaml\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.1'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-apiserver.yaml; then stat -c %U:%G /etc/kubernetes/manifests/kube-apiserver.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/kube-apiserver.yaml\n'], u'test_desc': u'Ensure that the API server pod specification file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/kube-apiserver.yaml\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.2'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-controller-manager.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/kube-controller-manager.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/kube-controller-manager.yaml\n'], u'test_desc': u'Ensure that the controller manager pod specification file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/kube-controller-manager.yaml\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.3'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-controller-manager.yaml; then stat -c %U:%G /etc/kubernetes/manifests/kube-controller-manager.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/kube-controller-manager.yaml\n'], u'test_desc': u'Ensure that the controller manager pod specification file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/kube-controller-manager.yaml\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.4'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-scheduler.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/kube-scheduler.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/kube-scheduler.yaml\n'], u'test_desc': u'Ensure that the scheduler pod specification file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/kube-scheduler.yaml\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.5'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-scheduler.yaml; then stat -c %U:%G /etc/kubernetes/manifests/kube-scheduler.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/kube-scheduler.yaml\n'], u'test_desc': u'Ensure that the scheduler pod specification file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/kube-scheduler.yaml\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.6'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/etcd.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/etcd.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/etcd.yaml\n'], u'test_desc': u'Ensure that the etcd pod specification file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/manifests/etcd.yaml\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.7'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/manifests/etcd.yaml; then stat -c %U:%G /etc/kubernetes/manifests/etcd.yaml; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/etcd.yaml\n'], u'test_desc': u'Ensure that the etcd pod specification file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/manifests/etcd.yaml\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.8'}, {u'audit': u'stat -c permissions=%a ', u'status': u'WARN', u'scored': True, u'test_info': [u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 \n'], u'test_desc': u'Ensure that the Container Network Interface file permissions are set to 644 or more restrictive (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 \n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.4.9'}, {u'audit': u'stat -c %U:%G ', u'status': u'WARN', u'scored': True, u'test_info': [u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root \n'], u'test_desc': u'Ensure that the Container Network Interface file ownership is set to root:root (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root \n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.4.10'}, {u'audit': u"ps -ef | grep etcd | grep -- --data-dir | sed 's%.*data-dir[= ]\\([^ ]*\\).*%\\1%' | xargs stat -c permissions=%a", u'status': u'FAIL', u'scored': True, u'test_info': [u'On the etcd server node, get the etcd data directory, passed as an argument --data-dir ,\nfrom the below command:\nps -ef | grep etcd\nRun the below command (based on the etcd data directory found above). For example,\nchmod 700 /var/lib/etcd\n'], u'test_desc': u'Ensure that the etcd data directory permissions are set to 700 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'On the etcd server node, get the etcd data directory, passed as an argument --data-dir ,\nfrom the below command:\nps -ef | grep etcd\nRun the below command (based on the etcd data directory found above). For example,\nchmod 700 /var/lib/etcd\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.4.11'}, {u'audit': u"ps -ef | grep etcd | grep -- --data-dir | sed 's%.*data-dir[= ]\\([^ ]*\\).*%\\1%' | xargs stat -c %U:%G", u'status': u'FAIL', u'scored': True, u'test_info': [u'On the etcd server node, get the etcd data directory, passed as an argument --data-dir ,\nfrom the below command:\nps -ef | grep etcd\nRun the below command (based on the etcd data directory found above). For example,\nchown etcd:etcd /var/lib/etcd\n'], u'test_desc': u'Ensure that the etcd data directory ownership is set to etcd:etcd (Scored)', u'AuditConfig': u'', u'remediation': u'On the etcd server node, get the etcd data directory, passed as an argument --data-dir ,\nfrom the below command:\nps -ef | grep etcd\nRun the below command (based on the etcd data directory found above). For example,\nchown etcd:etcd /var/lib/etcd\n', u'actual_value': u'', u'expected_result': u'', u'type': u'', u'test_number': u'1.4.12'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/admin.conf; then stat -c permissions=%a /etc/kubernetes/admin.conf; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/admin.conf\n'], u'test_desc': u'Ensure that the admin.conf file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/admin.conf\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.13'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/admin.conf; then stat -c %U:%G /etc/kubernetes/admin.conf; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/admin.conf\n'], u'test_desc': u'Ensure that the admin.conf file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/admin.conf\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.14'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/scheduler.conf; then stat -c permissions=%a /etc/kubernetes/scheduler.conf; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chmod 644 /etc/kubernetes/scheduler.conf\n'], u'test_desc': u'Ensure that the scheduler.conf file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chmod 644 /etc/kubernetes/scheduler.conf\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.15'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/scheduler.conf; then stat -c %U:%G /etc/kubernetes/scheduler.conf; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chown root:root /etc/kubernetes/scheduler.conf\n'], u'test_desc': u'Ensure that the scheduler.conf file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chown root:root /etc/kubernetes/scheduler.conf\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.16'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/controller-manager.conf; then stat -c permissions=%a /etc/kubernetes/controller-manager.conf; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chmod 644 /etc/kubernetes/controller-manager.conf\n'], u'test_desc': u'Ensure that the controller-manager.conf file permissions are set to 644 or more restrictive (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chmod 644 /etc/kubernetes/controller-manager.conf\n', u'actual_value': u'permissions=600\n', u'expected_result': u"bitmask '600' AND '644'", u'type': u'', u'test_number': u'1.4.17'}, {u'audit': u"/bin/sh -c 'if test -e /etc/kubernetes/controller-manager.conf; then stat -c %U:%G /etc/kubernetes/controller-manager.conf; fi'", u'status': u'PASS', u'scored': True, u'test_info': [u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chown root:root /etc/kubernetes/controller-manager.conf\n'], u'test_desc': u'Ensure that the controller-manager.conf file ownership is set to root:root (Scored)', u'AuditConfig': u'', u'remediation': u'Run the below command (based on the file location on your system) on the\nmaster node. For example, chown root:root /etc/kubernetes/controller-manager.conf\n', u'actual_value': u'root:root\n', u'expected_result': u"'root:root' is equal to 'root:root'", u'type': u'', u'test_number': u'1.4.18'}, {u'audit': u'ls -laR /etc/kubernetes/pki/', u'status': u'WARN', u'scored': True, u'test_info': [u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example, chown -R root:root /etc/kubernetes/pki/\n'], u'test_desc': u'Ensure that the Kubernetes PKI directory and file ownership is set to root:root (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example, chown -R root:root /etc/kubernetes/pki/\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.4.19'}, {u'audit': u'stat -c %n %a /etc/kubernetes/pki/*.crt', u'status': u'WARN', u'scored': True, u'test_info': [u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example, chmod -R 644 /etc/kubernetes/pki/*.crt\n'], u'test_desc': u'Ensure that the Kubernetes PKI certificate file permissions are set to 644 or more restrictive (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example, chmod -R 644 /etc/kubernetes/pki/*.crt\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.4.20'}, {u'audit': u'stat -c %n %a /etc/kubernetes/pki/*.key', u'status': u'WARN', u'scored': True, u'test_info': [u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example, chmod -R 600 /etc/kubernetes/pki/*.key\n'], u'test_desc': u'Ensure that the Kubernetes PKI key file permissions are set to 600 or more restrictive (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nRun the below command (based on the file location on your system) on the master node.\nFor example, chmod -R 600 /etc/kubernetes/pki/*.key\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.4.21'}], u'warn': 5, u'pass': 14, u'fail': 2, u'desc': u'Configuration Files'}, {u'info': 0, u'section': u'1.5', u'results': [{u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the etcd service documentation and configure TLS encryption.\nThen, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the\nmaster node and set the below parameters.\n--ca-file=\n--key-file=\n'], u'test_desc': u'Ensure that the --cert-file and --key-file arguments are set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the etcd service documentation and configure TLS encryption.\nThen, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the\nmaster node and set the below parameters.\n--ca-file=\n--key-file=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\nroot 879 580 3 Sep23 ? 2-01:51:05 etcd --advertise-client-urls=https://172.18.0.2:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-peer-urls=https://172.18.0.2:2380 --initial-cluster=hunter-control-plane=https://172.18.0.2:2380 --key-file=/etc/kubernetes/pki/etcd/server.key --listen-client-urls=https://127.0.0.1:2379,https://172.18.0.2:2379 --listen-peer-urls=https://172.18.0.2:2380 --name=hunter-control-plane --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt --peer-client-cert-auth=true --peer-key-file=/etc/kubernetes/pki/etcd/peer.key --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt --snapshot-count=10000 --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt\n', u'expected_result': u"'--cert-file' is present AND '--key-file' is present", u'type': u'', u'test_number': u'1.5.1'}, {u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and set the below parameter.\n--client-cert-auth="true"\n'], u'test_desc': u'Ensure that the --client-cert-auth argument is set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and set the below parameter.\n--client-cert-auth="true"\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\nroot 879 580 3 Sep23 ? 2-01:51:05 etcd --advertise-client-urls=https://172.18.0.2:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-peer-urls=https://172.18.0.2:2380 --initial-cluster=hunter-control-plane=https://172.18.0.2:2380 --key-file=/etc/kubernetes/pki/etcd/server.key --listen-client-urls=https://127.0.0.1:2379,https://172.18.0.2:2379 --listen-peer-urls=https://172.18.0.2:2380 --name=hunter-control-plane --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt --peer-client-cert-auth=true --peer-key-file=/etc/kubernetes/pki/etcd/peer.key --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt --snapshot-count=10000 --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt\n', u'expected_result': u"'true' is equal to 'true'", u'type': u'', u'test_number': u'1.5.2'}, {u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and either remove the --auto-tls parameter or set it to false.\n --auto-tls=false\n'], u'test_desc': u'Ensure that the --auto-tls argument is not set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and either remove the --auto-tls parameter or set it to false.\n --auto-tls=false\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\nroot 879 580 3 Sep23 ? 2-01:51:05 etcd --advertise-client-urls=https://172.18.0.2:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-peer-urls=https://172.18.0.2:2380 --initial-cluster=hunter-control-plane=https://172.18.0.2:2380 --key-file=/etc/kubernetes/pki/etcd/server.key --listen-client-urls=https://127.0.0.1:2379,https://172.18.0.2:2379 --listen-peer-urls=https://172.18.0.2:2380 --name=hunter-control-plane --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt --peer-client-cert-auth=true --peer-key-file=/etc/kubernetes/pki/etcd/peer.key --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt --snapshot-count=10000 --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt\n', u'expected_result': u"'--auto-tls' is not present OR '--auto-tls' is not present", u'type': u'', u'test_number': u'1.5.3'}, {u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Follow the etcd service documentation and configure peer TLS encryption as appropriate\nfor your etcd cluster. Then, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the\nmaster node and set the below parameters.\n--peer-client-file=\n--peer-key-file=\n'], u'test_desc': u'Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate (Scored)', u'AuditConfig': u'', u'remediation': u'Follow the etcd service documentation and configure peer TLS encryption as appropriate\nfor your etcd cluster. Then, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the\nmaster node and set the below parameters.\n--peer-client-file=\n--peer-key-file=\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\nroot 879 580 3 Sep23 ? 2-01:51:05 etcd --advertise-client-urls=https://172.18.0.2:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-peer-urls=https://172.18.0.2:2380 --initial-cluster=hunter-control-plane=https://172.18.0.2:2380 --key-file=/etc/kubernetes/pki/etcd/server.key --listen-client-urls=https://127.0.0.1:2379,https://172.18.0.2:2379 --listen-peer-urls=https://172.18.0.2:2380 --name=hunter-control-plane --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt --peer-client-cert-auth=true --peer-key-file=/etc/kubernetes/pki/etcd/peer.key --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt --snapshot-count=10000 --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt\n', u'expected_result': u"'--peer-cert-file' is present AND '--peer-key-file' is present", u'type': u'', u'test_number': u'1.5.4'}, {u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and set the below parameter.\n--peer-client-cert-auth=true\n'], u'test_desc': u'Ensure that the --peer-client-cert-auth argument is set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and set the below parameter.\n--peer-client-cert-auth=true\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\nroot 879 580 3 Sep23 ? 2-01:51:05 etcd --advertise-client-urls=https://172.18.0.2:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-peer-urls=https://172.18.0.2:2380 --initial-cluster=hunter-control-plane=https://172.18.0.2:2380 --key-file=/etc/kubernetes/pki/etcd/server.key --listen-client-urls=https://127.0.0.1:2379,https://172.18.0.2:2379 --listen-peer-urls=https://172.18.0.2:2380 --name=hunter-control-plane --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt --peer-client-cert-auth=true --peer-key-file=/etc/kubernetes/pki/etcd/peer.key --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt --snapshot-count=10000 --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt\n', u'expected_result': u"'true' is equal to 'true'", u'type': u'', u'test_number': u'1.5.5'}, {u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'PASS', u'scored': True, u'test_info': [u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and either remove the --peer-auto-tls parameter or set it to false.\n--peer-auto-tls=false\n'], u'test_desc': u'Ensure that the --peer-auto-tls argument is not set to true (Scored)', u'AuditConfig': u'', u'remediation': u'Edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the master\nnode and either remove the --peer-auto-tls parameter or set it to false.\n--peer-auto-tls=false\n', u'actual_value': u'root 855 609 5 Sep23 ? 3-18:38:56 kube-apiserver --authorization-mode=Node,RBAC --advertise-address=172.18.0.2 --allow-privileged=true --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugins=NodeRestriction --enable-bootstrap-token-auth=true --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key --etcd-servers=https://127.0.0.1:2379 --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-cluster-ip-range=10.96.0.0/12 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\nroot 879 580 3 Sep23 ? 2-01:51:05 etcd --advertise-client-urls=https://172.18.0.2:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-peer-urls=https://172.18.0.2:2380 --initial-cluster=hunter-control-plane=https://172.18.0.2:2380 --key-file=/etc/kubernetes/pki/etcd/server.key --listen-client-urls=https://127.0.0.1:2379,https://172.18.0.2:2379 --listen-peer-urls=https://172.18.0.2:2380 --name=hunter-control-plane --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt --peer-client-cert-auth=true --peer-key-file=/etc/kubernetes/pki/etcd/peer.key --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt --snapshot-count=10000 --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt\n', u'expected_result': u"'--peer-auto-tls' is not present OR '--peer-auto-tls' is present", u'type': u'', u'test_number': u'1.5.6'}, {u'audit': u'/bin/ps -ef | grep etcd | grep -v grep', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow the etcd documentation and create a dedicated certificate authority setup for the\netcd service.\nThen, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the\nmaster node and set the below parameter.\n--trusted-ca-file=\n'], u'test_desc': u'Ensure that a unique Certificate Authority is used for etcd (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the etcd documentation and create a dedicated certificate authority setup for the\netcd service.\nThen, edit the etcd pod specification file /etc/kubernetes/manifests/etcd.yaml on the\nmaster node and set the below parameter.\n--trusted-ca-file=\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.5.7'}], u'warn': 1, u'pass': 6, u'fail': 0, u'desc': u'etcd'}, {u'info': 0, u'section': u'1.6', u'results': [{u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nRemove any unneeded clusterrolebindings :\nkubectl delete clusterrolebinding [name]\n'], u'test_desc': u'Ensure that the cluster-admin role is only used where required (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nRemove any unneeded clusterrolebindings :\nkubectl delete clusterrolebinding [name]\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.1'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow the documentation and create namespaces for objects in your deployment as you\nneed them.\n'], u'test_desc': u'Create administrative boundaries between resources using namespaces (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the documentation and create namespaces for objects in your deployment as you\nneed them.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.2'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow the documentation and create NetworkPolicy objects as you need them.\n'], u'test_desc': u'Create network segmentation using Network Policies (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the documentation and create NetworkPolicy objects as you need them.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.3'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nSeccomp is an alpha feature currently. By default, all alpha features are disabled. So, you\nwould need to enable alpha features in the apiserver by passing "--feature-\ngates=AllAlpha=true" argument.\nEdit the /etc/kubernetes/manifests/kube-apiserver.yaml file on the master node and set the KUBE_API_ARGS\nparameter to "--feature-gates=AllAlpha=true"\nKUBE_API_ARGS="--feature-gates=AllAlpha=true"\nBased on your system, restart the kube-apiserver service. For example:\nsystemctl restart kube-apiserver.service\nUse annotations to enable the docker/default seccomp profile in your pod definitions. An\nexample is as below:\napiVersion: v1\nkind: Pod\nmetadata:\n name: trustworthy-pod\n annotations:\n seccomp.security.alpha.kubernetes.io/pod: docker/default\nspec:\n containers:\n - name: trustworthy-container\n image: sotrustworthy:latest\n'], u'test_desc': u'Ensure that the seccomp profile is set to docker/default in your pod definitions (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nSeccomp is an alpha feature currently. By default, all alpha features are disabled. So, you\nwould need to enable alpha features in the apiserver by passing "--feature-\ngates=AllAlpha=true" argument.\nEdit the /etc/kubernetes/manifests/kube-apiserver.yaml file on the master node and set the KUBE_API_ARGS\nparameter to "--feature-gates=AllAlpha=true"\nKUBE_API_ARGS="--feature-gates=AllAlpha=true"\nBased on your system, restart the kube-apiserver service. For example:\nsystemctl restart kube-apiserver.service\nUse annotations to enable the docker/default seccomp profile in your pod definitions. An\nexample is as below:\napiVersion: v1\nkind: Pod\nmetadata:\n name: trustworthy-pod\n annotations:\n seccomp.security.alpha.kubernetes.io/pod: docker/default\nspec:\n containers:\n - name: trustworthy-container\n image: sotrustworthy:latest\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.4'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow the Kubernetes documentation and apply security contexts to your pods. For a\nsuggested list of security contexts, you may refer to the CIS Security Benchmark for Docker\nContainers.\n'], u'test_desc': u'Apply Security Context to Your Pods and Containers (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the Kubernetes documentation and apply security contexts to your pods. For a\nsuggested list of security contexts, you may refer to the CIS Security Benchmark for Docker\nContainers.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.5'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow the Kubernetes documentation and setup image provenance.\n'], u'test_desc': u'Configure Image Provenance using ImagePolicyWebhook admission controller (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the Kubernetes documentation and setup image provenance.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.6'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow the Kubernetes documentation and setup network policies as appropriate.\nFor example, you could create a "default" isolation policy for a Namespace by creating a\nNetworkPolicy that selects all pods but does not allow any traffic:\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n name: default-deny\nspec:\n podSelector:\n'], u'test_desc': u'Configure Network policies as appropriate (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow the Kubernetes documentation and setup network policies as appropriate.\nFor example, you could create a "default" isolation policy for a Namespace by creating a\nNetworkPolicy that selects all pods but does not allow any traffic:\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n name: default-deny\nspec:\n podSelector:\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.7'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nFollow Kubernetes documentation and setup PSP and RBAC authorization for your cluster.\n'], u'test_desc': u'Place compensating controls in the form of PSP and RBAC for privileged containers usage (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nFollow Kubernetes documentation and setup PSP and RBAC authorization for your cluster.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.6.8'}], u'warn': 8, u'pass': 0, u'fail': 0, u'desc': u'General Security Primitives'}, {u'info': 0, u'section': u'1.7', u'results': [{u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.privileged field is omitted or set to false.\n'], u'test_desc': u'Do not admit privileged containers (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.privileged field is omitted or set to false.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.1'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostPID field is omitted or set to false.\n'], u'test_desc': u'Do not admit containers wishing to share the host process ID namespace (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostPID field is omitted or set to false.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.2'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostIPC field is omitted or set to false.\n'], u'test_desc': u'Do not admit containers wishing to share the host IPC namespace (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostIPC field is omitted or set to false.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.3'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostNetwork field is omitted or set to false.\n'], u'test_desc': u'Do not admit containers wishing to share the host network namespace (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostNetwork field is omitted or set to false.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.4'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.allowPrivilegeEscalation field is omitted or set to false.\n'], u'test_desc': u' Do not admit containers with allowPrivilegeEscalation (Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.allowPrivilegeEscalation field is omitted or set to false.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.5'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.runAsUser.rule is set to either MustRunAsNonRoot or MustRunAs with the range of UIDs not including 0.\n'], u'test_desc': u'Do not admit root containers (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.runAsUser.rule is set to either MustRunAsNonRoot or MustRunAs with the range of UIDs not including 0.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.6'}, {u'audit': u'', u'status': u'WARN', u'scored': False, u'test_info': [u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.requiredDropCapabilities is set to include either NET_RAW or ALL.\n'], u'test_desc': u'Do not admit containers with dangerous capabilities (Not Scored)', u'reason': u'Test marked as a manual test', u'AuditConfig': u'', u'remediation': u'[Manual test]\nCreate a PSP as described in the Kubernetes documentation, ensuring that the .spec.requiredDropCapabilities is set to include either NET_RAW or ALL.\n', u'actual_value': u'', u'expected_result': u'', u'type': u'manual', u'test_number': u'1.7.7'}], u'warn': 7, u'pass': 0, u'fail': 0, u'desc': u'PodSecurityPolicies'}], u'text': u'Master Node Security Configuration', u'total_pass': 48, u'node_type': u'master', u'version': u'1.13', u'total_fail': 18, u'total_info': 1, u'id': u'1', u'total_warn': 25}] 2020-11-27 11:02:41,833 - functest_kubernetes.security.security - ERROR - Ensure that the --profiling argument is set to false (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the below parameter. --profiling=false 2020-11-27 11:02:41,962 - functest_kubernetes.security.security - ERROR - Ensure that the --repair-malformed-updates argument is set to false (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the below parameter. --repair-malformed-updates=false 2020-11-27 11:02:41,964 - functest_kubernetes.security.security - ERROR - Ensure that the admission control plugin AlwaysPullImages is set (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --enable-admission-plugins to include AlwaysPullImages. --enable-admission-plugins=...,AlwaysPullImages,... 2020-11-27 11:02:41,967 - functest_kubernetes.security.security - ERROR - Ensure that the --audit-log-path argument is set as appropriate (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --audit-log-path parameter to a suitable path and file where you would like audit logs to be written, for example: --audit-log-path=/var/log/apiserver/audit.log 2020-11-27 11:02:41,969 - functest_kubernetes.security.security - ERROR - Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --audit-log-maxage parameter to 30 or as an appropriate number of days: --audit-log-maxage=30 2020-11-27 11:02:41,971 - functest_kubernetes.security.security - ERROR - Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --audit-log-maxbackup parameter to 10 or to an appropriate value. --audit-log-maxbackup=10 2020-11-27 11:02:41,972 - functest_kubernetes.security.security - ERROR - Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Scored) Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --audit-log-maxsize parameter to an appropriate size in MB. For example, to set it as 100 MB: --audit-log-maxsize=100 2020-11-27 11:02:41,973 - functest_kubernetes.security.security - ERROR - Ensure that the --kubelet-certificate-authority argument is set as appropriate (Scored) Follow the Kubernetes documentation and setup the TLS connection between the apiserver and kubelets. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --kubelet-certificate-authority parameter to the path to the cert file for the certificate authority. --kubelet-certificate-authority= 2020-11-27 11:02:41,975 - functest_kubernetes.security.security - ERROR - Ensure that the admission control plugin PodSecurityPolicy is set (Scored) Follow the documentation and create Pod Security Policy objects as per your environment. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --enable-admission-plugins parameter to a value that includes PodSecurityPolicy : --enable-admission-plugins=...,PodSecurityPolicy,... Then restart the API Server. 2020-11-27 11:02:41,976 - functest_kubernetes.security.security - ERROR - Ensure that the --encryption-provider-config argument is set as appropriate (Scored) [Manual test] Follow the Kubernetes documentation and configure a EncryptionConfig file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the --encryption-provider-config parameter to the path of that file: --encryption-provider-config= 2020-11-27 11:02:41,977 - functest_kubernetes.security.security - ERROR - Ensure that the admission control plugin EventRateLimit is set (Scored) Follow the Kubernetes documentation and set the desired limits in a configuration file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml and set the below parameters. --enable-admission-plugins=...,EventRateLimit,... --admission-control-config-file= 2020-11-27 11:02:41,979 - functest_kubernetes.security.security - ERROR - Ensure that the AdvancedAuditing argument is not set to false (Scored) Follow the Kubernetes documentation and set the desired audit policy in the /etc/kubernetes/audit-policy.yaml file. Then, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml and set the below parameters. --audit-policy-file=/etc/kubernetes/audit-policy.yaml 2020-11-27 11:02:41,980 - functest_kubernetes.security.security - ERROR - Ensure that the --profiling argument is set to false (Scored) Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml file on the master node and set the below parameter. --profiling=false 2020-11-27 11:02:41,982 - functest_kubernetes.security.security - ERROR - Ensure that the --terminated-pod-gc-threshold argument is set as appropriate (Scored) Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml on the master node and set the --terminated-pod-gc-threshold to an appropriate threshold, for example: --terminated-pod-gc-threshold=10 2020-11-27 11:02:41,983 - functest_kubernetes.security.security - ERROR - Ensure that the --profiling argument is set to false (Scored) Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml on the master node and set the below parameter. --profiling=false 2020-11-27 11:02:41,984 - functest_kubernetes.security.security - ERROR - Ensure that the RotateKubeletServerCertificate argument is set to true (Scored) Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml controller-manager.yaml on the master node and set the --feature-gates parameter to include RotateKubeletServerCertificate=true. --feature-gates=RotateKubeletServerCertificate=true 2020-11-27 11:02:41,986 - functest_kubernetes.security.security - ERROR - Ensure that the etcd data directory permissions are set to 700 or more restrictive (Scored) On the etcd server node, get the etcd data directory, passed as an argument --data-dir , from the below command: ps -ef | grep etcd Run the below command (based on the etcd data directory found above). For example, chmod 700 /var/lib/etcd 2020-11-27 11:02:41,987 - functest_kubernetes.security.security - ERROR - Ensure that the etcd data directory ownership is set to etcd:etcd (Scored) On the etcd server node, get the etcd data directory, passed as an argument --data-dir , from the below command: ps -ef | grep etcd Run the below command (based on the etcd data directory found above). For example, chown etcd:etcd /var/lib/etcd 2020-11-27 11:02:42,013 - functest_kubernetes.security.security - WARNING - Targets: +-------------------+-----------------+-------------------------------------+--------------+--------------+--------------+ | NODE_TYPE | VERSION | TEST_DESC | PASS | FAIL | WARN | +-------------------+-----------------+-------------------------------------+--------------+--------------+--------------+ | master | 1.13 | API Server | 23 | 12 | 4 | | master | 1.13 | Scheduler | 1 | 1 | 0 | | master | 1.13 | Controller Manager | 4 | 3 | 0 | | master | 1.13 | Configuration Files | 14 | 2 | 5 | | master | 1.13 | etcd | 6 | 0 | 1 | | master | 1.13 | General Security Primitives | 0 | 0 | 8 | | master | 1.13 | PodSecurityPolicies | 0 | 0 | 7 | +-------------------+-----------------+-------------------------------------+--------------+--------------+--------------+ 2020-11-27 11:02:42,017 - xtesting.ci.run_tests - INFO - Test result: +---------------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +---------------------------+------------------+------------------+----------------+ | kube_bench_master | functest | 00:06 | PASS | +---------------------------+------------------+------------------+----------------+