Skip to content

Commit

Permalink
Insider: timeout support
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeDJIK committed Jun 8, 2021
1 parent 8f8be39 commit c2112b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dusty/scanners/sast/insider/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ def execute(self):
output_dir = tempfile.mkdtemp()
log.debug("Output directory: %s", output_dir)
# Run task
timeout_seconds = int(self.config.get("timeout", "0"))
task_timeout = timeout_seconds if timeout_seconds > 0 else None
#
task = subprocess.run([
"insider", "-force", "-no-html",
"-target", self.config.get("code"), "-tech", self.config.get("tech")
], cwd=output_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
], cwd=output_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=task_timeout)
log.log_subprocess_result(task)
output_file = os.path.join(output_dir, os.listdir(output_dir)[0])
parse_findings(output_file, self)
Expand Down Expand Up @@ -87,6 +90,10 @@ def fill_config(data_obj):
len(data_obj), "tech", "csharp",
comment="technology specification: android, ios, csharp, javascript"
)
data_obj.insert(
len(data_obj), "timeout", "0",
comment="(optional) timeout in seconds for insider invocation, set 0 to disable"
)
data_obj.insert(
len(data_obj), "save_intermediates_to", "/data/intermediates/dast",
comment="(optional) Save scan intermediates (raw results, logs, ...)"
Expand Down

0 comments on commit c2112b2

Please sign in to comment.