2020-03-16 17:02:58,445 - 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        |                                                                     H6GGV0X6WG9X                                                                    |
|        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/H6GGV0X6WG9X/functest-kubernetes-opnfv-functest-kubernetes-security-latest-kube_hunter-run-9      |
|       HTTP_DST_URL      |     http://artifacts.opnfv.org/functest-kubernetes/H6GGV0X6WG9X/functest-kubernetes-opnfv-functest-kubernetes-security-latest-kube_hunter-run-9     |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+

2020-03-16 17:02:58,450 - xtesting.ci.run_tests - DEBUG - No env file /var/lib/xtesting/conf/env_file found
2020-03-16 17:02:58,450 - xtesting.ci.run_tests - DEBUG - Test args: kube_hunter
2020-03-16 17:02:58,455 - xtesting.ci.run_tests - INFO - Loading test case 'kube_hunter'...
2020-03-16 17:02:58,727 - xtesting.ci.run_tests - INFO - Running test case 'kube_hunter'...
2020-03-16 17:02:58,745 - functest_kubernetes.security.security - INFO - Job kube-hunter created
2020-03-16 17:02:58,745 - 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, 3, 16, 17, 2, 58, tzinfo=tzlocal()),
              'deletion_grace_period_seconds': None,
              'deletion_timestamp': None,
              'finalizers': None,
              'generate_name': None,
              'generation': None,
              'initializers': None,
              'labels': {'controller-uid': '2bb4ae26-943e-4948-a25a-75c3b146f7c5',
                         'job-name': 'kube-hunter'},
              'managed_fields': None,
              'name': 'kube-hunter',
              'namespace': 'default',
              'owner_references': None,
              'resource_version': '338287',
              'self_link': '/apis/batch/v1/namespaces/default/jobs/kube-hunter',
              'uid': '2bb4ae26-943e-4948-a25a-75c3b146f7c5'},
 'spec': {'active_deadline_seconds': None,
          'backoff_limit': 4,
          'completions': 1,
          'manual_selector': None,
          'parallelism': 1,
          'selector': {'match_expressions': None,
                       'match_labels': {'controller-uid': '2bb4ae26-943e-4948-a25a-75c3b146f7c5'}},
          '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': {'controller-uid': '2bb4ae26-943e-4948-a25a-75c3b146f7c5',
                                               'job-name': 'kube-hunter'},
                                    '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': ['--pod'],
                                                'command': ['python',
                                                            'kube-hunter.py'],
                                                'env': None,
                                                'env_from': None,
                                                'image': 'aquasec/kube-hunter',
                                                'image_pull_policy': 'Always',
                                                'lifecycle': None,
                                                'liveness_probe': None,
                                                'name': 'kube-hunter',
                                                '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': 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': None,
                                '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': None}},
          'ttl_seconds_after_finished': None},
 'status': {'active': None,
            'completion_time': None,
            'conditions': None,
            'failed': None,
            'start_time': None,
            'succeeded': None}}
2020-03-16 17:03:30,184 - functest_kubernetes.security.security - INFO - kube-hunter started in 31.46 sec
2020-03-16 17:03:30,214 - functest_kubernetes.security.security - WARNING - 

2020-03-16 17:03:16,830 INFO kube_hunter.modules.report.collector Started hunting
2020-03-16 17:03:16,830 INFO kube_hunter.modules.report.collector Discovering Open Kubernetes Services
2020-03-16 17:03:16,839 INFO kube_hunter.modules.report.collector Found vulnerability "Read access to pod's service account token" in Local to Pod(kube-hunter-vxvp8)
2020-03-16 17:03:16,840 INFO kube_hunter.modules.report.collector Found vulnerability "CAP_NET_RAW Enabled" in Local to Pod(kube-hunter-vxvp8)
2020-03-16 17:03:16,843 INFO kube_hunter.modules.report.collector Found vulnerability "Access to pod's secrets" in Local to Pod(kube-hunter-vxvp8)
2020-03-16 17:03:17,205 INFO kube_hunter.modules.report.collector Found open service "Kubelet API" at 10.244.1.1:10250
2020-03-16 17:03:17,246 INFO kube_hunter.modules.report.collector Found open service "API Server" at 10.96.0.1:443
2020-03-16 17:03:17,290 INFO kube_hunter.modules.report.collector Found vulnerability "K8s Version Disclosure" in 10.96.0.1:443
2020-03-16 17:03:17,308 INFO kube_hunter.modules.report.collector Found vulnerability "Access to API using service account token" in 10.96.0.1:443

