mirror of
https://github.com/aljazceru/recon-pipeline.git
synced 2025-12-24 01:34:26 +01:00
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:
@@ -9,8 +9,9 @@ from luigi.contrib.sqla import SQLAlchemyTarget
|
||||
|
||||
import pipeline.models.db_manager
|
||||
from ...tools import tools
|
||||
from .targets import GatherWebTargets
|
||||
from ..config import defaults
|
||||
from ..helpers import get_tool_state
|
||||
from .targets import GatherWebTargets
|
||||
|
||||
|
||||
@inherits(GatherWebTargets)
|
||||
@@ -52,6 +53,15 @@ class TKOSubsScan(luigi.Task):
|
||||
self.results_subfolder = (Path(self.results_dir) / "tkosubs-results").expanduser().resolve()
|
||||
self.output_file = self.results_subfolder / "tkosubs.csv"
|
||||
|
||||
@staticmethod
|
||||
def meets_requirements():
|
||||
""" Reports whether or not this scan's needed tool(s) are installed or not """
|
||||
needs = ["tko-subs"]
|
||||
tools = get_tool_state()
|
||||
|
||||
if tools:
|
||||
return all([tools.get(x).get("installed") is True for x in needs])
|
||||
|
||||
def requires(self):
|
||||
""" TKOSubsScan depends on GatherWebTargets to run.
|
||||
|
||||
@@ -174,6 +184,15 @@ class SubjackScan(luigi.Task):
|
||||
self.results_subfolder = (Path(self.results_dir) / "subjack-results").expanduser().resolve()
|
||||
self.output_file = self.results_subfolder / "subjack.txt"
|
||||
|
||||
@staticmethod
|
||||
def meets_requirements():
|
||||
""" Reports whether or not this scan's needed tool(s) are installed or not """
|
||||
needs = ["subjack"]
|
||||
tools = get_tool_state()
|
||||
|
||||
if tools:
|
||||
return all([tools.get(x).get("installed") is True for x in needs])
|
||||
|
||||
def requires(self):
|
||||
""" SubjackScan depends on GatherWebTargets to run.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user