aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.66k stars 579 forks source link

Fixed false positive on test_run_handler #411

Closed danielsagi closed 3 years ago

danielsagi commented 3 years ago

Description

As described in #410 We now compare the resulted text body to a hardcoded error message pod does not exist coming from kubelet. By looking at the source code of the kubelet This looks like this is not gonna change in the long term

Fixed Issues

Fixes #410

Contribution checklist

codecov[bot] commented 3 years ago

Codecov Report

Merging #411 (e4037f5) into master (5a578fd) will decrease coverage by 0.07%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #411      +/-   ##
==========================================
- Coverage   63.50%   63.43%   -0.08%     
==========================================
  Files          42       42              
  Lines        2291     2292       +1     
==========================================
- Hits         1455     1454       -1     
- Misses        836      838       +2     
Impacted Files Coverage Δ
kube_hunter/modules/hunting/kubelet.py 59.63% <0.00%> (-0.12%) :arrow_down:
kube_hunter/core/events/handler.py 90.09% <0.00%> (-1.00%) :arrow_down:

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 5a578fd...e4037f5. Read the comment docs.

danielsagi commented 3 years ago

@lizrice So when we get this error message we dont get a 404 status, but rather a 405 as well. This was the problem. also, 404 gets returned regardless of authorization/authentication. only when a specific endpoint does not exist entirely

danielsagi commented 3 years ago

@lizrice oh I get what you were asking, Ill try maybe to send a post request, perhaps well get a 404 and can rely on that.