17 Commits

Author SHA1 Message Date
mormamn
bf646f5e0c Fix broken reporting (#313)
Added instance creation of reporters and dispatcher objects
Fixes #312
2020-02-26 22:40:16 +02:00
Yehuda Chikvashvili
fe3dba90d8 Refactor configuration (#283)
* Remove __main__ references and create a top-level config module

* Move conf module into separate standalone package

* Deprecate install_imports.py script

* Rename root package to kube_hunter

The previous src root package name was too generic and not unique,
so it can be used as external name.
Change `src` to `kube_hunter` so it can be referenced in a clear way.
Addtional changes made on the way:
* Make imports absolute
* Formatting

Relates to #185

* remove todos

Co-authored-by: Ryan Lahfa <masterancpp@gmail.com>
Co-authored-by: Itay Shakury <itay@itaysk.com>
2019-12-29 14:18:58 +02:00
Yehuda Chikvashvili
1d7bdd6131 Consider patched versions as not vulnerable by default (#220)
* Consider patched versions as not vulnerable by default

Change `--ignore-downstream` to `--ignore-patched-versions` and
invert it's effect.
From now on, kube-hunter will not alert patched components as default
behavior.

Resolves #194

* Rename flag --ignore-patched-versions to --include-patched-versions
2019-11-26 20:28:30 +02:00
Yehuda Chikvashvili
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
danielsagi
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
danielsagi
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
danielsagi
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
Liz Rice
5cf68a318f Tests for insecure port access 2019-05-13 13:18:03 +01:00
Liz Rice
f10632f47e Merge branch 'master' into api-server-hunt-improvements 2019-03-18 17:58:12 +00:00
Liz Rice
1b849947fa Use a predicate and avoid a whole extra event 2019-03-08 16:27:52 +00:00
Weston Steimel
45d32be212 support for python3
Signed-off-by: Weston Steimel <weston.steimel@gmail.com>
2019-03-04 21:37:59 +00:00
Liz Rice
e77f5fdcc8 Show in the report whether access was via service token or not 2019-03-04 12:35:57 +00:00
Liz Rice
dd1ed76dc1 Better names, descriptions and tests
When you query for resources, you get the ones you’re entitled to see - it’s misleading to suggest you’re getting all of them
2019-03-04 11:43:37 +00:00
Liz Rice
5e69d3b307 Better tests for API discovery 2019-03-04 11:23:00 +00:00
Liz Rice
a3bd1b9ef2 Improvements to the API Server hunters 2019-02-26 19:51:50 +08:00
Liz Rice
9dcf617c5e Fix importing 2019-02-26 00:49:41 +00:00
Liz Rice
ef7f856cac Move tests so they don’t get picked up by the regular executable 2019-02-26 00:36:53 +00:00