from kube_hunter.conf.parser import parse_args from kube_hunter.conf.logging import setup_logger config = parse_args() setup_logger(config.log) __all__ = [config]
#!/usr/bin/env python3 # flake8: noqa: E402 import logging import threading from kube_hunter.conf import Config, set_config from kube_hunter.conf.parser import parse_args from kube_hunter.conf.logging import setup_logger from kube_hunter.plugins import initialize_plugin_manager pm = initialize_plugin_manager() # Using a plugin hook for adding arguments before parsing args = parse_args(add_args_hook=pm.hook.parser_add_arguments) config = Config( active=args.active, cidr=args.cidr, include_patched_versions=args.include_patched_versions, interface=args.interface, log_file=args.log_file, mapping=args.mapping, network_timeout=args.network_timeout, pod=args.pod, quick=args.quick, remote=args.remote, statistics=args.statistics, ) setup_logger(args.log, args.log_file) set_config(config)
#!/usr/bin/env python3 # flake8: noqa: E402 import logging import threading from kube_hunter.conf import Config, set_config from kube_hunter.conf.parser import parse_args from kube_hunter.conf.logging import setup_logger args = parse_args() config = Config( active=args.active, cidr=args.cidr, include_patched_versions=args.include_patched_versions, interface=args.interface, mapping=args.mapping, network_timeout=args.network_timeout, pod=args.pod, quick=args.quick, remote=args.remote, statistics=args.statistics, ) setup_logger(args.log) set_config(config) from kube_hunter.core.events import handler from kube_hunter.core.events.types import HuntFinished, HuntStarted from kube_hunter.modules.discovery.hosts import RunningAsPodEvent, HostScanEvent from kube_hunter.modules.report import get_reporter, get_dispatcher