Security Hub
Absolutely! Here's the complete AWS Security Hub tutorial, with the final section covering how to disable Security Hub.
π What is AWS Security Hub?¶
AWS Security Hub is a security posture management service that centralizes and automates security checks, aggregates findings from AWS services and partner tools, and helps you monitor compliance using industry standards like CIS AWS Foundations Benchmark, PCI-DSS, etc.
π§± 1. Enable AWS Security Hub¶
β Steps:¶
- Go to AWS Console > Security Hub
- Click Enable Security Hub
- (Optional) Choose the standards to enable:
- CIS AWS Foundations Benchmark
- PCI DSS
- AWS Foundational Security Best Practices
π You can enable it via CLI:
aws securityhub enable-security-hub \
--standards-subscription-requests \
StandardsArn="arn:aws:securityhub:::standards/aws-foundational-security-best-practices/v/1.0.0"
π 2. Integrate AWS Services¶
Security Hub integrates with: - Amazon GuardDuty (threat detection) - AWS Config (resource compliance) - Amazon Macie (sensitive data detection) - IAM Access Analyzer - Inspector (vulnerabilities) - Firewall Manager
Enable each service in their respective consoles or via CLI.
Example for GuardDuty:
π§° 3. Integrate Third-Party Tools¶
Security Hub supports partner tools like: - Palo Alto - Trend Micro - CrowdStrike - Splunk - Check Point
Go to Security Hub > Integrations, and select third-party products to enable integration.
π 4. Viewing and Managing Findings¶
- Go to Security Hub > Findings
- Use filters: severity, compliance status, resource type, etc.
- Findings are normalized using the AWS Security Finding Format (ASFF)
βοΈ 5. Automate Response with AWS Lambda¶
Use EventBridge + Lambda to automate remediation.
Example: Stop non-compliant EC2¶
{
"source": ["aws.securityhub"],
"detail-type": ["Security Hub Findings - Imported"],
"detail": {
"findings": {
"Compliance": {
"Status": ["FAILED"]
}
}
}
}
Lambda function can tag, stop, or quarantine the EC2 instance.
π 6. Enable Compliance Standards¶
Go to Security Hub > Compliance to see results of standard checks like:
- CIS AWS Foundations
- PCI-DSS
- AWS Best Practices
You can disable non-relevant controls.
π§ͺ 7. Create Custom Insights¶
- Go to Insights > Create Insight
- Filter by severity, resource type, account ID, etc.
- Save the query for dashboard monitoring.
π₯ 8. Export Findings¶
CLI:¶
Python (Boto3):¶
You can also set up a Lambda to send filtered findings to S3.
π§ 9. Best Practices¶
- Use AWS Organizations for centralized management
- Enable auto-enable for new accounts
- Integrate with SIEMs like Splunk/ELK
- Regularly review insights and findings
- Suppress known false positives
π‘οΈ 10. Pricing¶
- Charged per security check per resource
- Charged per finding ingestion
- First 30 days free
Use the AWS Pricing Calculator for estimates.
π 11. How to Disable AWS Security Hub¶
β Via Console:¶
- Go to Security Hub > Settings
- Scroll to the bottom
- Click Disable Security Hub
β Via CLI:¶
β οΈ Note:¶
- This removes all findings, insights, and standard subscriptions.
- You can re-enable Security Hub later, but previous data wonβt be recovered.