Commit Graph
661 Commits
Author SHA1 Message Date
Itay ShakuryandGitHub 4e68ea4e15 Add Knowledge Base for reported vulnerabilities (#188) 2019-10-13 17:10:47 +03:00
SinithHandLiz Rice e982f291e9 fixed some typos (#193)
* Update README.md

* Update README.md

* Update README.md

* Replace missing "if"
2019-10-10 10:17:23 +01:00
Itay ShakuryandLiz Rice 3b13e5980f add contributing guide (#189) 2019-10-10 10:10:27 +01:00
Adam HauzeandLiz Rice bed2a1fe4a Updated README to include documentation around python venv (#187)
* Updated README to include documentation around python venv

* Tidy PR

Add link to Virtual Environments docs
Remove Mac-specific instruction about brew
Remove non-installation instructions from installation section

* Tidy PR

Remove run instruction from installation section
2019-10-04 13:09:25 +02:00
Yehuda ChikvashviliandLiz Rice bc00bbd058 Change CVE hunters description (#183)
Make CVE hunters description more accurate
2019-10-02 16:32:09 +02:00
Yehuda Chikvashvilianddanielsagi a1feb06ec7 Ignore downstream version flag (#181)
* Ignore downstream version flag

This commit adds `--ignore-downstream` flag to kube-hunter.
Enabling the flag will make kube-hunter considering patched versions
as not vulnerable.
Resolves #179

* Add test cases and refine argument description
2019-09-19 21:57:39 +03:00
Pierre-Yves Ailletanddanielsagi c4e1e1e48c removing the foot note (#178)
* removing the foot note

the underlying issue has been closed, so the foot note might be removed

* removing another note

spotted another note and reference to the issue in the README
2019-09-08 11:42:23 +03:00
danielsagiandGitHub e0bacd6e7b New Hunters: DNS spoofing & ARP spoofing (#159)
* added arp passive hunter

* seperated arp and dns hunters, made them active and fixed some coe on arp

* added description for hunters, and refactored description for vulnerabilities

* minor typo

* replaced google.com with 1.1.1.1

* fixed comments

* fixed scapy

* validated output of get_kube_dns_ip_mac
2019-08-29 19:08:53 +03:00
danielsagiandGitHub a015f259a0 added linkage of previously discovered protocol, on filter (#176) 2019-08-29 16:46:35 +03:00
Yehuda Chikvashvilianddanielsagi 8bb8e1f16c Fix plain report with high log level (#175)
This commit fixes issue #108
Report type plain didn't work with log level higher than INFO.
2019-08-29 14:34:44 +03:00
danielsagiandGitHub 427a295c8c Adding visibility for dispatching (#166)
* minor addition to description

* added documantation in readme

* minor changes to logging levels and formatting

* changed example in readme

* fixed merge

* added info logging to http dispatch method

* changed description from environ to environment variables
2019-08-28 12:18:58 +03:00
danielsagiandGitHub 0315af75cf Detection for 3 new CVES (#173)
* changed version hunting to be on a a new version disclosure vulnerability

* fixed version publish

* added logging and fixed typo

* changed whole way of comparing versions in cve hunter

* changed K8sVersionDisclosure vulnerability to one core vulnerability, that takes an endpoint. changed all usage

* added tests

* merged kubectl cve hunting with apiserver hunting. and simplified the code of apiserver cve hunting

* fixed tests to new names

* changed name of module to cves.py

* drastically improved the cve vulnerble detection utility function. now works with all types of versioning methods

* added packaging in requirementes.txt

* added another test, and improved logic on cve comparison for more complicated versions

* changed CveHunter to subscribe_once, to prevent duplicates duplicates

* fixed tests for new improvements

* removed unnecessary ternary on doc

* removed unnecessary join split

* improved compare function, made it util

* improved cve checking to use mapping

* added detection for CVE-2019-9512 and  CVE-2019-9514

* added detection for CVE-2019-11247 and added minor comments
2019-08-27 22:03:29 +03:00
danielsagiandLiz Rice 2dad27a175 Decrease vulnerabilities on build (#170)
* changed python version to 3.8.rc and removed wireshark from build. also added a plugin to supress scapy's warnings about the manuf

* changed to alpine 3.10, on docker file and removed unnecessary logging suppression

* changed to python 3.7

* changed base image on builder as well
2019-08-27 11:27:17 +01:00
danielsagiandLiz Rice 860062abeb Added Metrics Server Discovery - Distinct from Api Server (#167)
* added basic metrics server discovery

* improved discovery, and added KNOWN PORTS usage

* improved apiserver decision

* fixed bug with comparison of IP addresses in kubeservicehost

* improved description of api server discovery

* added checks with auth_token on discovery

* fixed bug in version requests and added to tests

* added an abstract 'unrecognized API' event, and a filter for it for classification

* changed filtering to be done on the same event

* fixed verify on session and removed unnecessary enum

* minor changes to comments

* added detailed explanation
2019-08-27 08:54:08 +01:00
danielsagiandLiz Rice 259f707ecd Refactor And Major Bug Fixes in Version and CVE hunting (#162)
* changed version hunting to be on a a new version disclosure vulnerability

* fixed version publish

* added logging and fixed typo

* changed whole way of comparing versions in cve hunter

* changed K8sVersionDisclosure vulnerability to one core vulnerability, that takes an endpoint. changed all usage

* added tests

* merged kubectl cve hunting with apiserver hunting. and simplified the code of apiserver cve hunting

* fixed tests to new names

* changed name of module to cves.py

* drastically improved the cve vulnerble detection utility function. now works with all types of versioning methods

* added packaging in requirementes.txt

* added another test, and improved logic on cve comparison for more complicated versions

* changed CveHunter to subscribe_once, to prevent duplicates duplicates

* fixed tests for new improvements

* removed unnecessary ternary on doc

* removed unnecessary join split

* improved compare function, made it util

* improved cve checking to use mapping
2019-08-27 08:48:47 +01:00
danielsagiandGitHub 44e6438d37 Changed name of Subnet scanning to - Interface Scanning (#169)
* changed Subnet/internal scanning to interface

* Change one more internal -> interface
2019-08-25 20:40:30 +03:00
danielsagiandLiz Rice f5b72d44b5 New Core Feature: Subscribe Once (#168)
* added a subscribe_once decorator

* created tests for core functionality, for now, subscibe and subscribe once
2019-08-13 15:44:41 +01:00
Tom Davidsonanddanielsagi 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
danielsagiandLiz Rice 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
danielsagiandGitHub 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
danielsagiandLiz Rice 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
danielsagiandGitHub 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
danielsagiandLiz Rice 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
danielsagiandLiz Rice 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
danielsagiandLiz Rice 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
danielsagiandLiz Rice 911ec5eaf1 changed legacy host:port format to be 'location' in collector (#147) 2019-07-08 09:46:59 +01:00
danielsagiandGitHub 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
danielsagiandLiz Rice 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 SteimelandLiz Rice 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
danielsagiandLiz Rice 049453ee15 changed run handler check to include all 4xx status codes (#142) 2019-06-27 09:55:56 +01:00
danielsagiandLiz Rice 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
danielsagiandLiz Rice 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 RiceandGitHub 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 RiceandGitHub 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
danielsagiandGitHub 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
danielsagiandGitHub 30121b5010 Merge branch 'master' into fix_get_random_pod 2019-06-11 17:53:13 +03:00
danielsagiandGitHub c338aae1d6 Merge pull request #117 from aquasecurity/insecure_port
Insecure port for api server
2019-06-11 17:49:59 +03:00
danielsagiandGitHub 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
danielsagiandGitHub 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
danielsagiandGitHub 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
danielsagiandGitHub 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 RiceandGitHub 1143b89332 Merge branch 'master' into insecure_port 2019-05-30 23:26:16 +01:00