diff --git a/prowler/lib/check/check.py b/prowler/lib/check/check.py index daeef528..deabd70d 100644 --- a/prowler/lib/check/check.py +++ b/prowler/lib/check/check.py @@ -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) diff --git a/prowler/providers/aws/lib/allowlist/allowlist.py b/prowler/providers/aws/lib/allowlist/allowlist.py index 5becf54d..b63340f7 100644 --- a/prowler/providers/aws/lib/allowlist/allowlist.py +++ b/prowler/providers/aws/lib/allowlist/allowlist.py @@ -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