Skip to content

Commit

Permalink
vuln thresholds dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Long committed Feb 21, 2024
1 parent 4e62e45 commit d88fc81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/present_findings.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,17 @@ def main():
parse_inspector_findings(findings_json)
print(json.dumps(output, indent=4))

if not thresholds_enabled:
return

thresholds = {critical_threshold: output['critical_vulnerabilities'],
high_threshold: output['high_vulnerabilities'],
medium_threshold: output['medium_vulnerabilities'],
low_threshold: output['low_vulnerabilities'],
}
for key, value in thresholds.items():
if is_threshold_exceeded(key, value):
time.sleep(1) # sleep 1 second to avoid clobbering the printing of 'output' variable
time.sleep(1) # sleep 1 second to avoid clobbering the printing of 'output' variable
logging.warning(f"vulnerability count threshold exceeded")
sys.exit(1)

Expand Down

0 comments on commit d88fc81

Please sign in to comment.