Commit Graph

544 Commits

Author SHA1 Message Date
Tom Davidson
e3af42cbce Separate report "sending" into modules (#156)
* moved report output into dispatchers, stdout by default with config option of http(s)

* notes in arg config on how to configure http dispatcher

* removed some debug log visibility indicators

* missing import

* env vars more descriptive: KUBEHUNTER_HTTP_DISPATCH_METHOD and KUBEHUNTER_HTTP_DISPATCH_URL

* optimisation: delayed instantiation of the dispatcher until after selection to avoid instantiating unnecessarily

* refactor: config selection as per reporter selection

* bugfix: fall-back to default required if unknown reporter or dispatcher specified

* swapping urllib3 for requests

* corrected visibility levels for logging

* moving dispatchers into a file in reporters rather than it's own place to fit with theme and support dynamic module loading
2019-08-12 13:28:31 +03:00
danielsagi
cb90673bcb Added API Server discovery when running as pod (#160)
* added an implementation for scanning api server from env variable, without duplications, when running as pod

* fixed issue with convertion of ip address
2019-08-05 13:25:06 -07:00
danielsagi
e5db8b6b28 New Hunter: /var/log mount (#158)
* added pods data on ExposedPodsHandler event, for later use

* added /var/log write mount hunter. in 'mounts' module. also an active hunter which exploits run handler as well

* removed unnecesary variables

* changed active hunter description

* minor changes to vulnerability descriptions
2019-08-01 20:17:57 +03:00
danielsagi
889a77d939 Pyinstaller/py2exe support (#157)
* removed unnecessary imports from main file

* added a script that generates static __init__ files based on existing modules

* added documentation

* added installing of plugins imports to script
2019-07-29 05:47:36 -07:00
danielsagi
91162297b3 Added System Logs Hunting & Improved Kubelet Hunting (#154)
* 1. added /logs Active hunter and tester.
2. changed kubelet handlers enum to be accessible as KubeletHandlers
3. added kubelet requests session to the event chain, for active hunters to use.

* added usage of event.session in the run active hunter
2019-07-10 14:57:25 +03:00
danielsagi
07db108511 Added pprof cmdline hunting (#150)
* added pprof/cmdline debug handler hunting on kubelet

* changed Name and Component of vuln

* removed preceding slash

* added verify=False
2019-07-10 11:37:26 +01:00
danielsagi
e4678843c9 Changed kubelet run handler test to be not a state changing operation (#136)
* changed kubelet run handler test to be not state-changing

* changed fake_container name to be more random

* changed run handler to GET and check for method not allowed
2019-07-10 11:29:15 +01:00
danielsagi
cc70c83ba4 Retire Support For Python 2 (#153)
* removed python2 from readme and travis

* changed except on caps hunter to except PermissionError, supports only from python3

* removed python2 support in main file

* changed cvehunter to use res.text in place of res.content (python3 returnes a bytes object for content)
2019-07-10 11:23:08 +01:00
danielsagi
911ec5eaf1 changed legacy host:port format to be 'location' in collector (#147) 2019-07-08 09:46:59 +01:00
danielsagi
5883e28971 Added new hunter for Capabilities (#146)
* added hunter for Capabilities, and a check for NET_RAW

* changed to Hunter from Discovery

* added description for hunter

* changed from PermissionError on net_raw check. for python2 support

* Clarify vulnerability description

Stating that this vulnerability only becomes a problem if a pod gets compromised
2019-07-04 12:39:41 +03:00
danielsagi
5185f28fff Added event filtering mechanism (#134)
* added event filtering mechanism, as well as a detailed explanation in src/README

* changed filter search to run only once for each event, also now returning None to indicate keeping of event

* expanded explanation of filtering in readme

* Tiny typo

* made changes for better readability, also filter should now return  None to indicate throwing of event

* changed apply filters loop to be simple and running on each publish.

* changed README

* added reassuring of parent event after filters

* moved event filtering to another function, now supporting trhoeing of event mid loop

* added note in README about event.previous

* Tiny text corrections

* More accurate comment

"Throwing an event" can actually mean triggering it (which is different from "throwing it _away_"). But I went for "discarded" here to be completely clear

* Remove superflous space that had crept in
2019-07-03 11:52:42 +01:00
Weston Steimel
0caecd60ed optimised docker image (#123)
* optimised docker image

* use multi-stage image to remove build dependencies from final layer
* updated to python 3.7.3

Signed-off-by: Weston Steimel <weston.steimel@gmail.com>

* add /etc/ethertypes in final layer

Added ebtables and copy /etc/ethertypes to disable warning in verions of
scapy with EtherCat functionality.  This also fixes misspelling of
tcpdump package in build layer.

Signed-off-by: Weston Steimel <weston.steimel@gmail.com>
2019-07-03 08:48:03 +01:00
danielsagi
049453ee15 changed run handler check to include all 4xx status codes (#142) 2019-06-27 09:55:56 +01:00
danielsagi
b2d2f5a01a New kubectl CVE hunter, detecting CVE-2019-11246 and CVE_2019_1002101 (#141)
* added a new hunter for CVE-2019-11246

* added KubectlClient component

* overriden location function on event to display a 'local machine' location

* added clarification about kubectl version --client operation

* Fix tiny typo

It reads better without the comma

* removed unnecessary debug message

* added CVE hunter for kubectl to allow more CVE checking.
2019-06-27 09:51:18 +01:00
danielsagi
f360c541ff Minor improve of task counting of queue (#139)
* changed way of task handler to be more safe. also added info about cases when one task is hanging

* removed queue_lock
2019-06-27 09:36:31 +01:00
Liz Rice
b5bf168938 Merge pull request #140 from danielsagi/show_vulnerabilities_without_services
Added printing vulnerabilities in case of no services on PlainReporter
2019-06-25 12:55:34 +01:00
Daniel Sagi
b7bcdd09cf better way of treating the printing, concatenating output 2019-06-24 22:42:03 +03:00
Daniel Sagi
1baca77754 Up until now if services were not discovered, vulnerabilities will not have shown. we want to show the, in any case. 2019-06-24 20:00:28 +03:00
Liz Rice
f9c001ddea Merge pull request #137 from aquasecurity/add_exception_messages
More detailed explanation about exceptions
2019-06-13 06:01:26 -07:00
Daniel Sagi
50ea9a2405 added more detailed explanation about exceptions in debug 2019-06-12 17:43:16 +03:00
danielsagi
e04e84cc16 Merge pull request #135 from aquasecurity/fix_get_random_pod
Fixed not finding open debug handlers
2019-06-11 18:11:12 +03:00
danielsagi
30121b5010 Merge branch 'master' into fix_get_random_pod 2019-06-11 17:53:13 +03:00
danielsagi
c338aae1d6 Merge pull request #117 from aquasecurity/insecure_port
Insecure port for api server
2019-06-11 17:49:59 +03:00
danielsagi
ec3aca9547 Merge branch 'master' into insecure_port 2019-06-11 17:43:14 +03:00
Daniel Sagi
faf1db3d16 cleaned files to match master branch updates, also removed change of ExposedRunHandler evidence handling 2019-06-11 17:40:44 +03:00
Daniel Sagi
2168180ffb fixed issue with get_random_pod method, .next attribute on generator is deprecated in python3 2019-06-11 11:29:39 +03:00
danielsagi
079062573e Merge pull request #133 from nshauli/add_counter_to_privileged_container_evidence
Add evidence counter to privileged container vulnerability
2019-06-05 11:56:48 +03:00
nshauli
ac77c67ddd Add evidence counter to privileged container vulnerability 2019-06-05 11:48:25 +03:00
danielsagi
0f4ddc9987 Merge pull request #132 from aquasecurity/add_environment_markers
changed enum34 to be installed only under python version 3.4
2019-06-03 20:45:03 +03:00
Daniel Sagi
9204d34244 changed enum34 to be installed only under python version 3.4 2019-06-03 20:16:39 +03:00
danielsagi
9629292ef8 Merge pull request #130 from nshauli/add_hunter_name_to_vulnerability
Add hunter name to each event and each reported vulnerability
2019-06-03 16:26:56 +03:00
nshauli
f5c54428f8 Add hunter name to each event and to each vulnrability in json and yaml report 2019-06-03 16:17:33 +03:00
Liz Rice
1143b89332 Merge branch 'master' into insecure_port 2019-05-30 23:26:16 +01:00
Liz Rice
b60cdf2043 Merge pull request #128 from DrMurx/more_secure_cloudip_detection
Access cloud IP detection service via HTTPS
2019-05-30 23:24:31 +01:00
Liz Rice
8fad9dd2ac Merge branch 'master' into more_secure_cloudip_detection 2019-05-30 23:20:41 +01:00
danielsagi
c6673869d7 Merge pull request #129 from aquasecurity/add_enum_to_requirements
added enum34 to requirements.txt
2019-05-25 20:43:55 +03:00
Daniel Sagi
55ed8d0a80 added enum34 to requirements.txt 2019-05-25 20:00:55 +03:00
Jan Kunzmann
0f3670dff5 Access cloud IP detection service via HTTPS 2019-05-23 13:03:18 +02:00
danielsagi
e69e591fab Merge pull request #125 from aquarnd/hunter_statistics_should_count_vulnerabilities_only
1. Change hunter statistics to count vulnerabilities only.
2019-05-21 19:12:13 +03:00
nshauli
ac7027dab6 1. Change hunter statistics to count vulnerabilities only.
2. Add --statistics flag support.
3. Show hunter statistics only if --statistics was set.
4. Few infrastructure improvements.
2019-05-20 21:32:52 +03:00
Liz Rice
d7014fd06d Merge pull request #121 from tomek-bt/update-readme-for-non-ssh
Update README to reference non-SSH URL
2019-05-18 09:44:44 +01:00
Tomek Rabczak
e536f53b88 Update README to reference non-SSH URL 2019-05-17 17:44:42 +00:00
Liz Rice
f7eccca55d Merge pull request #119 from aquasecurity/security-fix
CVE-2019-11324
2019-05-14 15:23:44 +01:00
Liz Rice
d6f76dc295 CVE-2019-11324 2019-05-14 15:15:11 +01:00
Liz Rice
229ff40a01 Fix bad merge
And a typo while I'm here
2019-05-14 14:07:33 +01:00
Liz Rice
7d038f50dc Merge branch 'master' into insecure_port 2019-05-14 12:00:51 +01:00
Liz Rice
c860406075 Merge pull request #116 from aquarnd/add_suppport_for_hunters_list
Add support for hunters list as part of the reports.
2019-05-14 11:55:40 +01:00
nshauli
b4df6b5298 Add support for hunters list as part of the reports.
Each reported hunter includes name, description and number of events.
Add severity field to each vulnerability report.
2019-05-14 12:44:30 +03:00
Liz Rice
50dfbd0daa Update requirements.txt 2019-05-13 13:52:51 +01:00
Liz Rice
5cf68a318f Tests for insecure port access 2019-05-13 13:18:03 +01:00