Nodes
+-------------+------------+
| TYPE        | LOCATION   |
+-------------+------------+
| Node/Master | 10.244.1.1 |
+-------------+------------+
| Node/Master | 10.96.0.1  |
+-------------+------------+

Detected Services
+-------------+------------------+----------------------+
| SERVICE     | LOCATION         | DESCRIPTION          |
+-------------+------------------+----------------------+
| Kubelet API | 10.244.1.1:10250 | The Kubelet is the   |
|             |                  | main component in    |
|             |                  | every Node, all pod  |
|             |                  | operations goes      |
|             |                  | through the kubelet  |
+-------------+------------------+----------------------+
| API Server  | 10.96.0.1:443    | The API server is in |
|             |                  | charge of all        |
|             |                  | operations on the    |
|             |                  | cluster.             |
+-------------+------------------+----------------------+

Vulnerabilities
For further information about a vulnerability, search its ID in: 
https://github.com/aquasecurity/kube-hunter/tree/master/docs/_kb
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+
| ID     | LOCATION             | CATEGORY             | VULNERABILITY        | DESCRIPTION          | EVIDENCE             |
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+
| KHV005 | 10.96.0.1:443        | Information          | Access to API using  | The API Server port  | b'{"kind":"APIVersio |
|        |                      | Disclosure           | service account      | is accessible.       | ns","versions":["v1" |
|        |                      |                      | token                |     Depending on     | ...                  |
|        |                      |                      |                      | your RBAC settings   |                      |
|        |                      |                      |                      | this could expose    |                      |
|        |                      |                      |                      | access to or control |                      |
|        |                      |                      |                      | of your cluster.     |                      |
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+
| KHV002 | 10.96.0.1:443        | Information          | K8s Version          | The kubernetes       | v1.17.0              |
|        |                      | Disclosure           | Disclosure           | version could be     |                      |
|        |                      |                      |                      | obtained from the    |                      |
|        |                      |                      |                      | /version endpoint    |                      |
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+
| None   | Local to Pod(kube-   | Access Risk          | CAP_NET_RAW Enabled  | CAP_NET_RAW is       |                      |
|        | hunter-vxvp8)        |                      |                      | enabled by default   |                      |
|        |                      |                      |                      | for pods.            |                      |
|        |                      |                      |                      |     If an attacker   |                      |
|        |                      |                      |                      | manages to           |                      |
|        |                      |                      |                      | compromise a pod,    |                      |
|        |                      |                      |                      |     they could       |                      |
|        |                      |                      |                      | potentially take     |                      |
|        |                      |                      |                      | advantage of this    |                      |
|        |                      |                      |                      | capability to        |                      |
|        |                      |                      |                      | perform network      |                      |
|        |                      |                      |                      |     attacks on other |                      |
|        |                      |                      |                      | pods running on the  |                      |
|        |                      |                      |                      | same node            |                      |
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+
| None   | Local to Pod(kube-   | Access Risk          | Access to pod's      |  Accessing the pod's | ['/var/run/secrets/k |
|        | hunter-vxvp8)        |                      | secrets              | secrets within a     | ubernetes.io/service |
|        |                      |                      |                      | compromised pod      | ...                  |
|        |                      |                      |                      | might disclose       |                      |
|        |                      |                      |                      | valuable data to a   |                      |
|        |                      |                      |                      | potential attacker   |                      |
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+
| KHV050 | Local to Pod(kube-   | Access Risk          | Read access to pod's |  Accessing the pod   | eyJhbGciOiJSUzI1NiIs |
|        | hunter-vxvp8)        |                      | service account      | service account      | ImtpZCI6IklmVnZsUzFz |
|        |                      |                      | token                | token gives an       | ...                  |
|        |                      |                      |                      | attacker the option  |                      |
|        |                      |                      |                      | to use the server    |                      |
|        |                      |                      |                      | API                  |                      |
+--------+----------------------+----------------------+----------------------+----------------------+----------------------+


2020-03-16 17:03:30,215 - xtesting.ci.run_tests - INFO - Test result:

+---------------------+------------------+------------------+----------------+
|      TEST CASE      |     PROJECT      |     DURATION     |     RESULT     |
+---------------------+------------------+------------------+----------------+
|     kube_hunter     |     functest     |      00:31       |      PASS      |
+---------------------+------------------+------------------+----------------+

2020-03-16 17:03:30,235 - 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': '338420',
              'self_link': '/api/v1/namespaces/default/pods/kube-hunter-vxvp8'},
 'reason': None,
 'status': "{'phase': 'Succeeded', 'conditions': [{'type': 'Initialized', "
           "'status': 'True', 'lastProbeTime': None, 'lastTransitionTime': "
           "'2020-03-16T17:02:58Z', 'reason': 'PodCompleted'}, {'type': "
           "'Ready', 'status': 'False', 'lastProbeTime': None, "
           "'lastTransitionTime': '2020-03-16T17:03:30Z', 'reason': "
           "'PodCompleted'}, {'type': 'ContainersReady', 'status': 'False', "
           "'lastProbeTime': None, 'lastTransitionTime': "
           "'2020-03-16T17:03:30Z', 'reason': 'PodCompleted'}, {'type': "
           "'PodScheduled', 'status': 'True', 'lastProbeTime': None, "
           "'lastTransitionTime': '2020-03-16T17:02:58Z'}], 'hostIP': "
           "'172.17.0.12', 'podIP': '10.244.1.135', 'podIPs': [{'ip': "
           "'10.244.1.135'}], 'startTime': '2020-03-16T17:02:58Z', "
           "'containerStatuses': [{'name': 'kube-hunter', 'state': "
           "{'terminated': {'exitCode': 0, 'reason': 'Completed', 'startedAt': "
           "'2020-03-16T17:03:16Z', 'finishedAt': '2020-03-16T17:03:29Z', "
           "'containerID': "
           "'containerd://19c33f0e98b144e781068860c7cc41916273cafb4c4cd52f5fec4e7ba96263f2'}}, "
           "'lastState': {}, 'ready': False, 'restartCount': 0, 'image': "
           "'docker.io/aquasec/kube-hunter:latest', 'imageID': "
           "'docker.io/aquasec/kube-hunter@sha256:563f44851d413c7199a0a8a2a13df1e98bee48229e19f4917e6da68e5482df6e', "
           "'containerID': "
           "'containerd://19c33f0e98b144e781068860c7cc41916273cafb4c4cd52f5fec4e7ba96263f2', "
           "'started': False}], 'qosClass': 'BestEffort'}"}
2020-03-16 17:03:30,256 - 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': '338422',
              'self_link': '/apis/batch/v1/namespaces/default/jobs/kube-hunter'},
 'reason': None,
 'status': "{'conditions': [{'type': 'Complete', 'status': 'True', "
           "'lastProbeTime': '2020-03-16T17:03:30Z', 'lastTransitionTime': "
           "'2020-03-16T17:03:30Z'}], 'startTime': '2020-03-16T17:02:58Z', "
           "'completionTime': '2020-03-16T17:03:30Z', 'succeeded': 1}"}
2020-03-16 17:03:30,527 - xtesting.core.testcase - DEBUG - Publishing /var/lib/xtesting/results/functest-kubernetes.log ('text/plain', None)
