2022-06-10 21:40:06,888 - xtesting.ci.run_tests - INFO - Deployment description: +-------------------------+------------------------------------------------------------+ | ENV VAR | VALUE | +-------------------------+------------------------------------------------------------+ | CI_LOOP | daily | | DEBUG | false | | DEPLOY_SCENARIO | k8-nosdn-nofeature-noha | | INSTALLER_TYPE | unknown | | BUILD_TAG | f845220c | | NODE_NAME | intel-pod19 | | TEST_DB_URL | http://testresults.opnfv.org/test/api/v1/results | | TEST_DB_EXT_URL | http://testresults.opnfv.org/test/api/v1/results | | S3_ENDPOINT_URL | https://storage.googleapis.com | | S3_DST_URL | s3://artifacts.opnfv.org/kuberef/f845220c/kube_hun | | | ter-2576027436 | | HTTP_DST_URL | http://artifacts.opnfv.org/kuberef/f845220c/kube_h | | | unter-2576027436 | +-------------------------+------------------------------------------------------------+ 2022-06-10 21:40:06,896 - xtesting.ci.run_tests - INFO - Loading test case 'kube_hunter'... 2022-06-10 21:40:07,158 - xtesting.ci.run_tests - INFO - Running test case 'kube_hunter'... 2022-06-10 21:40:07,220 - functest_kubernetes.security.security - INFO - Job kube-hunter created 2022-06-10 21:40:37,930 - functest_kubernetes.security.security - INFO - kube-hunter started in 30.77 sec 2022-06-10 21:40:37,959 - functest_kubernetes.security.security - INFO - 2022-06-10 21:40:19,375 INFO kube_hunter.modules.report.collector Started hunting 2022-06-10 21:40:19,375 INFO kube_hunter.modules.report.collector Discovering Open Kubernetes Services 2022-06-10 21:40:19,381 INFO kube_hunter.modules.report.collector Found vulnerability "Read access to pod's service account token" in Local to Pod (kube-hunter-q2ffv) 2022-06-10 21:40:19,381 INFO kube_hunter.modules.report.collector Found vulnerability "CAP_NET_RAW Enabled" in Local to Pod (kube-hunter-q2ffv) 2022-06-10 21:40:19,383 INFO kube_hunter.modules.report.collector Found vulnerability "Access to pod's secrets" in Local to Pod (kube-hunter-q2ffv) 2022-06-10 21:40:32,221 INFO kube_hunter.modules.report.collector Found open service "API Server" at 10.233.0.1:443 2022-06-10 21:40:32,285 INFO kube_hunter.modules.report.collector Found vulnerability "K8s Version Disclosure" in 10.233.0.1:443 2022-06-10 21:40:32,289 INFO kube_hunter.modules.report.collector Found vulnerability "Access to API using service account token" in 10.233.0.1:443 {"nodes": [{"type": "Node/Master", "location": "10.233.0.1"}], "services": [{"service": "API Server", "location": "10.233.0.1:443"}], "vulnerabilities": [{"location": "Local to Pod (kube-hunter-q2ffv)", "vid": "KHV050", "category": "Access Risk", "severity": "low", "vulnerability": "Read access to pod's service account token", "description": " Accessing the pod service account token gives an attacker the option to use the server API ", "evidence": "eyJhbGciOiJSUzI1NiIsImtpZCI6IkdON2dBYjVoZkMzajNod2ZMNDU1Q1dfWlBQeldoRWNDYmJuaTA1cl91XzQifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNjg2NDMzMjA3LCJpYXQiOjE2NTQ4OTcyMDcsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJrdWJlLWh1bnRlci05ZHg1cyIsInBvZCI6eyJuYW1lIjoia3ViZS1odW50ZXItcTJmZnYiLCJ1aWQiOiI0ODNhMGZhNC01MDlmLTQ5ODMtYmZjMi1iNjY5OTI2Y2ExZDAifSwic2VydmljZWFjY291bnQiOnsibmFtZSI6ImRlZmF1bHQiLCJ1aWQiOiI5YjBhNmY4Ny0wMTk5LTQ5MGYtOTA3OC01NWQwNTZhOTM1ZDkifSwid2FybmFmdGVyIjoxNjU0OTAwODE0fSwibmJmIjoxNjU0ODk3MjA3LCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1odW50ZXItOWR4NXM6ZGVmYXVsdCJ9.h6RrHZj6sn1LQYdihI2Z7s1piVP9j_T7WnppB6E_1qdMnqTaqLkmlidusKVQCFx6Xinv9U3oYoRMxPJN0kLiQ1K74S45PlKIPePw3qVaqzXhYkIPVbISYSboO4QjEr9goOPYm5nLQ2kIPHrC3bAcjkfQ5uqgjo_RMieT2nBdosQiaG4hwrBbPiU15o-VH6eC8lXdBQPNW5KMNNrJOOk9ePbwjGfCUK5lnLrB6_XbTO7diuGzbf2w38vYfuDyQirXPm1hCO020o_zLuBp63iXBn3NPV09y-50df5sIGGKpjHRWj8uBtrItOa8UkCngcf-aFU8nKmvrxv4I4mD3Dub1Q", "hunter": "Access Secrets"}, {"location": "Local to Pod (kube-hunter-q2ffv)", "vid": "None", "category": "Access Risk", "severity": "low", "vulnerability": "CAP_NET_RAW Enabled", "description": "CAP_NET_RAW is enabled by default for pods.\n If an attacker manages to compromise a pod,\n they could potentially take advantage of this capability to perform network\n attacks on other pods running on the same node", "evidence": "", "hunter": "Pod Capabilities Hunter"}, {"location": "Local to Pod (kube-hunter-q2ffv)", "vid": "None", "category": "Access Risk", "severity": "low", "vulnerability": "Access to pod's secrets", "description": " Accessing the pod's secrets within a compromised pod might disclose valuable data to a potential attacker", "evidence": "['/var/run/secrets/kubernetes.io/serviceaccount/namespace', '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt', '/var/run/secrets/kubernetes.io/serviceaccount/token', '/var/run/secrets/kubernetes.io/serviceaccount/..2022_06_10_21_40_07.046701997/namespace', '/var/run/secrets/kubernetes.io/serviceaccount/..2022_06_10_21_40_07.046701997/ca.crt', '/var/run/secrets/kubernetes.io/serviceaccount/..2022_06_10_21_40_07.046701997/token']", "hunter": "Access Secrets"}, {"location": "10.233.0.1:443", "vid": "KHV002", "category": "Information Disclosure", "severity": "medium", "vulnerability": "K8s Version Disclosure", "description": "The kubernetes version could be obtained from the /version endpoint ", "evidence": "v1.21.1", "hunter": "Api Version Hunter"}, {"location": "10.233.0.1:443", "vid": "KHV005", "category": "Information Disclosure", "severity": "medium", "vulnerability": "Access to API using service account token", "description": "The API Server port is accessible.\n Depending on your RBAC settings this could expose access to or control of your cluster.", "evidence": "b'{\"kind\":\"APIVersions\",\"versions\":[\"v1\"],\"serverAddressByClientCIDRs\":[{\"clientCIDR\":\"0.0.0.0/0\",\"serverAddress\":\"10.10.190.204:6443\"}]}\\n'", "hunter": "API Server Hunter"}], "hunter_statistics": [{"name": "Kubelet Readonly Ports Hunter", "description": "Hunts specific endpoints on open ports in the readonly Kubelet server", "vulnerabilities": 0}, {"name": "Kubelet Secure Ports Hunter", "description": "Hunts specific endpoints on an open secured Kubelet", "vulnerabilities": 0}, {"name": "AKS Hunting", "description": "Hunting Azure cluster deployments using specific known configurations", "vulnerabilities": 0}, {"name": "API Server Hunter", "description": "Checks if API server is accessible", "vulnerabilities": 0}, {"name": "API Server Hunter", "description": "Accessing the API server using the service account token obtained from a compromised pod", "vulnerabilities": 1}, {"name": "Api Version Hunter", "description": "Tries to obtain the Api Server's version directly from /version endpoint", "vulnerabilities": 2}, {"name": "Pod Capabilities Hunter", "description": "Checks for default enabled capabilities in a pod", "vulnerabilities": 1}, {"name": "Certificate Email Hunting", "description": "Checks for email addresses in kubernetes ssl certificates", "vulnerabilities": 0}, {"name": "K8s CVE Hunter", "description": "Checks if Node is running a Kubernetes version vulnerable to specific important CVEs", "vulnerabilities": 0}, {"name": "Kubectl CVE Hunter", "description": "Checks if the kubectl client is vulnerable to specific important CVEs", "vulnerabilities": 0}, {"name": "Dashboard Hunting", "description": "Hunts open Dashboards, gets the type of nodes in the cluster", "vulnerabilities": 0}, {"name": "Etcd Remote Access", "description": "Checks for remote availability of etcd, its version, and read access to the DB", "vulnerabilities": 0}, {"name": "Mount Hunter - /var/log", "description": "Hunt pods that have write access to host's /var/log. in such case, the pod can traverse read files on the host machine", "vulnerabilities": 0}, {"name": "Proxy Hunting", "description": "Hunts for a dashboard behind the proxy", "vulnerabilities": 0}, {"name": "Access Secrets", "description": "Accessing the secrets accessible to the pod", "vulnerabilities": 2}], "kburl": "https://aquasecurity.github.io/kube-hunter/kb/{vid}"} 2022-06-10 21:40:37,960 - functest_kubernetes.security.security - WARNING - Skipping Read access to pod's service account token (severity is configured as high) 2022-06-10 21:40:37,960 - functest_kubernetes.security.security - WARNING - Skipping CAP_NET_RAW Enabled (severity is configured as high) 2022-06-10 21:40:37,961 - functest_kubernetes.security.security - WARNING - Skipping Access to pod's secrets (severity is configured as high) 2022-06-10 21:40:37,961 - functest_kubernetes.security.security - WARNING - Skipping K8s Version Disclosure (severity is configured as high) 2022-06-10 21:40:37,961 - functest_kubernetes.security.security - WARNING - Skipping Access to API using service account token (severity is configured as high) 2022-06-10 21:40:37,963 - functest_kubernetes.security.security - WARNING - +--------------------------------+----------------------------------------------------+------------------+ | CATEGORY | VULNERABILITY | SEVERITY | +--------------------------------+----------------------------------------------------+------------------+ | Access Risk | Read access to pod's service account token | low | | Access Risk | CAP_NET_RAW Enabled | low | | Access Risk | Access to pod's secrets | low | | Information Disclosure | K8s Version Disclosure | medium | | Information Disclosure | Access to API using service account token | medium | +--------------------------------+----------------------------------------------------+------------------+ 2022-06-10 21:40:37,974 - functest_kubernetes.security.security - INFO - +---------------------------------------+------------------------------------------------------------+-------------------------+ | NAME | DESCRIPTION | VULNERABILITIES | +---------------------------------------+------------------------------------------------------------+-------------------------+ | Kubelet Readonly Ports Hunter | Hunts specific endpoints on open ports in the | 0 | | | readonly Kubelet server | | | Kubelet Secure Ports Hunter | Hunts specific endpoints on an open secured | 0 | | | Kubelet | | | AKS Hunting | Hunting Azure cluster deployments using specific | 0 | | | known configurations | | | API Server Hunter | Checks if API server is accessible | 0 | | API Server Hunter | Accessing the API server using the service account | 1 | | | token obtained from a compromised pod | | | Api Version Hunter | Tries to obtain the Api Server's version directly | 2 | | | from /version endpoint | | | Pod Capabilities Hunter | Checks for default enabled capabilities in a pod | 1 | | Certificate Email Hunting | Checks for email addresses in kubernetes ssl | 0 | | | certificates | | | K8s CVE Hunter | Checks if Node is running a Kubernetes version | 0 | | | vulnerable to specific important CVEs | | | Kubectl CVE Hunter | Checks if the kubectl client is vulnerable to | 0 | | | specific important CVEs | | | Dashboard Hunting | Hunts open Dashboards, gets the type of nodes in | 0 | | | the cluster | | | Etcd Remote Access | Checks for remote availability of etcd, its | 0 | | | version, and read access to the DB | | | Mount Hunter - /var/log | Hunt pods that have write access to host's | 0 | | | /var/log. in such case, the pod can traverse read | | | | files on the host machine | | | Proxy Hunting | Hunts for a dashboard behind the proxy | 0 | | Access Secrets | Accessing the secrets accessible to the pod | 2 | +---------------------------------------+------------------------------------------------------------+-------------------------+ 2022-06-10 21:40:37,974 - xtesting.ci.run_tests - INFO - Test result: +---------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +---------------------+------------------+------------------+----------------+ | kube_hunter | functest | 00:30 | PASS | +---------------------+------------------+------------------+----------------+