aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.7k stars 581 forks source link

Update job.yml for Kubernetes cluster jobs #367

Closed ssathyaji closed 3 years ago

ssathyaji commented 3 years ago

Existing job.yml has wrong command for command ["python", "kube-hunter,py"]. But it should change to command ["kube-hunter"]

Description

Existing job.yml has command["python", "kube-hunter.py"] but it is not correct and once we deployed to k8s cluster, pods will Error state. Because the pods cannot find the correct command. So the command should be like this. command["kube-hunter"] I have changed the job.yml and updated the repo.

Contribution Guidelines

Please Read through the Contribution Guidelines.

Fixed Issues

Please mention any issues fixed in the PR by referencing it properly in the commit message. As per the convention, use appropriate keywords such as fixes, closes, resolves to automatically refer the issue. Please consult official github documentation for details.

Fixes #(issue)

"BEFORE" and "AFTER" output

To verify that the change works as desired, please include an output of terminal before and after the changes under headings "BEFORE" and "AFTER".

BEFORE

Any Terminal Output Before Changes.

Kube Pod Error State: kube-hunter-9gjjn 0/1 Error 0 8m32s kube-hunter-bhxlq 0/1 Error 0 8m16s kube-hunter-p5pkx 0/1 Error 0 8m26s kube-hunter-srztm 0/1 Error 0 7m16s kube-hunter-xt68b 0/1 Error 0 7m56s

Pods Error logs:

python: can't open file 'kube-hunter.py': [Errno 2] No such file or directory

AFTER

After changed job.yml and deployed. Then it worked as expected.

kube-hunter-hhwh2 1/1 Running 0 10s

Then started to hunt the vulnerabilities.

2020-08-24 08:11:25,696 INFO kube_hunter.modules.report.collector Started hunting 2020-08-24 08:11:25,697 INFO kube_hunter.modules.report.collector Discovering Open Kubernetes Services

Contribution checklist

Notes

Please mention if you have not checked any of the above boxes.

codecov[bot] commented 3 years ago

Codecov Report

Merging #367 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #367   +/-   ##
=======================================
  Coverage   62.73%   62.73%           
=======================================
  Files          42       42           
  Lines        2281     2281           
=======================================
  Hits         1431     1431           
  Misses        850      850           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 72ae8c0...c167498. Read the comment docs.

lizrice commented 3 years ago

fyi @danielsagi