mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-12 15:55:09 +00:00
feat(pip): Prepare for PyPI (#1531)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"Provider": "aws",
|
||||
"CheckID": "securityhub_enabled",
|
||||
"CheckTitle": "Check if Security Hub is enabled and its standard subscriptions.",
|
||||
"CheckType": [
|
||||
"Logging and Monitoring"
|
||||
],
|
||||
"ServiceName": "securityhub",
|
||||
"SubServiceName": "",
|
||||
"ResourceIdTemplate": "arn:partition:securityhub:region:account-id:hub/hub-id",
|
||||
"Severity": "high",
|
||||
"ResourceType": "AwsSecurityHubHub",
|
||||
"Description": "Check if Security Hub is enabled and its standard subscriptions.",
|
||||
"Risk": "AWS Security Hub gives you a comprehensive view of your security alerts and security posture across your AWS accounts.",
|
||||
"RelatedUrl": "https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-enable-disable.html",
|
||||
"Remediation": {
|
||||
"Code": {
|
||||
"CLI": "aws securityhub enable-security-hub --enable-default-standards",
|
||||
"NativeIaC": "",
|
||||
"Other": "",
|
||||
"Terraform": ""
|
||||
},
|
||||
"Recommendation": {
|
||||
"Text": "Security Hub is Regional. When you enable or disable a security standard, it is enabled or disabled only in the current Region or in the Region that you specify.",
|
||||
"Url": "https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-enable-disable.html"
|
||||
}
|
||||
},
|
||||
"Categories": [],
|
||||
"Tags": {
|
||||
"Tag1Key": "value",
|
||||
"Tag2Key": "value"
|
||||
},
|
||||
"DependsOn": [],
|
||||
"RelatedTo": [],
|
||||
"Notes": ""
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
from prowler.lib.check.models import Check, Check_Report
|
||||
from prowler.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 = "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