2022-05-06 21:50:41,457 - xtesting.ci.run_tests - INFO - Deployment description: +-------------------------+------------------------------------------------------------+ | ENV VAR | VALUE | +-------------------------+------------------------------------------------------------+ | CI_LOOP | daily | | DEBUG | false | | DEPLOY_SCENARIO | k8-nosdn-nofeature-noha | | INSTALLER_TYPE | unknown | | BUILD_TAG | e1fe6a36 | | NODE_NAME | intel-pod19 | | 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/kuberef/e1fe6a36/kube_ben | | | ch_master-2424924790 | | HTTP_DST_URL | http://artifacts.opnfv.org/kuberef/e1fe6a36/kube_b | | | ench_master-2424924790 | +-------------------------+------------------------------------------------------------+ 2022-05-06 21:50:41,466 - xtesting.ci.run_tests - INFO - Loading test case 'kube_bench_master'... 2022-05-06 21:50:41,727 - xtesting.ci.run_tests - INFO - Running test case 'kube_bench_master'... 2022-05-06 21:50:41,801 - functest_kubernetes.security.security - INFO - Job kube-bench-master created 2022-05-06 21:50:49,130 - functest_kubernetes.security.security - INFO - kube-bench-master started in 7.40 sec 2022-05-06 21:50:49,174 - functest_kubernetes.security.security - INFO - [{'id': '1', 'version': '1.5', 'text': 'Master Node Security Configuration', 'node_type': 'master', 'tests': [{'section': '1.1', 'pass': 12, 'fail': 4, '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': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'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': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'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': 'FAIL', 'actual_value': '', 'scored': True, 'expected_result': ''}, {'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': 31, 'fail': 0, 'warn': 4, '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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'--kubelet-certificate-authority' is present"}, {'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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': False, 'expected_result': "'EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy' has 'EventRateLimit'"}, {'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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': " 'EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy' 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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': False, 'expected_result': "'EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy' has 'AlwaysPullImages'"}, {'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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy' has 'PodSecurityPolicy'"}, {'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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy' 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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'False' is equal to 'false'"}, {'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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'--audit-log-path' is present"}, {'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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': '30 is greater or equal to 30'}, {'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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': '10 is greater or equal to 10'}, {'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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': '100 is greater or equal to 100'}, {'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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'--service-account-lookup' is not present OR 'True' is equal to 'true'"}, {'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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/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': 'PASS', 'actual_value': 'root 27476 27454 6 20:16 ? 00:05:45 kube-apiserver --admission-control-config-file=/etc/kubernetes/admission-control/config.yaml --advertise-address=10.10.190.203 --allow-privileged=true --anonymous-auth=True --apiserver-count=3 --audit-log-maxage=30 --audit-log-maxbackup=10 --audit-log-maxsize=100 --audit-log-path=/var/log/audit/kube-apiserver-audit.log --audit-policy-file=/etc/kubernetes/audit-policy/apiserver-audit-policy.yaml --authorization-mode=Node,RBAC --bind-address=0.0.0.0 --client-ca-file=/etc/kubernetes/ssl/ca.crt --default-not-ready-toleration-seconds=300 --default-unreachable-toleration-seconds=300 --enable-admission-plugins=EventRateLimit,AlwaysPullImages,NodeRestriction,PodSecurityPolicy --enable-aggregator-routing=False --enable-bootstrap-token-auth=true --encryption-provider-config=/etc/kubernetes/ssl/secrets_encryption.yaml --endpoint-reconciler-type=lease --etcd-cafile=/etc/ssl/etcd/ssl/ca.pem --etcd-certfile=/etc/ssl/etcd/ssl/node-master1.pem --etcd-keyfile=/etc/ssl/etcd/ssl/node-master1-key.pem --etcd-servers=https://10.10.190.202:2379,https://10.10.190.203:2379,https://10.10.190.204:2379 --event-ttl=1h0m0s --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --insecure-port=0 --kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt --kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key --kubelet-preferred-address-types=InternalDNS,InternalIP,Hostname,ExternalDNS,ExternalIP --profiling=False --proxy-client-cert-file=/etc/kubernetes/ssl/front-proxy-client.crt --proxy-client-key-file=/etc/kubernetes/ssl/front-proxy-client.key --request-timeout=60s --requestheader-allowed-names=front-proxy-client --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --secure-port=6443 --service-account-issuer=https://kubernetes.default.svc.cluster.local --service-account-key-file=/etc/kubernetes/ssl/sa.key --service-account-lookup=True --service-account-signing-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --service-node-port-range=30000-32767 --storage-backend=etcd3 --tls-cert-file=/etc/kubernetes/ssl/apiserver.crt --kubelet-certificate-authority=/etc/kubernetes/ssl/ca.crt --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --tls-private-key-file=/etc/kubernetes/ssl/apiserver.key\n', 'scored': True, 'expected_result': "'--encryption-provider-config' is present"}, {'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': 6, 'fail': 1, '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': 'PASS', 'actual_value': 'root 22037 21929 0 20:12 ? 00:00:11 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/ssl/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=cluster.local --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt --cluster-signing-key-file=/etc/kubernetes/ssl/ca.key --configure-cloud-routes=false --controllers=*,bootstrapsigner,tokencleaner --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --leader-elect-lease-duration=15s --leader-elect-renew-deadline=10s --node-cidr-mask-size=24 --node-monitor-grace-period=40s --node-monitor-period=5s --port=0 --profiling=False --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/ssl/ca.crt --service-account-private-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --terminated-pod-gc-threshold=12500 --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --use-service-account-credentials=true\n', 'scored': True, 'expected_result': "'--terminated-pod-gc-threshold' is present"}, {'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': 'PASS', 'actual_value': 'root 22037 21929 0 20:12 ? 00:00:11 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/ssl/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=cluster.local --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt --cluster-signing-key-file=/etc/kubernetes/ssl/ca.key --configure-cloud-routes=false --controllers=*,bootstrapsigner,tokencleaner --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --leader-elect-lease-duration=15s --leader-elect-renew-deadline=10s --node-cidr-mask-size=24 --node-monitor-grace-period=40s --node-monitor-period=5s --port=0 --profiling=False --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/ssl/ca.crt --service-account-private-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --terminated-pod-gc-threshold=12500 --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --use-service-account-credentials=true\n', 'scored': True, 'expected_result': "'False' is equal to 'false'"}, {'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 22037 21929 0 20:12 ? 00:00:11 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/ssl/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=cluster.local --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt --cluster-signing-key-file=/etc/kubernetes/ssl/ca.key --configure-cloud-routes=false --controllers=*,bootstrapsigner,tokencleaner --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --leader-elect-lease-duration=15s --leader-elect-renew-deadline=10s --node-cidr-mask-size=24 --node-monitor-grace-period=40s --node-monitor-period=5s --port=0 --profiling=False --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/ssl/ca.crt --service-account-private-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --terminated-pod-gc-threshold=12500 --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --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 22037 21929 0 20:12 ? 00:00:11 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/ssl/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=cluster.local --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt --cluster-signing-key-file=/etc/kubernetes/ssl/ca.key --configure-cloud-routes=false --controllers=*,bootstrapsigner,tokencleaner --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --leader-elect-lease-duration=15s --leader-elect-renew-deadline=10s --node-cidr-mask-size=24 --node-monitor-grace-period=40s --node-monitor-period=5s --port=0 --profiling=False --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/ssl/ca.crt --service-account-private-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --terminated-pod-gc-threshold=12500 --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --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 22037 21929 0 20:12 ? 00:00:11 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/ssl/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=cluster.local --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt --cluster-signing-key-file=/etc/kubernetes/ssl/ca.key --configure-cloud-routes=false --controllers=*,bootstrapsigner,tokencleaner --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --leader-elect-lease-duration=15s --leader-elect-renew-deadline=10s --node-cidr-mask-size=24 --node-monitor-grace-period=40s --node-monitor-period=5s --port=0 --profiling=False --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/ssl/ca.crt --service-account-private-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --terminated-pod-gc-threshold=12500 --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --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 22037 21929 0 20:12 ? 00:00:11 kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-address=127.0.0.1 --client-ca-file=/etc/kubernetes/ssl/ca.crt --cluster-cidr=10.244.0.0/16 --cluster-name=cluster.local --cluster-signing-cert-file=/etc/kubernetes/ssl/ca.crt --cluster-signing-key-file=/etc/kubernetes/ssl/ca.key --configure-cloud-routes=false --controllers=*,bootstrapsigner,tokencleaner --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/controller-manager.conf --leader-elect=true --leader-elect-lease-duration=15s --leader-elect-renew-deadline=10s --node-cidr-mask-size=24 --node-monitor-grace-period=40s --node-monitor-period=5s --port=0 --profiling=False --requestheader-client-ca-file=/etc/kubernetes/ssl/front-proxy-ca.crt --root-ca-file=/etc/kubernetes/ssl/ca.crt --service-account-private-key-file=/etc/kubernetes/ssl/sa.key --service-cluster-ip-range=10.233.0.0/18 --terminated-pod-gc-threshold=12500 --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 --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': 2, 'fail': 0, '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': 'PASS', 'actual_value': 'root 22073 22012 0 20:12 ? 00:00:17 kube-scheduler --address=127.0.0.1 --authentication-kubeconfig=/etc/kubernetes/scheduler.conf --authorization-kubeconfig=/etc/kubernetes/scheduler.conf --bind-address=127.0.0.1 --config=/etc/kubernetes/kubescheduler-config.yaml --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/scheduler.conf --leader-elect=true --port=0 --profiling=False --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n', 'scored': True, 'expected_result': "'False' is equal to 'false'"}, {'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 22073 22012 0 20:12 ? 00:00:17 kube-scheduler --address=127.0.0.1 --authentication-kubeconfig=/etc/kubernetes/scheduler.conf --authorization-kubeconfig=/etc/kubernetes/scheduler.conf --bind-address=127.0.0.1 --config=/etc/kubernetes/kubescheduler-config.yaml --feature-gates=CPUManager=true,TopologyManager=True,RotateKubeletServerCertificate=true --kubeconfig=/etc/kubernetes/scheduler.conf --leader-elect=true --port=0 --profiling=False --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n', 'scored': True, 'expected_result': "'127.0.0.1' is equal to '127.0.0.1' OR '--bind-address' is not present"}]}], 'total_pass': 51, 'total_fail': 5, 'total_warn': 9, 'total_info': 0}] 2022-05-06 21:50:49,188 - functest_kubernetes.security.security - ERROR - Ensure that the etcd pod specification file permissions are set to 644 or more restrictive (Scored) Run the below command (based on the file location on your system) on the master node. For example, chmod 644 /etc/kubernetes/manifests/etcd.yaml 2022-05-06 21:50:49,188 - functest_kubernetes.security.security - ERROR - Ensure that the etcd pod specification file ownership is set to root:root (Scored) Run the below command (based on the file location on your system) on the master node. For example, chown root:root /etc/kubernetes/manifests/etcd.yaml 2022-05-06 21:50:49,188 - functest_kubernetes.security.security - ERROR - Ensure that the etcd data directory permissions are set to 700 or more restrictive (Scored) On the etcd server node, get the etcd data directory, passed as an argument --data-dir, from the below command: ps -ef | grep etcd Run the below command (based on the etcd data directory found above). For example, chmod 700 /var/lib/etcd 2022-05-06 21:50:49,188 - 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 2022-05-06 21:50:49,189 - 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 2022-05-06 21:50:49,189 - functest_kubernetes.security.security - WARNING - Targets: +-------------------+-----------------+-----------------------------------------+--------------+--------------+--------------+ | NODE_TYPE | VERSION | TEST_DESC | PASS | FAIL | WARN | +-------------------+-----------------+-----------------------------------------+--------------+--------------+--------------+ | master | 1.5 | Master Node Configuration Files | 12 | 4 | 5 | | master | 1.5 | API Server | 31 | 0 | 4 | | master | 1.5 | Controller Manager | 6 | 1 | 0 | | master | 1.5 | Scheduler | 2 | 0 | 0 | +-------------------+-----------------+-----------------------------------------+--------------+--------------+--------------+ 2022-05-06 21:50:49,190 - xtesting.ci.run_tests - INFO - Test result: +---------------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +---------------------------+------------------+------------------+----------------+ | kube_bench_master | functest | 00:07 | PASS | +---------------------------+------------------+------------------+----------------+