WIP: starting to work on table output

This commit is contained in:
Daniel Sagi
2021-07-23 20:42:31 +03:00
parent 9115302f2c
commit 98a2ca418d
2 changed files with 6 additions and 4 deletions

View File

@@ -83,7 +83,8 @@ class PlainReporter(BaseReporter):
column_names = [
"ID",
"Location",
"Category",
"MITRE Category",
"Technique",
"Vulnerability",
"Description",
"Evidence",

View File

@@ -1,4 +1,5 @@
# flake8: noqa: E402
from kube_hunter.core.types.vulnerabilities import AccessK8sApiServerTechnique
import requests_mock
import time
@@ -21,7 +22,7 @@ from kube_hunter.modules.hunting.apiserver import (
from kube_hunter.modules.hunting.apiserver import ApiServerPassiveHunterFinished
from kube_hunter.modules.hunting.apiserver import CreateANamespace, DeleteANamespace
from kube_hunter.modules.discovery.apiserver import ApiServer
from kube_hunter.core.types import UnauthenticatedAccess, DiscoveryCategory
from kube_hunter.core.types import ExposedSensitiveInterfacesTechnique, AccessK8sApiServerTechnique
from kube_hunter.core.events import handler
counter = 0
@@ -181,10 +182,10 @@ class test_ListClusterRoles:
class test_ServerApiAccess:
def __init__(self, event):
print("ServerApiAccess")
if event.category == UnauthenticatedAccess:
if event.category == ExposedSensitiveInterfacesTechnique:
assert event.auth_token is None
else:
assert event.category == DiscoveryCategory
assert event.category == AccessK8sApiServerTechnique
assert event.auth_token == "so-secret"
global counter
counter += 1