aquasecurity / kube-hunter

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

Fixed bug in certificate hunting #365

Closed danielsagi closed 3 years ago

danielsagi commented 4 years ago

Description

Certificate hunting was failing because of multiple newlines in certificates returns from ssl.get_server_certificate. Essentially the PEM footer was not stripped, causing the b64decode to fail.

Contribution checklist

codecov[bot] commented 4 years ago

Codecov Report

Merging #365 into master will increase coverage by 0.04%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #365      +/-   ##
==========================================
+ Coverage   62.73%   62.77%   +0.04%     
==========================================
  Files          42       42              
  Lines        2281     2281              
==========================================
+ Hits         1431     1432       +1     
+ Misses        850      849       -1     
Impacted Files Coverage Δ
kube_hunter/modules/hunting/certificates.py 93.33% <100.00%> (ø)
kube_hunter/core/events/handler.py 91.08% <0.00%> (+0.99%) :arrow_up:

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 3e06647...166e4f2. Read the comment docs.