-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print table failed due to not supported less than compare between string and IPAddress #469
Comments
Thanks for reporting! |
Hi, I started playing with kube-hunter today with my playground cluster on GKE and I am facing a similar issue when I create a dedicated NetworkPolicy for the Pod.
Current SetupVersionskube-hunter: Manifests to reproduceThe simplified manifests below are sufficient to reproduce the issue and non-cluster resources will be located in the Note that, for brievety, the NetworkPolicy applies to the whole namespace ( NetworkPolicies are baked by Calico CNI plugin.
k apply -f kube-hunter.yaml LogsThe logs below were generated from a kube-hunter run on a freshly generated cluster with no additional workloads.
# The output is too long for GitHub comments See output.txt Note that when I remove the NetworkPolicy, or more precisely perform an
|
Signed-off-by: Daniel Pacak <[email protected]>
Sorry for the late reply. I think the issue of @julien-sugg is the same as the one that occurs in our cluster. |
Same issue is happening to me when running Kube-hunter deployment apiVersion: v1
kind: Pod
metadata:
name: kube-hunter-with-sa
namespace: default
labels:
app: kube-hunter-with-sa
spec:
serviceAccountName: kube-hunter
containers:
- name: kube-hunter-with-sa
image: aquasec/kube-hunter:0.6.8
command: ["kube-hunter"]
args: ["--pod", "--log", "debug"]
restartPolicy: Never Kubernetes version: NAME STATUS ROLES AGE VERSION
workshop-cluster-control-plane Ready control-plane 3d3h v1.27.3 Full error log 2023-09-23 07:13:24,403 DEBUG kube_hunter.core.events.event_handler Event <class 'kube_hunter.core.events.types.HuntFinished'> got published to hunter - <class 'kube_hunter.modules.report. │
│ 2023-09-23 07:13:24,403 DEBUG kube_hunter.core.events.event_handler Executing <class 'kube_hunter.modules.report.collector.SendFullReport'> with {'previous': None, 'hunter': None} │
│ 2023-09-23 07:13:24,406 DEBUG kube_hunter.core.events.event_handler '<' not supported between instances of 'str' and 'IPAddress' │
│ Traceback (most recent call last): │
│ File "/usr/local/lib/python3.8/site-packages/kube_hunter/core/events/event_handler.py", line 346, in worker │
│ hook.execute() │
│ File "/usr/local/lib/python3.8/site-packages/kube_hunter/modules/report/collector.py", line 56, in execute │
│ report = config.reporter.get_report(statistics=config.statistics, mapping=config.mapping) │
│ File "/usr/local/lib/python3.8/site-packages/kube_hunter/modules/report/plain.py", line 30, in get_report │
│ output += self.nodes_table() │
│ File "/usr/local/lib/python3.8/site-packages/kube_hunter/modules/report/plain.py", line 62, in nodes_table │
│ nodes_ret = f"\nNodes\n{nodes_table}\n" │
│ File "/usr/local/lib/python3.8/site-packages/prettytable/prettytable.py", line 327, in __str__ │
│ return self.get_string() │
│ File "/usr/local/lib/python3.8/site-packages/prettytable/prettytable.py", line 1700, in get_string │
│ rows = self._get_rows(options) │
│ File "/usr/local/lib/python3.8/site-packages/prettytable/prettytable.py", line 1618, in _get_rows │
│ rows.sort(reverse=options["reversesort"], key=options["sort_key"]) │
│ TypeError: '<' not supported between instances of 'str' and 'IPAddress' │
│ 2023-09-23 07:13:24,412 DEBUG kube_hunter.__main__ Cleaned Queue |
What happened
The following error happens when running kube-hunter with the following definition on k8s v1.21.2:
Expected behavior
The table should be generated and printed to stdout
The text was updated successfully, but these errors were encountered: