2020-04-19 00:57:33,152 - 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        |                                                                     MV7TOCDIEQBB                                                                    |
|        NODE_NAME        |                                                                     lf-virtual8                                                                     |
|       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/MV7TOCDIEQBB/functest-kubernetes-opnfv-functest-kubernetes-security-latest-kube_bench-run-24      |
|       HTTP_DST_URL      |     http://artifacts.opnfv.org/functest-kubernetes/MV7TOCDIEQBB/functest-kubernetes-opnfv-functest-kubernetes-security-latest-kube_bench-run-24     |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+

2020-04-19 00:57:33,157 - xtesting.ci.run_tests - DEBUG - No env file /var/lib/xtesting/conf/env_file found
2020-04-19 00:57:33,158 - xtesting.ci.run_tests - DEBUG - Test args: kube_bench
2020-04-19 00:57:33,164 - xtesting.ci.run_tests - INFO - Loading test case 'kube_bench'...
2020-04-19 00:57:33,481 - xtesting.ci.run_tests - INFO - Running test case 'kube_bench'...
2020-04-19 00:57:33,511 - functest_kubernetes.security.security - INFO - Job kube-bench created
2020-04-19 00:57:33,512 - 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, 4, 19, 0, 57, 33, 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': '6121a062-45f5-4bda-92e1-915814e4d5a9',
                         'job-name': 'kube-bench'},
              'managed_fields': None,
              'name': 'kube-bench',
              'namespace': 'default',
              'owner_references': None,
              'resource_version': '9213902',
              'self_link': '/apis/batch/v1/namespaces/default/jobs/kube-bench',
              'uid': '6121a062-45f5-4bda-92e1-915814e4d5a9'},
 'spec': {'active_deadline_seconds': None,
          'backoff_limit': 6,
          'completions': 1,
          'manual_selector': None,
          'parallelism': 1,
          'selector': {'match_expressions': None,
                       'match_labels': {'controller-uid': '6121a062-45f5-4bda-92e1-915814e4d5a9'}},
          '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': '6121a062-45f5-4bda-92e1-915814e4d5a9',
                                               '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-04-19 00:57:40,153 - functest_kubernetes.security.security - INFO - kube-bench started in 6.67 sec
2020-04-19 00:57:40,208 - 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=<path/to/tls-certificate-file>
--tls-private-key-file=<path/to/tls-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 
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-04-19 00:57:40,208 - xtesting.ci.run_tests - INFO - Test result:

+--------------------+------------------+------------------+----------------+
|     TEST CASE      |     PROJECT      |     DURATION     |     RESULT     |
+--------------------+------------------+------------------+----------------+
|     kube_bench     |     functest     |      00:07       |      PASS      |
+--------------------+------------------+------------------+----------------+

2020-04-19 00:57:40,242 - 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': '9213940',
              'self_link': '/api/v1/namespaces/default/pods/kube-bench-hbl55'},
 'reason': None,
 'status': "{'phase': 'Succeeded', 'conditions': [{'type': 'Initialized', "
           "'status': 'True', 'lastProbeTime': None, 'lastTransitionTime': "
           "'2020-04-19T00:57:33Z', 'reason': 'PodCompleted'}, {'type': "
           "'Ready', 'status': 'False', 'lastProbeTime': None, "
           "'lastTransitionTime': '2020-04-19T00:57:40Z', 'reason': "
           "'PodCompleted'}, {'type': 'ContainersReady', 'status': 'False', "
           "'lastProbeTime': None, 'lastTransitionTime': "
           "'2020-04-19T00:57:40Z', 'reason': 'PodCompleted'}, {'type': "
           "'PodScheduled', 'status': 'True', 'lastProbeTime': None, "
           "'lastTransitionTime': '2020-04-19T00:57:33Z'}], 'hostIP': "
           "'172.17.0.12', 'podIP': '10.244.1.4', 'podIPs': [{'ip': "
           "'10.244.1.4'}], 'startTime': '2020-04-19T00:57:33Z', "
           "'containerStatuses': [{'name': 'kube-bench', 'state': "
           "{'terminated': {'exitCode': 0, 'reason': 'Completed', 'startedAt': "
           "'2020-04-19T00:57:38Z', 'finishedAt': '2020-04-19T00:57:39Z', "
           "'containerID': "
           "'containerd://e189f37afd20237d38bfadf5f8a88c83595bda9340d2352f1f688b7a9f39771f'}}, "
           "'lastState': {}, 'ready': False, 'restartCount': 0, 'image': "
           "'docker.io/aquasec/kube-bench:latest', 'imageID': "
           "'docker.io/aquasec/kube-bench@sha256:ee55386ef35bea93a3a0900fd714038bebd156e0448addf839f38093dbbaace9', "
           "'containerID': "
           "'containerd://e189f37afd20237d38bfadf5f8a88c83595bda9340d2352f1f688b7a9f39771f', "
           "'started': False}], 'qosClass': 'BestEffort'}"}
2020-04-19 00:57:40,263 - 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': '9213943',
              'self_link': '/apis/batch/v1/namespaces/default/jobs/kube-bench'},
 'reason': None,
 'status': "{'conditions': [{'type': 'Complete', 'status': 'True', "
           "'lastProbeTime': '2020-04-19T00:57:40Z', 'lastTransitionTime': "
           "'2020-04-19T00:57:40Z'}], 'startTime': '2020-04-19T00:57:33Z', "
           "'completionTime': '2020-04-19T00:57:40Z', 'succeeded': 1}"}
2020-04-19 00:57:40,526 - xtesting.core.testcase - DEBUG - Publishing /var/lib/xtesting/results/functest-kubernetes.log ('text/plain', None)
