Commit Graph
84 Commits
Author SHA1 Message Date
df12d75d6d Packaging Kube-Hunter for PyPi (#272)
* Inital Commit

Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>

* Suggestions implemented as suggested

Signed-off-by: Vipul Gupta (@vipulgupta2048) <vipulgupta2048@gmail.com>

* Package with setuptools

Use setuptools to package kube-hunter as redistributable file.
Once packages, it can be pushed to PyPi.
The package version is taken from git tags (using setuptools_scm).

Closes #185

* Ignore __main__.py script in code coverage

The entrypoint script should not be tested but rather be calling
to tested modules.
Ideally, __main__ should only make a call to single function from
another tested module.

* Update requirements files

Use install_requires from setup.cfg file as single source of truth
for dependencies.
Install regular dependencies when installing dev dependencies.

* Symlink kube-hunter.py to entry point

Support the old way to run kube-hunter via the main script by making
a link to the new kube_hunter/__main__.py script.

Co-authored-by: Yehuda Chikvashvili <yehudaac1@gmail.com>
2020-02-10 21:35:31 +02:00
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 ChikvashviliandGitHub 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
Itay ShakuryandYehuda Chikvashvili 12f5b75733 Refactor reporters and add KB URL to reports (#275)
* refactor reporters and add kburl

* rename json reporter file to align with other reporters
2019-11-10 15:21:36 +02:00
Ryan LahfaandYehuda Chikvashvili a266c9068f Locking: Use a RAII/Defensive style to prevent issues when exceptions are thrown (#269) 2019-11-07 19:10:37 +02:00
RohithandYehuda Chikvashvili 031c4b9707 reponding to bug request https://github.com/aquasecurity/kube-hunter/issues/246 (#249)
/usr/bin/env python generally is defaulted to the version set by the linux flavour. On some distros it's python 2 and 3 on others, changing it to python3 might work
2019-10-26 19:05:13 +03: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
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 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
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 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
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
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
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
nshauliandjerbia f0160e2eba Update imports and dependencies for creating single application of kube-hunter using pyinstaller (#114) 2019-04-16 15:37:34 +03:00
manish 607612866f resolved dependency issue of the json.py file, renamed it to json_reporter 2019-02-22 15:13:58 +01:00
Liz RiceandGitHub 5380caca6b Add json to the format options in help 2019-02-21 11:20:25 +00:00
maniish-jaiin 9d68679df0 renamed the function name and json_reporter to json 2019-02-21 11:18:30 +01:00
manish 4f9a362e6a created reporter for json format 2019-02-20 13:36:24 +01:00
Michael Cherny 545c603a5f Refacture host discovery to explicitly split discovery from outside cluster and discovery from pod.
Now depending on '--pod' flag scan starts with either HostScanEvent or RunningAsPodEvent.
2018-12-27 19:59:58 +02:00
Michael Cherny a7dd3a505c Add '--quick' option to kube-hunter command line arguments
It was used but not implemented, causing from pod scanning in Azure  not to work.
2018-12-27 15:10:59 +02:00
Liz RiceandGitHub 1171c8ae20 Merge branch 'master' into access-secrets-hunter 2018-11-06 09:08:14 +00:00
oriagmon 54da07a73e Cleaned this branch to contain only updated secrets branch without locking 2018-10-21 11:23:30 +03:00
oriagmon 76692a36d7 Finished with the left of the PR comments. 2018-10-21 10:53:50 +03:00
oriagmon 7e324c5374 Fixed safe to change PR comments. the next fixes of these PR would need to be tested 2018-10-21 10:47:48 +03:00
oriagmon 26f3878f7c Using stricter locking "policy" 2018-10-17 15:28:18 +03:00
oriagmon 87232a12cd Fixed PR: Used the same lock for each variable & changed locks names 2018-10-17 12:36:04 +03:00
oriagmon a8762a4ada Fixed PR: Used the same lock for each variable & changed locks names 2018-10-17 11:32:50 +03:00
oriagmon e501e9ee63 removed running main a few timees 2018-10-16 18:09:16 +03:00
oriagmon 086a403559 locked variables 2018-10-16 17:03:57 +03:00
oriagmon 8462eba1b1 Intending 2018-10-16 16:53:57 +03:00
oriagmon 229347e9fa Attempting to solve the threading bug, I will do more checking to be sure its gone 2018-10-16 16:53:07 +03:00
Michael Schubert d90c75a8f0 kube-hunter: fix env path in shebang
Currently, `./kube-hunter.py` results in:

```
-bash: ./kube-hunter.py: /bin/env: bad interpreter: No such file or directory
```
2018-08-22 10:50:19 +02:00
Liz Rice afd3563fc4 Shouldn’t rely on the order of a dictionary 2018-08-21 09:57:09 +01:00
Cosmin Cojocar 74943f10d1 Refactor the reporter and add an YAML report format
Separate the events collection from report rendering, in order
to allow different type of reports.
2018-08-20 10:03:26 +02:00
Eran Bibi e2038276a5 change the menu options title 2018-08-17 20:04:17 +03:00
Eran Bibi a45220b753 change the menu options title 2018-08-17 19:58:37 +03:00
Liz RiceandGitHub 87a498d432 Merge branch 'master' into deployment 2018-08-17 10:08:43 +01:00
Cosmin Cojocar 80f03c9990 Does not have to be blocked forever when executed in 'pod' mode in a job
The logs of the job can be retrieved even when the job is completed.
2018-08-17 10:16:35 +02:00
cclaussandGitHub a771c05903 print() is a function in Python 3
Also defined raw_input() in Python 3.
2018-08-16 23:51:18 +02:00
danielsagiandGitHub db7e054753 added comment 2018-08-16 19:11:36 +03:00
daniel_sagi 03b81a9b8f added an error message when runnning container without -it 2018-08-16 19:03:16 +03:00
daniel_sagi 958e243279 added chmod 2018-08-15 17:26:03 +03:00
daniel_sagi 0f90b59d44 added edge case handling, for when hunter is without documentation 2018-08-08 17:06:52 +03:00
daniel_sagi 8843ad27b3 patching 2018-08-08 16:51:23 +03:00
daniel_sagi a3aba4ba8b changed cidr terms to be more user friendly 2018-07-24 18:51:32 +03:00
daniel_sagi 4e56e44156 added plugins package. for adding command lines arguments. moved report to the modules folder. 2018-07-24 16:30:28 +03:00
daniel_sagi 4e988dca38 moved all start status logging to the default module 2018-07-23 17:39:24 +03:00
daniel_sagi 0569b99f30 added automatic imports for report package 2018-07-19 14:52:58 +03:00
daniel_sagi 0d6b16acd8 removed aqua module 2018-07-18 19:54:33 +03:00