mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-12 15:55:09 +00:00
fix(trustedadvisor): avoid not_available checks (#2323)
This commit is contained in:
@@ -10,14 +10,17 @@ class trustedadvisor_errors_and_warnings(Check):
|
||||
if trustedadvisor_client.enabled:
|
||||
if trustedadvisor_client.checks:
|
||||
for check in trustedadvisor_client.checks:
|
||||
report = Check_Report_AWS(self.metadata())
|
||||
report.region = check.region
|
||||
report.resource_id = check.id
|
||||
report.status = "FAIL"
|
||||
report.status_extended = f"Trusted Advisor check {check.name} is in state {check.status}."
|
||||
if check.status == "ok":
|
||||
report.status = "PASS"
|
||||
findings.append(report)
|
||||
if (
|
||||
check.status != "not_available"
|
||||
): # avoid not_available checks since there are no resources that apply
|
||||
report = Check_Report_AWS(self.metadata())
|
||||
report.region = check.region
|
||||
report.resource_id = check.id
|
||||
report.status = "FAIL"
|
||||
report.status_extended = f"Trusted Advisor check {check.name} is in state {check.status}."
|
||||
if check.status == "ok":
|
||||
report.status = "PASS"
|
||||
findings.append(report)
|
||||
else:
|
||||
report = Check_Report_AWS(self.metadata())
|
||||
report.status = "INFO"
|
||||
|
||||
Reference in New Issue
Block a user