2021-01-13 08:47:00,787 - xtesting.ci.run_tests - INFO - Deployment description: +-------------------------+----------------------------------------------------------+ | ENV VAR | VALUE | +-------------------------+----------------------------------------------------------+ | CI_LOOP | daily | | DEBUG | true | | DEPLOY_SCENARIO | k8-nosdn-nofeature-noha | | INSTALLER_TYPE | unknown | | BUILD_TAG | 151F2YF3NXAA | | NODE_NAME | lf-virtual1-5 | | TEST_DB_URL | http://testresults.opnfv.org/test/api/v1/results | | TEST_DB_EXT_URL | http://testresults.opnfv.org/test/api/v1/results | | S3_ENDPOINT_URL | https://storage.googleapis.com | | S3_DST_URL | s3://artifacts.opnfv.org/functest- | | | kubernetes/151F2YF3NXAA/functest-kubernetes-pi- | | | ollivier-functest-kubernetes-security- | | | arm64-leguer-kube_bench_master-run-16 | | HTTP_DST_URL | http://artifacts.opnfv.org/functest- | | | kubernetes/151F2YF3NXAA/functest-kubernetes-pi- | | | ollivier-functest-kubernetes-security- | | | arm64-leguer-kube_bench_master-run-16 | +-------------------------+----------------------------------------------------------+ 2021-01-13 08:47:00,964 - xtesting.ci.run_tests - INFO - Loading test case 'kube_bench_master'... 2021-01-13 08:47:03,434 - xtesting.ci.run_tests - INFO - Running test case 'kube_bench_master'... 2021-01-13 08:47:03,855 - functest_kubernetes.security.security - INFO - Job kube-bench-master created 2021-01-13 08:47:12,202 - functest_kubernetes.security.security - INFO - kube-bench-master started in 8.77 sec 2021-01-13 08:47:12,426 - functest_kubernetes.security.security - INFO - [{'id': '1', 'version': '1.5', 'text': 'Master Node Security Configuration', 'node_type': 'master', 'tests': [{'section': '1.1', 'pass': 15, 'fail': 1, 'warn': 5, 'info': 0, 'desc': 'Master Node Configuration Files', 'results': [{'test_number': '1.1.1', 'test_desc': 'Ensure that the API server pod specification file permissions are set to 644 or more restrictive (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-apiserver.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/kube-apiserver.yaml; fi'", 'AuditConfig': '', 'type': '', 'remediation': 'Run the below command (based on the file location on your system) on the\nmaster node.\nFor example, chmod 644 /etc/kubernetes/manifests/kube-apiserver.yaml\n', 'test_info': ['Run the below command (based on the file location on your system) on the\nmaster node.\nFor example, chmod 644 /etc/kubernetes/manifests/kube-apiserver.yaml\n'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.2', 'test_desc': 'Ensure that the API server pod specification file ownership is set to root:root (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-apiserver.yaml; then stat -c %U:%G /etc/kubernetes/manifests/kube-apiserver.yaml; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.3', 'test_desc': 'Ensure that the controller manager pod specification file permissions are set to 644 or more restrictive (Scored)', 'audit': "/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'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.4', 'test_desc': 'Ensure that the controller manager pod specification file ownership is set to root:root (Scored)', 'audit': "/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'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.5', 'test_desc': 'Ensure that the scheduler pod specification file permissions are set to 644 or more restrictive (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-scheduler.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/kube-scheduler.yaml; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.6', 'test_desc': 'Ensure that the scheduler pod specification file ownership is set to root:root (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/manifests/kube-scheduler.yaml; then stat -c %U:%G /etc/kubernetes/manifests/kube-scheduler.yaml; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.7', 'test_desc': 'Ensure that the etcd pod specification file permissions are set to 644 or more restrictive (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/manifests/etcd.yaml; then stat -c permissions=%a /etc/kubernetes/manifests/etcd.yaml; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.8', 'test_desc': 'Ensure that the etcd pod specification file ownership is set to root:root (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/manifests/etcd.yaml; then stat -c %U:%G /etc/kubernetes/manifests/etcd.yaml; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.9', 'test_desc': 'Ensure that the Container Network Interface file permissions are set to 644 or more restrictive (Not Scored)', 'audit': 'stat -c permissions=%a ', 'AuditConfig': '', 'type': 'manual', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 \n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 \n'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': '', 'reason': 'Test marked as a manual test'}, {'test_number': '1.1.10', 'test_desc': 'Ensure that the Container Network Interface file ownership is set to root:root (Not Scored)', 'audit': 'stat -c %U:%G ', 'AuditConfig': '', 'type': 'manual', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root \n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root \n'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': '', 'reason': 'Test marked as a manual test'}, {'test_number': '1.1.11', 'test_desc': 'Ensure that the etcd data directory permissions are set to 700 or more restrictive (Scored)', 'audit': "ps -ef | grep etcd | grep -- --data-dir | sed 's%.*data-dir[= ]\\([^ ]*\\).*%\\1%' | xargs stat -c permissions=%a", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'permissions=700\n', 'scored': True, 'expected_result': "bitmask '700' AND '700'"}, {'test_number': '1.1.12', 'test_desc': 'Ensure that the etcd data directory ownership is set to etcd:etcd (Scored)', 'audit': "ps -ef | grep etcd | grep -- --data-dir | sed 's%.*data-dir[= ]\\([^ ]*\\).*%\\1%' | xargs stat -c %U:%G", 'AuditConfig': '', 'type': '', 'remediation': '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).\nFor example, chown etcd:etcd /var/lib/etcd\n', 'test_info': ['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).\nFor example, chown etcd:etcd /var/lib/etcd\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.1.13', 'test_desc': 'Ensure that the admin.conf file permissions are set to 644 or more restrictive (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/admin.conf; then stat -c permissions=%a /etc/kubernetes/admin.conf; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.14', 'test_desc': 'Ensure that the admin.conf file ownership is set to root:root (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/admin.conf; then stat -c %U:%G /etc/kubernetes/admin.conf; fi'", 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.15', 'test_desc': 'Ensure that the scheduler.conf file permissions are set to 644 or more restrictive (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/scheduler.conf; then stat -c permissions=%a /etc/kubernetes/scheduler.conf; fi'", 'AuditConfig': '', 'type': '', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/scheduler.conf\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/scheduler.conf\n'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.16', 'test_desc': 'Ensure that the scheduler.conf file ownership is set to root:root (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/scheduler.conf; then stat -c %U:%G /etc/kubernetes/scheduler.conf; fi'", 'AuditConfig': '', 'type': '', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/scheduler.conf\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/scheduler.conf\n'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.17', 'test_desc': 'Ensure that the controller-manager.conf file permissions are set to 644 or more restrictive (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/controller-manager.conf; then stat -c permissions=%a /etc/kubernetes/controller-manager.conf; fi'", 'AuditConfig': '', 'type': '', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/controller-manager.conf\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod 644 /etc/kubernetes/controller-manager.conf\n'], 'status': 'PASS', 'actual_value': 'permissions=600\n', 'scored': True, 'expected_result': "bitmask '600' AND '644'"}, {'test_number': '1.1.18', 'test_desc': 'Ensure that the controller-manager.conf file ownership is set to root:root (Scored)', 'audit': "/bin/sh -c 'if test -e /etc/kubernetes/controller-manager.conf; then stat -c %U:%G /etc/kubernetes/controller-manager.conf; fi'", 'AuditConfig': '', 'type': '', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/controller-manager.conf\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown root:root /etc/kubernetes/controller-manager.conf\n'], 'status': 'PASS', 'actual_value': 'root:root\n', 'scored': True, 'expected_result': "'root:root' is equal to 'root:root'"}, {'test_number': '1.1.19', 'test_desc': 'Ensure that the Kubernetes PKI directory and file ownership is set to root:root (Scored)', 'audit': 'ls -laR /etc/kubernetes/pki/', 'AuditConfig': '', 'type': 'manual', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown -R root:root /etc/kubernetes/pki/\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchown -R root:root /etc/kubernetes/pki/\n'], 'status': 'WARN', 'actual_value': '', 'scored': True, 'expected_result': '', 'reason': 'Test marked as a manual test'}, {'test_number': '1.1.20', 'test_desc': 'Ensure that the Kubernetes PKI certificate file permissions are set to 644 or more restrictive (Scored)', 'audit': 'stat -c %n %a /etc/kubernetes/pki/*.crt', 'AuditConfig': '', 'type': 'manual', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod -R 644 /etc/kubernetes/pki/*.crt\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod -R 644 /etc/kubernetes/pki/*.crt\n'], 'status': 'WARN', 'actual_value': '', 'scored': True, 'expected_result': '', 'reason': 'Test marked as a manual test'}, {'test_number': '1.1.21', 'test_desc': 'Ensure that the Kubernetes PKI key file permissions are set to 600 (Scored)', 'audit': 'stat -c %n %a /etc/kubernetes/pki/*.key', 'AuditConfig': '', 'type': 'manual', 'remediation': 'Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod -R 600 /etc/kubernetes/pki/*.key\n', 'test_info': ['Run the below command (based on the file location on your system) on the master node.\nFor example,\nchmod -R 600 /etc/kubernetes/pki/*.key\n'], 'status': 'WARN', 'actual_value': '', 'scored': True, 'expected_result': '', 'reason': 'Test marked as a manual test'}]}, {'section': '1.2', 'pass': 21, 'fail': 8, 'warn': 6, 'info': 0, 'desc': 'API Server', 'results': [{'test_number': '1.2.1', 'test_desc': 'Ensure that the --anonymous-auth argument is set to false (Not Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': ''}, {'test_number': '1.2.2', 'test_desc': 'Ensure that the --basic-auth-file argument is not set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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= parameter.\n', 'test_info': ['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= parameter.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--basic-auth-file' is not present"}, {'test_number': '1.2.3', 'test_desc': 'Ensure that the --token-auth-file parameter is not set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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= parameter.\n', 'test_info': ['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= parameter.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--token-auth-file' is not present"}, {'test_number': '1.2.4', 'test_desc': 'Ensure that the --kubelet-https argument is set to true (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --kubelet-https parameter.\n', 'test_info': ['Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --kubelet-https parameter.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--kubelet-https' is present OR '--kubelet-https' is not present"}, {'test_number': '1.2.5', 'test_desc': 'Ensure that the --kubelet-client-certificate and --kubelet-client-key arguments are set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--kubelet-client-certificate' is present AND '--kubelet-client-key' is present"}, {'test_number': '1.2.6', 'test_desc': 'Ensure that the --kubelet-certificate-authority argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Follow the Kubernetes documentation and setup the TLS connection between\nthe apiserver and kubelets. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the\n--kubelet-certificate-authority parameter to the path to the cert file for the certificate authority.\n--kubelet-certificate-authority=\n', 'test_info': ['Follow the Kubernetes documentation and setup the TLS connection between\nthe apiserver and kubelets. Then, edit the API server pod specification file\n/etc/kubernetes/manifests/kube-apiserver.yaml on the master node and set the\n--kubelet-certificate-authority parameter to the path to the cert file for the certificate authority.\n--kubelet-certificate-authority=\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.7', 'test_desc': 'Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --authorization-mode parameter to values other than AlwaysAllow.\nOne such example could be as below.\n--authorization-mode=RBAC\n', 'test_info': ['Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --authorization-mode parameter to values other than AlwaysAllow.\nOne such example could be as below.\n--authorization-mode=RBAC\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': " 'Node,RBAC' not have 'AlwaysAllow'"}, {'test_number': '1.2.8', 'test_desc': 'Ensure that the --authorization-mode argument includes Node (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 value that includes Node.\n--authorization-mode=Node,RBAC\n', 'test_info': ['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 value that includes Node.\n--authorization-mode=Node,RBAC\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'Node,RBAC' has 'Node'"}, {'test_number': '1.2.9', 'test_desc': 'Ensure that the --authorization-mode argument includes RBAC (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 value that includes RBAC,\nfor example:\n--authorization-mode=Node,RBAC\n', 'test_info': ['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 value that includes RBAC,\nfor example:\n--authorization-mode=Node,RBAC\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'Node,RBAC' has 'RBAC'"}, {'test_number': '1.2.10', 'test_desc': 'Ensure that the admission control plugin EventRateLimit is set (Not Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Follow the Kubernetes documentation and set the desired limits in a configuration file.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameters.\n--enable-admission-plugins=...,EventRateLimit,...\n--admission-control-config-file=\n', 'test_info': ['Follow the Kubernetes documentation and set the desired limits in a configuration file.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameters.\n--enable-admission-plugins=...,EventRateLimit,...\n--admission-control-config-file=\n'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': ''}, {'test_number': '1.2.11', 'test_desc': 'Ensure that the admission control plugin AlwaysAdmit is not set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and either remove the --enable-admission-plugins parameter, or set it to a\nvalue that does not include AlwaysAdmit.\n', 'test_info': ['Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and either remove the --enable-admission-plugins parameter, or set it to a\nvalue that does not include AlwaysAdmit.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': " 'NodeRestriction' not have 'AlwaysAdmit' OR '--enable-admission-plugins' is not present"}, {'test_number': '1.2.12', 'test_desc': 'Ensure that the admission control plugin AlwaysPullImages is set (Not Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 include\nAlwaysPullImages.\n--enable-admission-plugins=...,AlwaysPullImages,...\n', 'test_info': ['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 include\nAlwaysPullImages.\n--enable-admission-plugins=...,AlwaysPullImages,...\n'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': ''}, {'test_number': '1.2.13', 'test_desc': 'Ensure that the admission control plugin SecurityContextDeny is set if PodSecurityPolicy is not used (Not Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 include\nSecurityContextDeny, unless PodSecurityPolicy is already in place.\n--enable-admission-plugins=...,SecurityContextDeny,...\n', 'test_info': ['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 include\nSecurityContextDeny, unless PodSecurityPolicy is already in place.\n--enable-admission-plugins=...,SecurityContextDeny,...\n'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': ''}, {'test_number': '1.2.14', 'test_desc': 'Ensure that the admission control plugin ServiceAccount is set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 ensure that the --disable-admission-plugins parameter is set to a\nvalue that does not include ServiceAccount.\n', 'test_info': ['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 ensure that the --disable-admission-plugins parameter is set to a\nvalue that does not include ServiceAccount.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--disable-admission-plugins' is present OR '--disable-admission-plugins' is not present"}, {'test_number': '1.2.15', 'test_desc': 'Ensure that the admission control plugin NamespaceLifecycle is set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--disable-admission-plugins' is present OR '--disable-admission-plugins' is not present"}, {'test_number': '1.2.16', 'test_desc': 'Ensure that the admission control plugin PodSecurityPolicy is set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.17', 'test_desc': 'Ensure that the admission control plugin NodeRestriction is set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Follow the Kubernetes documentation and configure NodeRestriction plug-in on kubelets.\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 NodeRestriction.\n--enable-admission-plugins=...,NodeRestriction,...\n', 'test_info': ['Follow the Kubernetes documentation and configure NodeRestriction plug-in on kubelets.\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 NodeRestriction.\n--enable-admission-plugins=...,NodeRestriction,...\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'NodeRestriction' has 'NodeRestriction'"}, {'test_number': '1.2.18', 'test_desc': 'Ensure that the --insecure-bind-address argument is not set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --insecure-bind-address parameter.\n', 'test_info': ['Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and remove the --insecure-bind-address parameter.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--insecure-bind-address' is not present"}, {'test_number': '1.2.19', 'test_desc': 'Ensure that the --insecure-port argument is set to 0 (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--insecure-port=0\n', 'test_info': ['Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the below parameter.\n--insecure-port=0\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'0' is equal to '0'"}, {'test_number': '1.2.20', 'test_desc': 'Ensure that the --secure-port argument is not set to 0 (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "6443 is greater than 0 OR '--secure-port' is not present"}, {'test_number': '1.2.21', 'test_desc': 'Ensure that the --profiling argument is set to false (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.22', 'test_desc': 'Ensure that the --audit-log-path argument is set (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 path and\nfile where you would like audit logs to be written, for example:\n--audit-log-path=/var/log/apiserver/audit.log\n', 'test_info': ['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 path and\nfile where you would like audit logs to be written, for example:\n--audit-log-path=/var/log/apiserver/audit.log\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.23', 'test_desc': 'Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 as an appropriate number of days:\n--audit-log-maxage=30\n', 'test_info': ['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 as an appropriate number of days:\n--audit-log-maxage=30\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.24', 'test_desc': 'Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 or to an appropriate\nvalue.\n--audit-log-maxbackup=10\n', 'test_info': ['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 or to an appropriate\nvalue.\n--audit-log-maxbackup=10\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.25', 'test_desc': 'Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 appropriate size in MB.\nFor example, to set it as 100 MB:\n--audit-log-maxsize=100\n', 'test_info': ['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 appropriate size in MB.\nFor example, to set it as 100 MB:\n--audit-log-maxsize=100\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.26', 'test_desc': 'Ensure that the --request-timeout argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameter as appropriate and if needed.\nFor example,\n--request-timeout=300s\n', 'test_info': ['Edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\nand set the below parameter as appropriate and if needed.\nFor example,\n--request-timeout=300s\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--request-timeout' is not present OR '--request-timeout' is present"}, {'test_number': '1.2.27', 'test_desc': 'Ensure that the --service-account-lookup argument is set to true (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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\nAlternatively, you can delete the --service-account-lookup parameter from this file so\nthat the default takes effect.\n', 'test_info': ['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\nAlternatively, you can delete the --service-account-lookup parameter from this file so\nthat the default takes effect.\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--service-account-lookup' is not present OR '--service-account-lookup' is present"}, {'test_number': '1.2.28', 'test_desc': 'Ensure that the --service-account-key-file argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--service-account-key-file' is present"}, {'test_number': '1.2.29', 'test_desc': 'Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Follow the Kubernetes documentation and set up the TLS connection between the apiserver and etcd.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the etcd certificate and key file parameters.\n--etcd-certfile=\n--etcd-keyfile=\n', 'test_info': ['Follow the Kubernetes documentation and set up the TLS connection between the apiserver and etcd.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the etcd certificate and key file parameters.\n--etcd-certfile=\n--etcd-keyfile=\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--etcd-certfile' is present AND '--etcd-keyfile' is present"}, {'test_number': '1.2.30', 'test_desc': 'Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 parameters.\n--tls-cert-file=\n--tls-private-key-file=\n', 'test_info': ['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 parameters.\n--tls-cert-file=\n--tls-private-key-file=\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--tls-cert-file' is present AND '--tls-private-key-file' is present"}, {'test_number': '1.2.31', 'test_desc': 'Ensure that the --client-ca-file argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--client-ca-file' is present"}, {'test_number': '1.2.32', 'test_desc': 'Ensure that the --etcd-cafile argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Follow the Kubernetes documentation and set up the TLS connection between the apiserver and etcd.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the etcd certificate authority file parameter.\n--etcd-cafile=\n', 'test_info': ['Follow the Kubernetes documentation and set up the TLS connection between the apiserver and etcd.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the etcd certificate authority file parameter.\n--etcd-cafile=\n'], 'status': 'PASS', 'actual_value': 'root 613 356 9 Jan10 ? 06:10:23 kube-apiserver --advertise-address=172.18.0.17 --allow-privileged=true --authorization-mode=Node,RBAC --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 --runtime-config= --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/pki/sa.pub --service-account-signing-key-file=/etc/kubernetes/pki/sa.key --service-cluster-ip-range=10.96.0.0/16 --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --tls-private-key-file=/etc/kubernetes/pki/apiserver.key\n', 'scored': True, 'expected_result': "'--etcd-cafile' is present"}, {'test_number': '1.2.33', 'test_desc': 'Ensure that the --encryption-provider-config argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Follow the Kubernetes documentation and configure a EncryptionConfig file.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --encryption-provider-config parameter to the path of that file: --encryption-provider-config=\n', 'test_info': ['Follow the Kubernetes documentation and configure a EncryptionConfig file.\nThen, edit the API server pod specification file /etc/kubernetes/manifests/kube-apiserver.yaml\non the master node and set the --encryption-provider-config parameter to the path of that file: --encryption-provider-config=\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.2.34', 'test_desc': 'Ensure that encryption providers are appropriately configured (Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': 'manual', 'remediation': 'Follow the Kubernetes documentation and configure a EncryptionConfig file.\nIn this file, choose aescbc, kms or secretbox as the encryption provider.\n', 'test_info': ['Follow the Kubernetes documentation and configure a EncryptionConfig file.\nIn this file, choose aescbc, kms or secretbox as the encryption provider.\n'], 'status': 'WARN', 'actual_value': '', 'scored': True, 'expected_result': '', 'reason': 'Test marked as a manual test'}, {'test_number': '1.2.35', 'test_desc': 'Ensure that the API Server only makes use of Strong Cryptographic Ciphers (Not Scored)', 'audit': '/bin/ps -ef | grep kube-apiserver | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'WARN', 'actual_value': '', 'scored': False, 'expected_result': ''}]}, {'section': '1.3', 'pass': 4, 'fail': 3, 'warn': 0, 'info': 0, 'desc': 'Controller Manager', 'results': [{'test_number': '1.3.1', 'test_desc': 'Ensure that the --terminated-pod-gc-threshold argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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,\nfor example:\n--terminated-pod-gc-threshold=10\n', 'test_info': ['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,\nfor example:\n--terminated-pod-gc-threshold=10\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.3.2', 'test_desc': 'Ensure that the --profiling argument is set to false (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.3.3', 'test_desc': 'Ensure that the --use-service-account-credentials argument is set to true (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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', 'test_info': ['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'], 'status': 'PASS', 'actual_value': 'root 564 386 2 Jan10 ? 01:31:51 kube-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=leguer --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --enable-hostpath-provisioner=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --port=0 --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 --service-cluster-ip-range=10.96.0.0/16 --use-service-account-credentials=true\n', 'scored': True, 'expected_result': "'true' is not equal to 'false'"}, {'test_number': '1.3.4', 'test_desc': 'Ensure that the --service-account-private-key-file argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --service-account-private-key-file parameter\nto the private key file for service accounts.\n--service-account-private-key-file=\n', 'test_info': ['Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --service-account-private-key-file parameter\nto the private key file for service accounts.\n--service-account-private-key-file=\n'], 'status': 'PASS', 'actual_value': 'root 564 386 2 Jan10 ? 01:31:51 kube-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=leguer --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --enable-hostpath-provisioner=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --port=0 --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 --service-cluster-ip-range=10.96.0.0/16 --use-service-account-credentials=true\n', 'scored': True, 'expected_result': "'--service-account-private-key-file' is present"}, {'test_number': '1.3.5', 'test_desc': 'Ensure that the --root-ca-file argument is set as appropriate (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': '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 the certificate bundle file`.\n--root-ca-file=\n', 'test_info': ['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 the certificate bundle file`.\n--root-ca-file=\n'], 'status': 'PASS', 'actual_value': 'root 564 386 2 Jan10 ? 01:31:51 kube-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=leguer --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --enable-hostpath-provisioner=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --port=0 --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 --service-cluster-ip-range=10.96.0.0/16 --use-service-account-credentials=true\n', 'scored': True, 'expected_result': "'--root-ca-file' is present"}, {'test_number': '1.3.6', 'test_desc': 'Ensure that the RotateKubeletServerCertificate argument is set to true (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --feature-gates parameter to include RotateKubeletServerCertificate=true.\n--feature-gates=RotateKubeletServerCertificate=true\n', 'test_info': ['Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and set the --feature-gates parameter to include RotateKubeletServerCertificate=true.\n--feature-gates=RotateKubeletServerCertificate=true\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.3.7', 'test_desc': 'Ensure that the --bind-address argument is set to 127.0.0.1 (Scored)', 'audit': '/bin/ps -ef | grep kube-controller | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and ensure the correct value for the --bind-address parameter\n', 'test_info': ['Edit the Controller Manager pod specification file /etc/kubernetes/manifests/kube-controller-manager.yaml\non the master node and ensure the correct value for the --bind-address parameter\n'], 'status': 'PASS', 'actual_value': 'root 564 386 2 Jan10 ? 01:31:51 kube-controller-manager --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/pki/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=leguer --cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt --cluster-signing-key-file=/etc/kubernetes/pki/ca.key --controllers=*,bootstrapsigner,tokencleaner --enable-hostpath-provisioner=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --port=0 --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 --service-cluster-ip-range=10.96.0.0/16 --use-service-account-credentials=true\n', 'scored': True, 'expected_result': "'127.0.0.1' is equal to '127.0.0.1' OR '--bind-address' is not present"}]}, {'section': '1.4', 'pass': 1, 'fail': 1, 'warn': 0, 'info': 0, 'desc': 'Scheduler', 'results': [{'test_number': '1.4.1', 'test_desc': 'Ensure that the --profiling argument is set to false (Scored)', 'audit': '/bin/ps -ef | grep kube-scheduler | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml file\non the master node and set the below parameter.\n--profiling=false\n', 'test_info': ['Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml file\non the master node and set the below parameter.\n--profiling=false\n'], 'status': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'test_number': '1.4.2', 'test_desc': 'Ensure that the --bind-address argument is set to 127.0.0.1 (Scored)', 'audit': '/bin/ps -ef | grep kube-scheduler | grep -v grep', 'AuditConfig': '', 'type': '', 'remediation': 'Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml\non the master node and ensure the correct value for the --bind-address parameter\n', 'test_info': ['Edit the Scheduler pod specification file /etc/kubernetes/manifests/kube-scheduler.yaml\non the master node and ensure the correct value for the --bind-address parameter\n'], 'status': 'PASS', 'actual_value': 'root 687 430 0 Jan10 ? 00:17:46 kube-scheduler --authentication-kubeconfig=/etc/kubernetes/scheduler.conf --authorization-kubeconfig=/etc/kubernetes/scheduler.conf --bind-address=127.0.0.1 --kubeconfig=/etc/kubernetes/scheduler.conf --leader-elect=true --port=0\n', 'scored': True, 'expected_result': "'127.0.0.1' is equal to '127.0.0.1' OR '--bind-address' is not present"}]}], 'total_pass': 41, 'total_fail': 13, 'total_warn': 11, 'total_info': 0}] 2021-01-13 08:47:12,488 - 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 2021-01-13 08:47:12,489 - 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= 2021-01-13 08:47:12,490 - 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. 2021-01-13 08:47:12,491 - 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 2021-01-13 08:47:12,492 - functest_kubernetes.security.security - ERROR - Ensure that the --audit-log-path argument is set (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 2021-01-13 08:47:12,493 - 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 2021-01-13 08:47:12,495 - 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 2021-01-13 08:47:12,496 - 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 2021-01-13 08:47:12,497 - functest_kubernetes.security.security - ERROR - Ensure that the --encryption-provider-config argument is set as appropriate (Scored) 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= 2021-01-13 08:47:12,498 - 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 2021-01-13 08:47:12,499 - 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 2021-01-13 08:47:12,500 - 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 on the master node and set the --feature-gates parameter to include RotateKubeletServerCertificate=true. --feature-gates=RotateKubeletServerCertificate=true 2021-01-13 08:47:12,501 - 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 2021-01-13 08:47:12,513 - functest_kubernetes.security.security - WARNING - Targets: +-------------------+-----------------+-----------------------------------------+--------------+--------------+--------------+ | NODE_TYPE | VERSION | TEST_DESC | PASS | FAIL | WARN | +-------------------+-----------------+-----------------------------------------+--------------+--------------+--------------+ | master | 1.5 | Master Node Configuration Files | 15 | 1 | 5 | | master | 1.5 | API Server | 21 | 8 | 6 | | master | 1.5 | Controller Manager | 4 | 3 | 0 | | master | 1.5 | Scheduler | 1 | 1 | 0 | +-------------------+-----------------+-----------------------------------------+--------------+--------------+--------------+ 2021-01-13 08:47:12,514 - xtesting.ci.run_tests - INFO - Test result: +---------------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +---------------------------+------------------+------------------+----------------+ | kube_bench_master | functest | 00:08 | PASS | +---------------------------+------------------+------------------+----------------+