mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
Co-authored-by: Toni de la Fuente <toni@blyx.com> Co-authored-by: sergargar <sergio@verica.io> Co-authored-by: Pepe Fagoaga <pepe@verica.io>
24 lines
892 B
Python
24 lines
892 B
Python
from lib.check.models import Check, Check_Report
|
|
from providers.aws.services.securityhub.securityhub_client import securityhub_client
|
|
|
|
|
|
class securityhub_enabled(Check):
|
|
def execute(self):
|
|
findings = []
|
|
for securityhub in securityhub_client.securityhubs:
|
|
report = Check_Report(self.metadata)
|
|
report.region = securityhub.region
|
|
if securityhub.status == "ACTIVE":
|
|
report.status = "PASS"
|
|
report.status_extended = (
|
|
f"Security Hub is enabled with standards {securityhub.standards}"
|
|
)
|
|
else:
|
|
report.status = "FAIL"
|
|
report.status_extended = f"Security Hub is not enabled"
|
|
report.resource_id = securityhub.id
|
|
report.resource_arn = securityhub.arn
|
|
findings.append(report)
|
|
|
|
return findings
|