mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-05-14 05:07:02 +00:00
added plugins package. for adding command lines arguments. moved report to the modules folder.
This commit is contained in:
@@ -6,13 +6,15 @@ import sys
|
||||
import time
|
||||
|
||||
parser = argparse.ArgumentParser(description='Kube-Hunter - hunts for security weaknesses in Kubernetes clusters')
|
||||
parser.add_argument('--internal', action="store_true", help="set hunting of all internal network interfaces")
|
||||
parser.add_argument('--internal', action="store_true", help="set hunting of allinternal network interfaces")
|
||||
parser.add_argument('--pod', action="store_true", help="set hunter as an insider pod")
|
||||
parser.add_argument('--cidr', type=str, help="set manual cidr to scan, example: 192.168.0.0/16")
|
||||
parser.add_argument('--mapping', action="store_true", help="outputs only a mapping of the cluster's nodes")
|
||||
parser.add_argument('--remote', nargs='+', metavar="HOST", default=list(), help="one or more remote ip/dns to hunt")
|
||||
parser.add_argument('--active', action="store_true", help="enables active hunting")
|
||||
parser.add_argument('--log', type=str, metavar="LOGLEVEL", default='INFO', help="set log level, options are: debug, info, warn, none")
|
||||
import plugins
|
||||
|
||||
config = parser.parse_args()
|
||||
|
||||
try:
|
||||
@@ -22,12 +24,11 @@ except:
|
||||
if config.log.lower() != "none":
|
||||
logging.basicConfig(level=loglevel, format='%(message)s', datefmt='%H:%M:%S')
|
||||
|
||||
import report
|
||||
|
||||
from src.core.events import handler
|
||||
from src.core.events.types import HuntFinished, HuntStarted
|
||||
from src.modules.discovery import HostDiscovery
|
||||
from src.modules.discovery.hosts import HostScanEvent
|
||||
import src
|
||||
|
||||
|
||||
def interactive_set_config():
|
||||
|
||||
3
plugins/README.md
Normal file
3
plugins/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Plugins
|
||||
|
||||
This folder contains modules that will load before any parsing of arguments by kubehunter's main module
|
||||
@@ -1,2 +1,3 @@
|
||||
import report
|
||||
import discovery
|
||||
import hunting
|
||||
7
src/modules/report/__init__.py
Normal file
7
src/modules/report/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from os.path import dirname, basename, isfile
|
||||
import glob
|
||||
|
||||
# dynamically importing all modules in folder
|
||||
files = glob.glob(dirname(__file__)+"/*.py")
|
||||
for module_name in (basename(f)[:-3] for f in files if isfile(f) and not f.endswith('__init__.py')):
|
||||
exec('from {} import *'.format(module_name))
|
||||
Reference in New Issue
Block a user