2024-10-17 22:08:57,077 - 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 | 0TDQW9HPPXGG | | NODE_NAME | v1.31 | | 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/0TDQW9HPPXGG/functest-kubernetes-opnfv- | | | functest-kubernetes-security-v1.31-kube_hunter- | | | run-9 | | HTTP_DST_URL | http://artifacts.opnfv.org/functest- | | | kubernetes/0TDQW9HPPXGG/functest-kubernetes-opnfv- | | | functest-kubernetes-security-v1.31-kube_hunter- | | | run-9 | +-------------------------+------------------------------------------------------------+ 2024-10-17 22:08:57,086 - xtesting.ci.run_tests - INFO - Loading test case 'kube_hunter'... 2024-10-17 22:08:57,539 - xtesting.ci.run_tests - INFO - Running test case 'kube_hunter'... 2024-10-17 22:08:57,582 - functest_kubernetes.security.security - INFO - Job kube-hunter created 2024-10-17 22:09:30,360 - functest_kubernetes.security.security - INFO - kube-hunter started in 32.82 sec 2024-10-17 22:09:30,386 - functest_kubernetes.security.security - INFO - 2024-10-17 22:08:59,955 INFO kube_hunter.modules.report.collector Started hunting 2024-10-17 22:08:59,955 INFO kube_hunter.modules.report.collector Discovering Open Kubernetes Services 2024-10-17 22:08:59,965 INFO kube_hunter.modules.report.collector Found vulnerability "Read access to pod's service account token" in Local to Pod (kube-hunter-tmwg7) 2024-10-17 22:08:59,965 INFO kube_hunter.modules.report.collector Found vulnerability "CAP_NET_RAW Enabled" in Local to Pod (kube-hunter-tmwg7) 2024-10-17 22:08:59,969 INFO kube_hunter.modules.report.collector Found vulnerability "Access to pod's secrets" in Local to Pod (kube-hunter-tmwg7) 2024-10-17 22:09:15,174 INFO kube_hunter.modules.report.collector Found open service "Kubelet API" at 10.244.2.1:10250 2024-10-17 22:09:22,687 INFO kube_hunter.modules.report.collector Found open service "API Server" at 10.96.0.1:443 2024-10-17 22:09:22,766 INFO kube_hunter.modules.report.collector Found vulnerability "Access to API using service account token" in 10.96.0.1:443 2024-10-17 22:09:22,792 INFO kube_hunter.modules.report.collector Found vulnerability "K8s Version Disclosure" in 10.96.0.1:443 {"nodes": [{"type": "Node/Master", "location": "10.244.2.1"}, {"type": "Node/Master", "location": "10.96.0.1"}], "services": [{"service": "Kubelet API", "location": "10.244.2.1:10250"}, {"service": "API Server", "location": "10.96.0.1:443"}], "vulnerabilities": [{"location": "Local to Pod (kube-hunter-tmwg7)", "vid": "KHV050", "category": "Credential Access // Access container service account", "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": "eyJhbGciOiJSUzI1NiIsImtpZCI6Inoxc1UwakZnRzBFSzUwWXM0d1p4Zk1JTEY0UnEyQm8tTzVPV25pbW5UVUUifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNzYwNzM4OTM3LCJpYXQiOjE3MjkyMDI5MzcsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwianRpIjoiYjdjOTVhMjUtZmMwZi00YTA0LWJkNzgtMWUxNmMyZTY5NzNjIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJrdWJlLWh1bnRlci1zcGhqdiIsIm5vZGUiOnsibmFtZSI6InYxMzEtd29ya2VyMiIsInVpZCI6ImEyMDU5MjZiLWI4MDYtNDBlYi1hZjRhLTc2MDNjZjhmNTdlOSJ9LCJwb2QiOnsibmFtZSI6Imt1YmUtaHVudGVyLXRtd2c3IiwidWlkIjoiMzQxZmMyZjMtYTUwOC00MTM0LWEyOWUtZjEzY2M5MDFiMGI3In0sInNlcnZpY2VhY2NvdW50Ijp7Im5hbWUiOiJkZWZhdWx0IiwidWlkIjoiYzgwOTM1OGItYTExYS00YzYxLWE3ZjAtYjUxNzNmMWUyYzlkIn0sIndhcm5hZnRlciI6MTcyOTIwNjU0NH0sIm5iZiI6MTcyOTIwMjkzNywic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtaHVudGVyLXNwaGp2OmRlZmF1bHQifQ.xAa7tMk_87NxYInkF_RgUGEs34y7K3SuTbFDiuh4z6yaS9lcY6pt8giZbc-SD6IUNXt2SrNuhzDj6Ai291HMvdstDQG37HGvfIe8_VAjrNbT8jDw3BFy0CZMYugH6geDLNbh-3gEzh740mK4gvkOc-AYWOoU51CgIFhPDys-fueHxjg-wCXRRQss-HiV8WdEPzuYB1G9-dGAVucwJ4bpzs06AUezOcTZOsI2SR6uDL27ryv6W9OwisfXIa7U_kPEyY3KWnHZs6a2fe6OzIWBaKtNst1ZJquYe0tu8tJGrGRb0NnPeeTQq2Hd3Hs8aE5s7hJwwA58gqv8OtGBIJXEdg", "avd_reference": "https://avd.aquasec.com/kube-hunter/khv050/", "hunter": "Access Secrets"}, {"location": "Local to Pod (kube-hunter-tmwg7)", "vid": "None", "category": "Lateral Movement // ARP poisoning and IP spoofing", "severity": "medium", "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": "", "avd_reference": "https://avd.aquasec.com/kube-hunter/none/", "hunter": "Pod Capabilities Hunter"}, {"location": "Local to Pod (kube-hunter-tmwg7)", "vid": "None", "category": "Credential Access // Access container service account", "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/ca.crt', '/var/run/secrets/kubernetes.io/serviceaccount/token', '/var/run/secrets/kubernetes.io/serviceaccount/namespace', '/var/run/secrets/kubernetes.io/serviceaccount/..2024_10_17_22_08_57.2454407847/ca.crt', '/var/run/secrets/kubernetes.io/serviceaccount/..2024_10_17_22_08_57.2454407847/token', '/var/run/secrets/kubernetes.io/serviceaccount/..2024_10_17_22_08_57.2454407847/namespace']", "avd_reference": "https://avd.aquasec.com/kube-hunter/none/", "hunter": "Access Secrets"}, {"location": "10.96.0.1:443", "vid": "KHV005", "category": "Discovery // Access the K8S API Server", "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\":\"172.24.0.12:6443\"}]}\\n'", "avd_reference": "https://avd.aquasec.com/kube-hunter/khv005/", "hunter": "API Server Hunter"}, {"location": "10.96.0.1:443", "vid": "KHV002", "category": "Initial Access // Exposed sensitive interfaces", "severity": "high", "vulnerability": "K8s Version Disclosure", "description": "The kubernetes version could be obtained from the /version endpoint", "evidence": "v1.31.0", "avd_reference": "https://avd.aquasec.com/kube-hunter/khv002/", "hunter": "Api Version 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": 1}, {"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": "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}]} 2024-10-17 22:09:30,387 - functest_kubernetes.security.security - WARNING - Just printing all vulnerabilities as no severity criteria given 2024-10-17 22:09:30,391 - functest_kubernetes.security.security - WARNING - +---------------------------------------------------------------+----------------------------------------------------+------------------+ | CATEGORY | VULNERABILITY | SEVERITY | +---------------------------------------------------------------+----------------------------------------------------+------------------+ | Credential Access // Access container service account | Read access to pod's service account token | low | | Lateral Movement // ARP poisoning and IP spoofing | CAP_NET_RAW Enabled | medium | | Credential Access // Access container service account | Access to pod's secrets | low | | Discovery // Access the K8S API Server | Access to API using service account token | medium | | Initial Access // Exposed sensitive interfaces | K8s Version Disclosure | high | +---------------------------------------------------------------+----------------------------------------------------+------------------+ 2024-10-17 22:09:30,402 - 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 | 1 | | | 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 | | | 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 | +---------------------------------------+------------------------------------------------------------+-------------------------+ 2024-10-17 22:09:30,402 - xtesting.ci.run_tests - INFO - Test result: +---------------------+------------------+------------------+----------------+ | TEST CASE | PROJECT | DURATION | RESULT | +---------------------+------------------+------------------+----------------+ | kube_hunter | functest | 00:32 | PASS | +---------------------+------------------+------------------+----------------+