Limit tab completion of scan command to scans with installed components (#74)

* scans without installed requirements dont tab-complete

* added meets_requirements functions to classes

* updated tests

* added check for None case
This commit is contained in:
epi052
2020-06-28 15:33:34 -05:00
committed by GitHub
parent 6ed51a19be
commit 4d1aef2d34
14 changed files with 179 additions and 45 deletions

View File

@@ -10,9 +10,10 @@ from luigi.util import inherits
from luigi.contrib.sqla import SQLAlchemyTarget
import pipeline.models.db_manager
from .targets import GatherWebTargets
from ..config import defaults
from ...tools import tools
from ..config import defaults
from ..helpers import get_tool_state
from .targets import GatherWebTargets
from ...models.endpoint_model import Endpoint
from ..helpers import get_ip_address_version, is_ip_address
@@ -64,6 +65,15 @@ class GobusterScan(luigi.Task):
self.db_mgr = pipeline.models.db_manager.DBManager(db_location=self.db_location)
self.results_subfolder = Path(self.results_dir) / "gobuster-results"
@staticmethod
def meets_requirements():
""" Reports whether or not this scan's needed tool(s) are installed or not """
needs = ["recursive-gobuster", "gobuster"]
tools = get_tool_state()
if tools:
return all([tools.get(x).get("installed") is True for x in needs])
def requires(self):
""" GobusterScan depends on GatherWebTargets to run.