2020-06-12 12:09:24,175 - xtesting.ci.run_tests - INFO - Deployment description: +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | ENV VAR | VALUE | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | CI_LOOP | daily | | DEBUG | true | | DEPLOY_SCENARIO | k8-nosdn-nofeature-noha | | INSTALLER_TYPE | unknown | | BUILD_TAG | 13NUKJNNDJAB | | NODE_NAME | lf-virtual1-4 | | TEST_DB_URL | http://testresults.opnfv.org/test/api/v1/results | | TEST_DB_EXT_URL | http://testresults.opnfv.org/test/api/v1/results | | S3_ENDPOINT_URL | https://storage.googleapis.com | | S3_DST_URL | s3://artifacts.opnfv.org/functest-kubernetes/13NUKJNNDJAB/functest-kubernetes-opnfv-functest-kubernetes-security-kali-kube_bench-run-39 | | HTTP_DST_URL | http://artifacts.opnfv.org/functest-kubernetes/13NUKJNNDJAB/functest-kubernetes-opnfv-functest-kubernetes-security-kali-kube_bench-run-39 | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ 2020-06-12 12:09:24,180 - xtesting.ci.run_tests - DEBUG - No env file /var/lib/xtesting/conf/env_file found 2020-06-12 12:09:24,180 - xtesting.ci.run_tests - DEBUG - Test args: kube_bench 2020-06-12 12:09:24,186 - xtesting.ci.run_tests - INFO - Loading test case 'kube_bench'... 2020-06-12 12:09:24,884 - xtesting.ci.run_tests - INFO - Running test case 'kube_bench'... 2020-06-12 12:09:24,958 - kubernetes.client.rest - DEBUG - response body: {"kind":"Job","apiVersion":"batch/v1","metadata":{"name":"kube-bench","namespace":"default","selfLink":"/apis/batch/v1/namespaces/default/jobs/kube-bench","uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","resourceVersion":"11791492","creationTimestamp":"2020-06-12T12:09:24Z","labels":{"app":"kube-bench","controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","job-name":"kube-bench"},"managedFields":[{"manager":"OpenAPI-Generator","operation":"Update","apiVersion":"batch/v1","time":"2020-06-12T12:09:24Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:backoffLimit":{},"f:completions":{},"f:parallelism":{},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"kube-bench\"}":{".":{},"f:command":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{\"mountPath\":\"/etc/kubernetes\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/etc/systemd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/usr/local/mount-from-host/bin\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/etcd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/kubelet\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}}}}},"f:dnsPolicy":{},"f:hostPID":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{\"name\":\"etc-kubernetes\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"etc-systemd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"usr-bin\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-etcd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-kubelet\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}}}}]},"spec":{"parallelism":1,"completions":1,"backoffLimit":6,"selector":{"matchLabels":{"controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"kube-bench","controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","job-name":"kube-bench"}},"spec":{"volumes":[{"name":"var-lib-etcd","hostPath":{"path":"/var/lib/etcd","type":""}},{"name":"var-lib-kubelet","hostPath":{"path":"/var/lib/kubelet","type":""}},{"name":"etc-systemd","hostPath":{"path":"/etc/systemd","type":""}},{"name":"etc-kubernetes","hostPath":{"path":"/etc/kubernetes","type":""}},{"name":"usr-bin","hostPath":{"path":"/usr/bin","type":""}}],"containers":[{"name":"kube-bench","image":"aquasec/kube-bench:latest","command":["kube-bench"],"resources":{},"volumeMounts":[{"name":"var-lib-etcd","readOnly":true,"mountPath":"/var/lib/etcd"},{"name":"var-lib-kubelet","readOnly":true,"mountPath":"/var/lib/kubelet"},{"name":"etc-systemd","readOnly":true,"mountPath":"/etc/systemd"},{"name":"etc-kubernetes","readOnly":true,"mountPath":"/etc/kubernetes"},{"name":"usr-bin","readOnly":true,"mountPath":"/usr/local/mount-from-host/bin"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always"}],"restartPolicy":"Never","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","hostPID":true,"securityContext":{},"schedulerName":"default-scheduler"}}},"status":{}} 2020-06-12 12:09:24,962 - functest_kubernetes.security.security - INFO - Job kube-bench created 2020-06-12 12:09:24,962 - functest_kubernetes.security.security - DEBUG - create_namespaced_job: {'api_version': 'batch/v1', 'kind': 'Job', 'metadata': {'annotations': None, 'cluster_name': None, 'creation_timestamp': datetime.datetime(2020, 6, 12, 12, 9, 24, tzinfo=tzlocal()), 'deletion_grace_period_seconds': None, 'deletion_timestamp': None, 'finalizers': None, 'generate_name': None, 'generation': None, 'initializers': None, 'labels': {'app': 'kube-bench', 'controller-uid': '7c8c8806-33ae-4a1a-ad4d-f890c7ce977c', 'job-name': 'kube-bench'}, 'managed_fields': [{'api_version': 'batch/v1', 'fields': None, 'manager': 'OpenAPI-Generator', 'operation': 'Update', 'time': datetime.datetime(2020, 6, 12, 12, 9, 24, tzinfo=tzlocal())}], 'name': 'kube-bench', 'namespace': 'default', 'owner_references': None, 'resource_version': '11791492', 'self_link': '/apis/batch/v1/namespaces/default/jobs/kube-bench', 'uid': '7c8c8806-33ae-4a1a-ad4d-f890c7ce977c'}, 'spec': {'active_deadline_seconds': None, 'backoff_limit': 6, 'completions': 1, 'manual_selector': None, 'parallelism': 1, 'selector': {'match_expressions': None, 'match_labels': {'controller-uid': '7c8c8806-33ae-4a1a-ad4d-f890c7ce977c'}}, 'template': {'metadata': {'annotations': None, 'cluster_name': None, 'creation_timestamp': None, 'deletion_grace_period_seconds': None, 'deletion_timestamp': None, 'finalizers': None, 'generate_name': None, 'generation': None, 'initializers': None, 'labels': {'app': 'kube-bench', 'controller-uid': '7c8c8806-33ae-4a1a-ad4d-f890c7ce977c', 'job-name': 'kube-bench'}, 'managed_fields': None, 'name': None, 'namespace': None, 'owner_references': None, 'resource_version': None, 'self_link': None, 'uid': None}, 'spec': {'active_deadline_seconds': None, 'affinity': None, 'automount_service_account_token': None, 'containers': [{'args': None, 'command': ['kube-bench'], 'env': None, 'env_from': None, 'image': 'aquasec/kube-bench:latest', 'image_pull_policy': 'Always', 'lifecycle': None, 'liveness_probe': None, 'name': 'kube-bench', 'ports': None, 'readiness_probe': None, 'resources': {'limits': None, 'requests': None}, 'security_context': None, 'stdin': None, 'stdin_once': None, 'termination_message_path': '/dev/termination-log', 'termination_message_policy': 'File', 'tty': None, 'volume_devices': None, 'volume_mounts': [{'mount_path': '/var/lib/etcd', 'mount_propagation': None, 'name': 'var-lib-etcd', 'read_only': True, 'sub_path': None, 'sub_path_expr': None}, {'mount_path': '/var/lib/kubelet', 'mount_propagation': None, 'name': 'var-lib-kubelet', 'read_only': True, 'sub_path': None, 'sub_path_expr': None}, {'mount_path': '/etc/systemd', 'mount_propagation': None, 'name': 'etc-systemd', 'read_only': True, 'sub_path': None, 'sub_path_expr': None}, {'mount_path': '/etc/kubernetes', 'mount_propagation': None, 'name': 'etc-kubernetes', 'read_only': True, 'sub_path': None, 'sub_path_expr': None}, {'mount_path': '/usr/local/mount-from-host/bin', 'mount_propagation': None, 'name': 'usr-bin', 'read_only': True, 'sub_path': None, 'sub_path_expr': None}], 'working_dir': None}], 'dns_config': None, 'dns_policy': 'ClusterFirst', 'enable_service_links': None, 'host_aliases': None, 'host_ipc': None, 'host_network': None, 'host_pid': True, 'hostname': None, 'image_pull_secrets': None, 'init_containers': None, 'node_name': None, 'node_selector': None, 'preemption_policy': None, 'priority': None, 'priority_class_name': None, 'readiness_gates': None, 'restart_policy': 'Never', 'runtime_class_name': None, 'scheduler_name': 'default-scheduler', 'security_context': {'fs_group': None, 'run_as_group': None, 'run_as_non_root': None, 'run_as_user': None, 'se_linux_options': None, 'supplemental_groups': None, 'sysctls': None, 'windows_options': None}, 'service_account': None, 'service_account_name': None, 'share_process_namespace': None, 'subdomain': None, 'termination_grace_period_seconds': 30, 'tolerations': None, 'volumes': [{'aws_elastic_block_store': None, 'azure_disk': None, 'azure_file': None, 'cephfs': None, 'cinder': None, 'config_map': None, 'csi': None, 'downward_api': None, 'empty_dir': None, 'fc': None, 'flex_volume': None, 'flocker': None, 'gce_persistent_disk': None, 'git_repo': None, 'glusterfs': None, 'host_path': {'path': '/var/lib/etcd', 'type': ''}, 'iscsi': None, 'name': 'var-lib-etcd', 'nfs': None, 'persistent_volume_claim': None, 'photon_persistent_disk': None, 'portworx_volume': None, 'projected': None, 'quobyte': None, 'rbd': None, 'scale_io': None, 'secret': None, 'storageos': None, 'vsphere_volume': None}, {'aws_elastic_block_store': None, 'azure_disk': None, 'azure_file': None, 'cephfs': None, 'cinder': None, 'config_map': None, 'csi': None, 'downward_api': None, 'empty_dir': None, 'fc': None, 'flex_volume': None, 'flocker': None, 'gce_persistent_disk': None, 'git_repo': None, 'glusterfs': None, 'host_path': {'path': '/var/lib/kubelet', 'type': ''}, 'iscsi': None, 'name': 'var-lib-kubelet', 'nfs': None, 'persistent_volume_claim': None, 'photon_persistent_disk': None, 'portworx_volume': None, 'projected': None, 'quobyte': None, 'rbd': None, 'scale_io': None, 'secret': None, 'storageos': None, 'vsphere_volume': None}, {'aws_elastic_block_store': None, 'azure_disk': None, 'azure_file': None, 'cephfs': None, 'cinder': None, 'config_map': None, 'csi': None, 'downward_api': None, 'empty_dir': None, 'fc': None, 'flex_volume': None, 'flocker': None, 'gce_persistent_disk': None, 'git_repo': None, 'glusterfs': None, 'host_path': {'path': '/etc/systemd', 'type': ''}, 'iscsi': None, 'name': 'etc-systemd', 'nfs': None, 'persistent_volume_claim': None, 'photon_persistent_disk': None, 'portworx_volume': None, 'projected': None, 'quobyte': None, 'rbd': None, 'scale_io': None, 'secret': None, 'storageos': None, 'vsphere_volume': None}, {'aws_elastic_block_store': None, 'azure_disk': None, 'azure_file': None, 'cephfs': None, 'cinder': None, 'config_map': None, 'csi': None, 'downward_api': None, 'empty_dir': None, 'fc': None, 'flex_volume': None, 'flocker': None, 'gce_persistent_disk': None, 'git_repo': None, 'glusterfs': None, 'host_path': {'path': '/etc/kubernetes', 'type': ''}, 'iscsi': None, 'name': 'etc-kubernetes', 'nfs': None, 'persistent_volume_claim': None, 'photon_persistent_disk': None, 'portworx_volume': None, 'projected': None, 'quobyte': None, 'rbd': None, 'scale_io': None, 'secret': None, 'storageos': None, 'vsphere_volume': None}, {'aws_elastic_block_store': None, 'azure_disk': None, 'azure_file': None, 'cephfs': None, 'cinder': None, 'config_map': None, 'csi': None, 'downward_api': None, 'empty_dir': None, 'fc': None, 'flex_volume': None, 'flocker': None, 'gce_persistent_disk': None, 'git_repo': None, 'glusterfs': None, 'host_path': {'path': '/usr/bin', 'type': ''}, 'iscsi': None, 'name': 'usr-bin', 'nfs': None, 'persistent_volume_claim': None, 'photon_persistent_disk': None, 'portworx_volume': None, 'projected': None, 'quobyte': None, 'rbd': None, 'scale_io': None, 'secret': None, 'storageos': None, 'vsphere_volume': None}]}}, 'ttl_seconds_after_finished': None}, 'status': {'active': None, 'completion_time': None, 'conditions': None, 'failed': None, 'start_time': None, 'succeeded': None}} 2020-06-12 12:09:35,431 - functest_kubernetes.security.security - INFO - kube-bench started in 10.55 sec 2020-06-12 12:09:35,462 - kubernetes.client.rest - DEBUG - response body: {"kind":"PodList","apiVersion":"v1","metadata":{"selfLink":"/api/v1/namespaces/default/pods","resourceVersion":"11791546"},"items":[{"metadata":{"name":"kube-bench-4n5f2","generateName":"kube-bench-","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/kube-bench-4n5f2","uid":"ba16681f-1ee8-4ffb-8af4-593159b5ff8f","resourceVersion":"11791544","creationTimestamp":"2020-06-12T12:09:24Z","labels":{"app":"kube-bench","controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","job-name":"kube-bench"},"ownerReferences":[{"apiVersion":"batch/v1","kind":"Job","name":"kube-bench","uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2020-06-12T12:09:24Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:controller-uid":{},"f:job-name":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c\"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}},"f:spec":{"f:containers":{"k:{\"name\":\"kube-bench\"}":{".":{},"f:command":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{\"mountPath\":\"/etc/kubernetes\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/etc/systemd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/usr/local/mount-from-host/bin\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/etcd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/kubelet\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:hostPID":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{\"name\":\"etc-kubernetes\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"etc-systemd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"usr-bin\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-etcd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-kubelet\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2020-06-12T12:09:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"10.244.1.54\"}":{".":{},"f:ip":{}}},"f:startTime":{}}}}]},"spec":{"volumes":[{"name":"var-lib-etcd","hostPath":{"path":"/var/lib/etcd","type":""}},{"name":"var-lib-kubelet","hostPath":{"path":"/var/lib/kubelet","type":""}},{"name":"etc-systemd","hostPath":{"path":"/etc/systemd","type":""}},{"name":"etc-kubernetes","hostPath":{"path":"/etc/kubernetes","type":""}},{"name":"usr-bin","hostPath":{"path":"/usr/bin","type":""}},{"name":"default-token-7px8b","secret":{"secretName":"default-token-7px8b","defaultMode":420}}],"containers":[{"name":"kube-bench","image":"aquasec/kube-bench:latest","command":["kube-bench"],"resources":{},"volumeMounts":[{"name":"var-lib-etcd","readOnly":true,"mountPath":"/var/lib/etcd"},{"name":"var-lib-kubelet","readOnly":true,"mountPath":"/var/lib/kubelet"},{"name":"etc-systemd","readOnly":true,"mountPath":"/etc/systemd"},{"name":"etc-kubernetes","readOnly":true,"mountPath":"/etc/kubernetes"},{"name":"usr-bin","readOnly":true,"mountPath":"/usr/local/mount-from-host/bin"},{"name":"default-token-7px8b","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always"}],"restartPolicy":"Never","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","nodeName":"kali-worker2","hostPID":true,"securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true},"status":{"phase":"Succeeded","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:25Z","reason":"PodCompleted"},{"type":"Ready","status":"False","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:35Z","reason":"PodCompleted"},{"type":"ContainersReady","status":"False","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:35Z","reason":"PodCompleted"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:24Z"}],"hostIP":"172.17.0.18","podIP":"10.244.1.54","podIPs":[{"ip":"10.244.1.54"}],"startTime":"2020-06-12T12:09:25Z","containerStatuses":[{"name":"kube-bench","state":{"terminated":{"exitCode":0,"reason":"Completed","startedAt":"2020-06-12T12:09:33Z","finishedAt":"2020-06-12T12:09:34Z","containerID":"containerd://fb92818ab808e488dee73b4255e519e6c0dfb3cc2f0cd35f6c67670ee9bfad78"}},"lastState":{},"ready":false,"restartCount":0,"image":"docker.io/aquasec/kube-bench:latest","imageID":"docker.io/aquasec/kube-bench@sha256:a3fe72ad3946d830134b92e5c922a92d4aeb594f0445d178f9e2d610b1be04b5","containerID":"containerd://fb92818ab808e488dee73b4255e519e6c0dfb3cc2f0cd35f6c67670ee9bfad78","started":false}],"qosClass":"BestEffort"}}]} 2020-06-12 12:09:35,492 - kubernetes.client.rest - DEBUG - response body: [INFO] 4 Worker Node Security Configuration [INFO] 4.1 Worker Node Configuration Files [PASS] 4.1.1 Ensure that the kubelet service file permissions are set to 644 or more restrictive (Scored) [PASS] 4.1.2 Ensure that the kubelet service file ownership is set to root:root (Scored) [FAIL] 4.1.3 Ensure that the proxy kubeconfig file permissions are set to 644 or more restrictive (Scored) [FAIL] 4.1.4 Ensure that the proxy kubeconfig file ownership is set to root:root (Scored) [PASS] 4.1.5 Ensure that the kubelet.conf file permissions are set to 644 or more restrictive (Scored) [PASS] 4.1.6 Ensure that the kubelet.conf file ownership is set to root:root (Scored) [WARN] 4.1.7 Ensure that the certificate authorities file permissions are set to 644 or more restrictive (Scored) [PASS] 4.1.8 Ensure that the client certificate authorities file ownership is set to root:root (Scored) [PASS] 4.1.9 Ensure that the kubelet configuration file has permissions set to 644 or more restrictive (Scored) [PASS] 4.1.10 Ensure that the kubelet configuration file ownership is set to root:root (Scored) [INFO] 4.2 Kubelet [PASS] 4.2.1 Ensure that the --anonymous-auth argument is set to false (Scored) [PASS] 4.2.2 Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored) [PASS] 4.2.3 Ensure that the --client-ca-file argument is set as appropriate (Scored) [FAIL] 4.2.4 Ensure that the --read-only-port argument is set to 0 (Scored) [PASS] 4.2.5 Ensure that the --streaming-connection-idle-timeout argument is not set to 0 (Scored) [FAIL] 4.2.6 Ensure that the --protect-kernel-defaults argument is set to true (Scored) [PASS] 4.2.7 Ensure that the --make-iptables-util-chains argument is set to true (Scored) [PASS] 4.2.8 Ensure that the --hostname-override argument is not set (Not Scored) [WARN] 4.2.9 Ensure that the --event-qps argument is set to 0 or a level which ensures appropriate event capture (Not Scored) [FAIL] 4.2.10 Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Scored) [PASS] 4.2.11 Ensure that the --rotate-certificates argument is not set to false (Scored) [FAIL] 4.2.12 Ensure that the RotateKubeletServerCertificate argument is set to true (Scored) [WARN] 4.2.13 Ensure that the Kubelet only makes use of Strong Cryptographic Ciphers (Not Scored) == Remediations == 4.1.3 Run the below command (based on the file location on your system) on the each worker node. For example, chmod 644 /etc/kubernetes/proxy.conf 4.1.4 Run the below command (based on the file location on your system) on the each worker node. For example, chown root:root /etc/kubernetes/proxy.conf 4.1.7 audit test did not run: There are no tests 4.2.4 If using a Kubelet config file, edit the file to set readOnlyPort to 0. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable. --read-only-port=0 Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.6 If using a Kubelet config file, edit the file to set protectKernelDefaults: true. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable. --protect-kernel-defaults=true Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.9 If using a Kubelet config file, edit the file to set eventRecordQPS: to an appropriate level. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable. Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.10 If using a Kubelet config file, edit the file to set tlsCertFile to the location of the certificate file to use to identify this Kubelet, and tlsPrivateKeyFile to the location of the corresponding private key file. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameters in KUBELET_CERTIFICATE_ARGS variable. --tls-cert-file= --tls-private-key-file= Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.12 Edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_CERTIFICATE_ARGS variable. --feature-gates=RotateKubeletServerCertificate=true Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.13 If using a Kubelet config file, edit the file to set TLSCipherSuites: to 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 or to a subset of these values. If using executable arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the --tls-cipher-suites parameter as follows, or to a subset of these values. --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 Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service == Summary == 14 checks PASS 6 checks FAIL 3 checks WARN 0 checks INFO [INFO] 5 Kubernetes Policies [INFO] 5.1 RBAC and Service Accounts [WARN] 5.1.1 Ensure that the cluster-admin role is only used where required (Not Scored) [WARN] 5.1.2 Minimize access to secrets (Not Scored) [WARN] 5.1.3 Minimize wildcard use in Roles and ClusterRoles (Not Scored) [WARN] 5.1.4 Minimize access to create pods (Not Scored) [WARN] 5.1.5 Ensure that default service accounts are not actively used. (Scored) [WARN] 5.1.6 Ensure that Service Account Tokens are only mounted where necessary (Not Scored) [INFO] 5.2 Pod Security Policies [WARN] 5.2.1 Minimize the admission of privileged containers (Not Scored) [WARN] 5.2.2 Minimize the admission of containers wishing to share the host process ID namespace (Scored) [WARN] 5.2.3 Minimize the admission of containers wishing to share the host IPC namespace (Scored) [WARN] 5.2.4 Minimize the admission of containers wishing to share the host network namespace (Scored) [WARN] 5.2.5 Minimize the admission of containers with allowPrivilegeEscalation (Scored) [WARN] 5.2.6 Minimize the admission of root containers (Not Scored) [WARN] 5.2.7 Minimize the admission of containers with the NET_RAW capability (Not Scored) [WARN] 5.2.8 Minimize the admission of containers with added capabilities (Not Scored) [WARN] 5.2.9 Minimize the admission of containers with capabilities assigned (Not Scored) [INFO] 5.3 Network Policies and CNI [WARN] 5.3.1 Ensure that the CNI in use supports Network Policies (Not Scored) [WARN] 5.3.2 Ensure that all Namespaces have Network Policies defined (Scored) [INFO] 5.4 Secrets Management [WARN] 5.4.1 Prefer using secrets as files over secrets as environment variables (Not Scored) [WARN] 5.4.2 Consider external secret storage (Not Scored) [INFO] 5.5 Extensible Admission Control [WARN] 5.5.1 Configure Image Provenance using ImagePolicyWebhook admission controller (Not Scored) [INFO] 5.6 General Policies [WARN] 5.6.1 Create administrative boundaries between resources using namespaces (Not Scored) [WARN] 5.6.2 Ensure that the seccomp profile is set to docker/default in your pod definitions (Not Scored) [WARN] 5.6.3 Apply Security Context to Your Pods and Containers (Not Scored) [WARN] 5.6.4 The default namespace should not be used (Scored) == Remediations == 5.1.1 Identify all clusterrolebindings to the cluster-admin role. Check if they are used and if they need this role or if they could use a role with fewer privileges. Where possible, first bind users to a lower privileged role and then remove the clusterrolebinding to the cluster-admin role : kubectl delete clusterrolebinding [name] 5.1.2 Where possible, remove get, list and watch access to secret objects in the cluster. 5.1.3 Where possible replace any use of wildcards in clusterroles and roles with specific objects or actions. 5.1.4 Where possible, remove create access to pod objects in the cluster. 5.1.5 Create explicit service accounts wherever a Kubernetes workload requires specific access to the Kubernetes API server. Modify the configuration of each default service account to include this value automountServiceAccountToken: false 5.1.6 Modify the definition of pods and service accounts which do not need to mount service account tokens to disable it. 5.2.1 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.privileged field is omitted or set to false. 5.2.2 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostPID field is omitted or set to false. 5.2.3 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostIPC field is omitted or set to false. 5.2.4 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostNetwork field is omitted or set to false. 5.2.5 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.allowPrivilegeEscalation field is omitted or set to false. 5.2.6 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.runAsUser.rule is set to either MustRunAsNonRoot or MustRunAs with the range of UIDs not including 0. 5.2.7 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.requiredDropCapabilities is set to include either NET_RAW or ALL. 5.2.8 Ensure that allowedCapabilities is not present in PSPs for the cluster unless it is set to an empty array. 5.2.9 Review the use of capabilites in applications runnning on your cluster. Where a namespace contains applicaions which do not require any Linux capabities to operate consider adding a PSP which forbids the admission of containers which do not drop all capabilities. 5.3.1 If the CNI plugin in use does not support network policies, consideration should be given to making use of a different plugin, or finding an alternate mechanism for restricting traffic in the Kubernetes cluster. 5.3.2 Follow the documentation and create NetworkPolicy objects as you need them. 5.4.1 if possible, rewrite application code to read secrets from mounted secret files, rather than from environment variables. 5.4.2 Refer to the secrets management options offered by your cloud provider or a third-party secrets management solution. 5.5.1 Follow the Kubernetes documentation and setup image provenance. 5.6.1 Follow the documentation and create namespaces for objects in your deployment as you need them. 5.6.2 Seccomp is an alpha feature currently. By default, all alpha features are disabled. So, you would need to enable alpha features in the apiserver by passing "--feature- gates=AllAlpha=true" argument. Edit the /etc/kubernetes/apiserver file on the master node and set the KUBE_API_ARGS parameter to "--feature-gates=AllAlpha=true" KUBE_API_ARGS="--feature-gates=AllAlpha=true" Based on your system, restart the kube-apiserver service. For example: systemctl restart kube-apiserver.service Use annotations to enable the docker/default seccomp profile in your pod definitions. An example is as below: apiVersion: v1 kind: Pod metadata: name: trustworthy-pod annotations: seccomp.security.alpha.kubernetes.io/pod: docker/default spec: containers: - name: trustworthy-container image: sotrustworthy:latest 5.6.3 Follow the Kubernetes documentation and apply security contexts to your pods. For a suggested list of security contexts, you may refer to the CIS Security Benchmark for Docker Containers. 5.6.4 Ensure that namespaces are created to allow for appropriate segregation of Kubernetes resources and that all new resources are created in a specific namespace. == Summary == 0 checks PASS 0 checks FAIL 24 checks WARN 0 checks INFO 2020-06-12 12:09:35,493 - functest_kubernetes.security.security - WARNING - [INFO] 4 Worker Node Security Configuration [INFO] 4.1 Worker Node Configuration Files [PASS] 4.1.1 Ensure that the kubelet service file permissions are set to 644 or more restrictive (Scored) [PASS] 4.1.2 Ensure that the kubelet service file ownership is set to root:root (Scored) [FAIL] 4.1.3 Ensure that the proxy kubeconfig file permissions are set to 644 or more restrictive (Scored) [FAIL] 4.1.4 Ensure that the proxy kubeconfig file ownership is set to root:root (Scored) [PASS] 4.1.5 Ensure that the kubelet.conf file permissions are set to 644 or more restrictive (Scored) [PASS] 4.1.6 Ensure that the kubelet.conf file ownership is set to root:root (Scored) [WARN] 4.1.7 Ensure that the certificate authorities file permissions are set to 644 or more restrictive (Scored) [PASS] 4.1.8 Ensure that the client certificate authorities file ownership is set to root:root (Scored) [PASS] 4.1.9 Ensure that the kubelet configuration file has permissions set to 644 or more restrictive (Scored) [PASS] 4.1.10 Ensure that the kubelet configuration file ownership is set to root:root (Scored) [INFO] 4.2 Kubelet [PASS] 4.2.1 Ensure that the --anonymous-auth argument is set to false (Scored) [PASS] 4.2.2 Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored) [PASS] 4.2.3 Ensure that the --client-ca-file argument is set as appropriate (Scored) [FAIL] 4.2.4 Ensure that the --read-only-port argument is set to 0 (Scored) [PASS] 4.2.5 Ensure that the --streaming-connection-idle-timeout argument is not set to 0 (Scored) [FAIL] 4.2.6 Ensure that the --protect-kernel-defaults argument is set to true (Scored) [PASS] 4.2.7 Ensure that the --make-iptables-util-chains argument is set to true (Scored) [PASS] 4.2.8 Ensure that the --hostname-override argument is not set (Not Scored) [WARN] 4.2.9 Ensure that the --event-qps argument is set to 0 or a level which ensures appropriate event capture (Not Scored) [FAIL] 4.2.10 Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Scored) [PASS] 4.2.11 Ensure that the --rotate-certificates argument is not set to false (Scored) [FAIL] 4.2.12 Ensure that the RotateKubeletServerCertificate argument is set to true (Scored) [WARN] 4.2.13 Ensure that the Kubelet only makes use of Strong Cryptographic Ciphers (Not Scored) == Remediations == 4.1.3 Run the below command (based on the file location on your system) on the each worker node. For example, chmod 644 /etc/kubernetes/proxy.conf 4.1.4 Run the below command (based on the file location on your system) on the each worker node. For example, chown root:root /etc/kubernetes/proxy.conf 4.1.7 audit test did not run: There are no tests 4.2.4 If using a Kubelet config file, edit the file to set readOnlyPort to 0. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable. --read-only-port=0 Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.6 If using a Kubelet config file, edit the file to set protectKernelDefaults: true. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable. --protect-kernel-defaults=true Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.9 If using a Kubelet config file, edit the file to set eventRecordQPS: to an appropriate level. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable. Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.10 If using a Kubelet config file, edit the file to set tlsCertFile to the location of the certificate file to use to identify this Kubelet, and tlsPrivateKeyFile to the location of the corresponding private key file. If using command line arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameters in KUBELET_CERTIFICATE_ARGS variable. --tls-cert-file= --tls-private-key-file= Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.12 Edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the below parameter in KUBELET_CERTIFICATE_ARGS variable. --feature-gates=RotateKubeletServerCertificate=true Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service 4.2.13 If using a Kubelet config file, edit the file to set TLSCipherSuites: to 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 or to a subset of these values. If using executable arguments, edit the kubelet service file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on each worker node and set the --tls-cipher-suites parameter as follows, or to a subset of these values. --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 Based on your system, restart the kubelet service. For example: systemctl daemon-reload systemctl restart kubelet.service == Summary == 14 checks PASS 6 checks FAIL 3 checks WARN 0 checks INFO [INFO] 5 Kubernetes Policies [INFO] 5.1 RBAC and Service Accounts [WARN] 5.1.1 Ensure that the cluster-admin role is only used where required (Not Scored) [WARN] 5.1.2 Minimize access to secrets (Not Scored) [WARN] 5.1.3 Minimize wildcard use in Roles and ClusterRoles (Not Scored) [WARN] 5.1.4 Minimize access to create pods (Not Scored) [WARN] 5.1.5 Ensure that default service accounts are not actively used. (Scored) [WARN] 5.1.6 Ensure that Service Account Tokens are only mounted where necessary (Not Scored) [INFO] 5.2 Pod Security Policies [WARN] 5.2.1 Minimize the admission of privileged containers (Not Scored) [WARN] 5.2.2 Minimize the admission of containers wishing to share the host process ID namespace (Scored) [WARN] 5.2.3 Minimize the admission of containers wishing to share the host IPC namespace (Scored) [WARN] 5.2.4 Minimize the admission of containers wishing to share the host network namespace (Scored) [WARN] 5.2.5 Minimize the admission of containers with allowPrivilegeEscalation (Scored) [WARN] 5.2.6 Minimize the admission of root containers (Not Scored) [WARN] 5.2.7 Minimize the admission of containers with the NET_RAW capability (Not Scored) [WARN] 5.2.8 Minimize the admission of containers with added capabilities (Not Scored) [WARN] 5.2.9 Minimize the admission of containers with capabilities assigned (Not Scored) [INFO] 5.3 Network Policies and CNI [WARN] 5.3.1 Ensure that the CNI in use supports Network Policies (Not Scored) [WARN] 5.3.2 Ensure that all Namespaces have Network Policies defined (Scored) [INFO] 5.4 Secrets Management [WARN] 5.4.1 Prefer using secrets as files over secrets as environment variables (Not Scored) [WARN] 5.4.2 Consider external secret storage (Not Scored) [INFO] 5.5 Extensible Admission Control [WARN] 5.5.1 Configure Image Provenance using ImagePolicyWebhook admission controller (Not Scored) [INFO] 5.6 General Policies [WARN] 5.6.1 Create administrative boundaries between resources using namespaces (Not Scored) [WARN] 5.6.2 Ensure that the seccomp profile is set to docker/default in your pod definitions (Not Scored) [WARN] 5.6.3 Apply Security Context to Your Pods and Containers (Not Scored) [WARN] 5.6.4 The default namespace should not be used (Scored) == Remediations == 5.1.1 Identify all clusterrolebindings to the cluster-admin role. Check if they are used and if they need this role or if they could use a role with fewer privileges. Where possible, first bind users to a lower privileged role and then remove the clusterrolebinding to the cluster-admin role : kubectl delete clusterrolebinding [name] 5.1.2 Where possible, remove get, list and watch access to secret objects in the cluster. 5.1.3 Where possible replace any use of wildcards in clusterroles and roles with specific objects or actions. 5.1.4 Where possible, remove create access to pod objects in the cluster. 5.1.5 Create explicit service accounts wherever a Kubernetes workload requires specific access to the Kubernetes API server. Modify the configuration of each default service account to include this value automountServiceAccountToken: false 5.1.6 Modify the definition of pods and service accounts which do not need to mount service account tokens to disable it. 5.2.1 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.privileged field is omitted or set to false. 5.2.2 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostPID field is omitted or set to false. 5.2.3 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostIPC field is omitted or set to false. 5.2.4 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.hostNetwork field is omitted or set to false. 5.2.5 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.allowPrivilegeEscalation field is omitted or set to false. 5.2.6 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.runAsUser.rule is set to either MustRunAsNonRoot or MustRunAs with the range of UIDs not including 0. 5.2.7 Create a PSP as described in the Kubernetes documentation, ensuring that the .spec.requiredDropCapabilities is set to include either NET_RAW or ALL. 5.2.8 Ensure that allowedCapabilities is not present in PSPs for the cluster unless it is set to an empty array. 5.2.9 Review the use of capabilites in applications runnning on your cluster. Where a namespace contains applicaions which do not require any Linux capabities to operate consider adding a PSP which forbids the admission of containers which do not drop all capabilities. 5.3.1 If the CNI plugin in use does not support network policies, consideration should be given to making use of a different plugin, or finding an alternate mechanism for restricting traffic in the Kubernetes cluster. 5.3.2 Follow the documentation and create NetworkPolicy objects as you need them. 5.4.1 if possible, rewrite application code to read secrets from mounted secret files, rather than from environment variables. 5.4.2 Refer to the secrets management options offered by your cloud provider or a third-party secrets management solution. 5.5.1 Follow the Kubernetes documentation and setup image provenance. 5.6.1 Follow the documentation and create namespaces for objects in your deployment as you need them. 5.6.2 Seccomp is an alpha feature currently. By default, all alpha features are disabled. So, you would need to enable alpha features in the apiserver by passing "--feature- gates=AllAlpha=true" argument. Edit the /etc/kubernetes/apiserver file on the master node and set the KUBE_API_ARGS parameter to "--feature-gates=AllAlpha=true" KUBE_API_ARGS="--feature-gates=AllAlpha=true" Based on your system, restart the kube-apiserver service. For example: systemctl restart kube-apiserver.service Use annotations to enable the docker/default seccomp profile in your pod definitions. An example is as below: apiVersion: v1 kind: Pod metadata: name: trustworthy-pod annotations: seccomp.security.alpha.kubernetes.io/pod: docker/default spec: containers: - name: trustworthy-container image: sotrustworthy:latest 5.6.3 Follow the Kubernetes documentation and apply security contexts to your pods. For a suggested list of security contexts, you may refer to the CIS Security Benchmark for Docker Containers. 5.6.4 Ensure that namespaces are created to allow for appropriate segregation of Kubernetes resources and that all new resources are created in a specific namespace. == Summary == 0 checks PASS 0 checks FAIL 24 checks WARN 0 checks INFO 2020-06-12 12:09:35,494 - xtesting.ci.run_tests - INFO - Test result: +--------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +--------------------+------------------+------------------+----------------+ | kube_bench | functest | 00:11 | PASS | +--------------------+------------------+------------------+----------------+ 2020-06-12 12:09:35,524 - kubernetes.client.rest - DEBUG - response body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"kube-bench-4n5f2","generateName":"kube-bench-","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/kube-bench-4n5f2","uid":"ba16681f-1ee8-4ffb-8af4-593159b5ff8f","resourceVersion":"11791547","creationTimestamp":"2020-06-12T12:09:24Z","deletionTimestamp":"2020-06-12T12:09:35Z","deletionGracePeriodSeconds":0,"labels":{"app":"kube-bench","controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","job-name":"kube-bench"},"ownerReferences":[{"apiVersion":"batch/v1","kind":"Job","name":"kube-bench","uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2020-06-12T12:09:24Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:controller-uid":{},"f:job-name":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c\"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}},"f:spec":{"f:containers":{"k:{\"name\":\"kube-bench\"}":{".":{},"f:command":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{\"mountPath\":\"/etc/kubernetes\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/etc/systemd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/usr/local/mount-from-host/bin\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/etcd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/kubelet\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:hostPID":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{\"name\":\"etc-kubernetes\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"etc-systemd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"usr-bin\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-etcd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-kubelet\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2020-06-12T12:09:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"10.244.1.54\"}":{".":{},"f:ip":{}}},"f:startTime":{}}}}]},"spec":{"volumes":[{"name":"var-lib-etcd","hostPath":{"path":"/var/lib/etcd","type":""}},{"name":"var-lib-kubelet","hostPath":{"path":"/var/lib/kubelet","type":""}},{"name":"etc-systemd","hostPath":{"path":"/etc/systemd","type":""}},{"name":"etc-kubernetes","hostPath":{"path":"/etc/kubernetes","type":""}},{"name":"usr-bin","hostPath":{"path":"/usr/bin","type":""}},{"name":"default-token-7px8b","secret":{"secretName":"default-token-7px8b","defaultMode":420}}],"containers":[{"name":"kube-bench","image":"aquasec/kube-bench:latest","command":["kube-bench"],"resources":{},"volumeMounts":[{"name":"var-lib-etcd","readOnly":true,"mountPath":"/var/lib/etcd"},{"name":"var-lib-kubelet","readOnly":true,"mountPath":"/var/lib/kubelet"},{"name":"etc-systemd","readOnly":true,"mountPath":"/etc/systemd"},{"name":"etc-kubernetes","readOnly":true,"mountPath":"/etc/kubernetes"},{"name":"usr-bin","readOnly":true,"mountPath":"/usr/local/mount-from-host/bin"},{"name":"default-token-7px8b","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always"}],"restartPolicy":"Never","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","nodeName":"kali-worker2","hostPID":true,"securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true},"status":{"phase":"Succeeded","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:25Z","reason":"PodCompleted"},{"type":"Ready","status":"False","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:35Z","reason":"PodCompleted"},{"type":"ContainersReady","status":"False","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:35Z","reason":"PodCompleted"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2020-06-12T12:09:24Z"}],"hostIP":"172.17.0.18","podIP":"10.244.1.54","podIPs":[{"ip":"10.244.1.54"}],"startTime":"2020-06-12T12:09:25Z","containerStatuses":[{"name":"kube-bench","state":{"terminated":{"exitCode":0,"reason":"Completed","startedAt":"2020-06-12T12:09:33Z","finishedAt":"2020-06-12T12:09:34Z","containerID":"containerd://fb92818ab808e488dee73b4255e519e6c0dfb3cc2f0cd35f6c67670ee9bfad78"}},"lastState":{},"ready":false,"restartCount":0,"image":"docker.io/aquasec/kube-bench:latest","imageID":"docker.io/aquasec/kube-bench@sha256:a3fe72ad3946d830134b92e5c922a92d4aeb594f0445d178f9e2d610b1be04b5","containerID":"containerd://fb92818ab808e488dee73b4255e519e6c0dfb3cc2f0cd35f6c67670ee9bfad78","started":false}],"qosClass":"BestEffort"}} 2020-06-12 12:09:35,528 - functest_kubernetes.security.security - DEBUG - delete_namespaced_pod: {'api_version': 'v1', 'code': None, 'details': None, 'kind': 'Pod', 'message': None, 'metadata': {'_continue': None, 'remaining_item_count': None, 'resource_version': '11791547', 'self_link': '/api/v1/namespaces/default/pods/kube-bench-4n5f2'}, 'reason': None, 'status': "{'phase': 'Succeeded', 'conditions': [{'type': 'Initialized', " "'status': 'True', 'lastProbeTime': None, 'lastTransitionTime': " "'2020-06-12T12:09:25Z', 'reason': 'PodCompleted'}, {'type': " "'Ready', 'status': 'False', 'lastProbeTime': None, " "'lastTransitionTime': '2020-06-12T12:09:35Z', 'reason': " "'PodCompleted'}, {'type': 'ContainersReady', 'status': 'False', " "'lastProbeTime': None, 'lastTransitionTime': " "'2020-06-12T12:09:35Z', 'reason': 'PodCompleted'}, {'type': " "'PodScheduled', 'status': 'True', 'lastProbeTime': None, " "'lastTransitionTime': '2020-06-12T12:09:24Z'}], 'hostIP': " "'172.17.0.18', 'podIP': '10.244.1.54', 'podIPs': [{'ip': " "'10.244.1.54'}], 'startTime': '2020-06-12T12:09:25Z', " "'containerStatuses': [{'name': 'kube-bench', 'state': " "{'terminated': {'exitCode': 0, 'reason': 'Completed', 'startedAt': " "'2020-06-12T12:09:33Z', 'finishedAt': '2020-06-12T12:09:34Z', " "'containerID': " "'containerd://fb92818ab808e488dee73b4255e519e6c0dfb3cc2f0cd35f6c67670ee9bfad78'}}, " "'lastState': {}, 'ready': False, 'restartCount': 0, 'image': " "'docker.io/aquasec/kube-bench:latest', 'imageID': " "'docker.io/aquasec/kube-bench@sha256:a3fe72ad3946d830134b92e5c922a92d4aeb594f0445d178f9e2d610b1be04b5', " "'containerID': " "'containerd://fb92818ab808e488dee73b4255e519e6c0dfb3cc2f0cd35f6c67670ee9bfad78', " "'started': False}], 'qosClass': 'BestEffort'}"} 2020-06-12 12:09:35,739 - kubernetes.client.rest - DEBUG - response body: {"kind":"Job","apiVersion":"batch/v1","metadata":{"name":"kube-bench","namespace":"default","selfLink":"/apis/batch/v1/namespaces/default/jobs/kube-bench","uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","resourceVersion":"11791549","creationTimestamp":"2020-06-12T12:09:24Z","deletionTimestamp":"2020-06-12T12:09:35Z","deletionGracePeriodSeconds":0,"labels":{"app":"kube-bench","controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","job-name":"kube-bench"},"finalizers":["orphan"],"managedFields":[{"manager":"OpenAPI-Generator","operation":"Update","apiVersion":"batch/v1","time":"2020-06-12T12:09:24Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:backoffLimit":{},"f:completions":{},"f:parallelism":{},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"kube-bench\"}":{".":{},"f:command":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{\"mountPath\":\"/etc/kubernetes\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/etc/systemd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/usr/local/mount-from-host/bin\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/etcd\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}},"k:{\"mountPath\":\"/var/lib/kubelet\"}":{".":{},"f:mountPath":{},"f:name":{},"f:readOnly":{}}}}},"f:dnsPolicy":{},"f:hostPID":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{\"name\":\"etc-kubernetes\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"etc-systemd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"usr-bin\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-etcd\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}},"k:{\"name\":\"var-lib-kubelet\"}":{".":{},"f:hostPath":{".":{},"f:path":{},"f:type":{}},"f:name":{}}}}}}}},{"manager":"kube-controller-manager","operation":"Update","apiVersion":"batch/v1","time":"2020-06-12T12:09:35Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:completionTime":{},"f:conditions":{".":{},"k:{\"type\":\"Complete\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:startTime":{},"f:succeeded":{}}}}]},"spec":{"parallelism":1,"completions":1,"backoffLimit":6,"selector":{"matchLabels":{"controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"kube-bench","controller-uid":"7c8c8806-33ae-4a1a-ad4d-f890c7ce977c","job-name":"kube-bench"}},"spec":{"volumes":[{"name":"var-lib-etcd","hostPath":{"path":"/var/lib/etcd","type":""}},{"name":"var-lib-kubelet","hostPath":{"path":"/var/lib/kubelet","type":""}},{"name":"etc-systemd","hostPath":{"path":"/etc/systemd","type":""}},{"name":"etc-kubernetes","hostPath":{"path":"/etc/kubernetes","type":""}},{"name":"usr-bin","hostPath":{"path":"/usr/bin","type":""}}],"containers":[{"name":"kube-bench","image":"aquasec/kube-bench:latest","command":["kube-bench"],"resources":{},"volumeMounts":[{"name":"var-lib-etcd","readOnly":true,"mountPath":"/var/lib/etcd"},{"name":"var-lib-kubelet","readOnly":true,"mountPath":"/var/lib/kubelet"},{"name":"etc-systemd","readOnly":true,"mountPath":"/etc/systemd"},{"name":"etc-kubernetes","readOnly":true,"mountPath":"/etc/kubernetes"},{"name":"usr-bin","readOnly":true,"mountPath":"/usr/local/mount-from-host/bin"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always"}],"restartPolicy":"Never","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","hostPID":true,"securityContext":{},"schedulerName":"default-scheduler"}}},"status":{"conditions":[{"type":"Complete","status":"True","lastProbeTime":"2020-06-12T12:09:35Z","lastTransitionTime":"2020-06-12T12:09:35Z"}],"startTime":"2020-06-12T12:09:25Z","completionTime":"2020-06-12T12:09:35Z","succeeded":1}} 2020-06-12 12:09:35,775 - functest_kubernetes.security.security - DEBUG - delete_namespaced_deployment: {'api_version': 'batch/v1', 'code': None, 'details': None, 'kind': 'Job', 'message': None, 'metadata': {'_continue': None, 'remaining_item_count': None, 'resource_version': '11791549', 'self_link': '/apis/batch/v1/namespaces/default/jobs/kube-bench'}, 'reason': None, 'status': "{'conditions': [{'type': 'Complete', 'status': 'True', " "'lastProbeTime': '2020-06-12T12:09:35Z', 'lastTransitionTime': " "'2020-06-12T12:09:35Z'}], 'startTime': '2020-06-12T12:09:25Z', " "'completionTime': '2020-06-12T12:09:35Z', 'succeeded': 1}"} 2020-06-12 12:09:36,028 - xtesting.core.testcase - DEBUG - Publishing /var/lib/xtesting/results/functest-kubernetes.log ('text/plain', None) 2020-06-12 12:09:36,208 - xtesting.core.testcase - DEBUG - Publishing /var/lib/xtesting/results/functest-kubernetes.debug.log ('text/plain', None)