mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(allowlist): verify if allowlist file exists (#2988)
This commit is contained in:
@@ -552,9 +552,12 @@ def execute(
|
||||
)
|
||||
|
||||
# Allowlist findings
|
||||
check_findings = allowlist_findings(
|
||||
audit_output_options.allowlist_file, audit_info.audited_account, check_findings
|
||||
)
|
||||
if audit_output_options.allowlist_file:
|
||||
check_findings = allowlist_findings(
|
||||
audit_output_options.allowlist_file,
|
||||
audit_info.audited_account,
|
||||
check_findings,
|
||||
)
|
||||
|
||||
# Report the check's findings
|
||||
report(check_findings, audit_output_options, audit_info)
|
||||
|
||||
@@ -121,17 +121,16 @@ def allowlist_findings(
|
||||
check_findings: [Any],
|
||||
):
|
||||
# Check if finding is allowlisted
|
||||
if allowlist:
|
||||
for finding in check_findings:
|
||||
if is_allowlisted(
|
||||
allowlist,
|
||||
audited_account,
|
||||
finding.check_metadata.CheckID,
|
||||
finding.region,
|
||||
finding.resource_id,
|
||||
unroll_tags(finding.resource_tags),
|
||||
):
|
||||
finding.status = "WARNING"
|
||||
for finding in check_findings:
|
||||
if is_allowlisted(
|
||||
allowlist,
|
||||
audited_account,
|
||||
finding.check_metadata.CheckID,
|
||||
finding.region,
|
||||
finding.resource_id,
|
||||
unroll_tags(finding.resource_tags),
|
||||
):
|
||||
finding.status = "WARNING"
|
||||
return check_findings
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user