mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
feat(securityhub_check): Add check and service for SecurityHub (#1360)
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>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
Reference in New Issue
Block a user