* Add a new dependency on Kubernetes package
* Add and store a new flag about automatic nodes discovery from a pod
* Implement the listing of nodes
* Add tests to cover the k8s node listing
* Fix the k8s listing test to ensure the load incluster function is actually called
* Add more help to the k8s node discovery flags, and cross-reference them.
* Add a note on the Kubernetes auto-discovery in the main README file
* Move the kubernetes discovery from conf to modules/discovery
* When running with --pods, run the Kubernetes auto discovery
* Also mention that the auto discovery is always on when using --pod
Co-authored-by: Mikolaj Pawlikowski <mpawlikowsk1@bloomberg.net>
* added plugins submodule, created two hookspecs, one for adding arguments, one for running code after the argument parsing
* implemented plugins application on main file, changed mechanism for argument parsing
* changed previous parsing function to not create the ArgumentParser, and implemented it as a hook for the parsing mechanism
* added pluggy to required deps
* removed unecessary add_config import
* fixed formatting using black
* restored main link file from master
* moved import of parser to right before the register call, to avoid circular imports
* added tests for the plugins hooks
* removed blank line space
* black reformat
* Add PyInstaller build
Use PyInstaller to generate single binary.
Use staticx to generate a single static binary.
Resolves#301
* Add test Makefile target
Add test to Makefile.
Add requests_mock to dev dependencies.
* 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>
* Fix empty report when active hunting
Running kube-hunter active hunting with plain report
did not show any report.
This commit changes Vulnerability.vid default value
to "None" (previously None)
Closes#280
* Improve debug and exception messages
Debugging hunters execution is hard due to lack of debug
information. No indication is made when a hunter starts.
Exceptions where printed without stack trace, which made
it difficult to follow.
* 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>