3.3.1.3. Centralized Security Monitoring & Auditing (CloudTrail, Config, Security Hub, GuardDuty, Detective)
3.3.1.3. Centralized Security Monitoring & Auditing (CloudTrail, Config, Security Hub, GuardDuty, Detective)
💡 First Principle: Maintaining a comprehensive, immutable record of all actions and configurations, combined with continuous threat detection and centralized posture management, is essential for proactive security, rapid incident response, and continuous compliance.
Scenario: A large organization operates a complex AWS environment with multiple accounts. The security team needs a centralized way to monitor for unusual API activity, detect misconfigured resources, identify potential threats, and simplify security investigations across their entire AWS footprint.
Effective security management requires deep visibility and continuous vigilance.
- "AWS CloudTrail": A service that records API calls and related events in your AWS account.
- Practical Relevance: Essential for security incident investigation (who did what, when, where), compliance auditing, and operational troubleshooting. Centralize logs to a dedicated
"S3 bucket"in a logging account.
- Practical Relevance: Essential for security incident investigation (who did what, when, where), compliance auditing, and operational troubleshooting. Centralize logs to a dedicated
- "AWS Config": A service that continuously monitors and records AWS resource configurations.
- Practical Relevance: Assesses configurations against desired settings ("managed/custom rules") for compliance, identifies "configuration drift", and triggers automated remediation. Crucial for continuous compliance and auditing.
- "AWS Security Hub": A service that aggregates security alerts and findings from AWS services and partner solutions.
- Practical Relevance: Provides a centralized view of your security posture, performs automated security checks against best practices, and allows for integrated incident response workflows.
- "Amazon GuardDuty": An intelligent threat detection service.
- Practical Relevance: Continuously monitors for malicious activity and unauthorized behavior (e.g., unusual API calls, suspicious network traffic, compromised credentials). Uses machine learning and threat intelligence.
- "Amazon Detective": A service that automatically collects log data from
"AWS CloudTrail","Amazon VPC Flow Logs", and"Amazon GuardDuty"and uses machine learning, statistical analysis, and graph theory to build a linked set of data.- Practical Relevance: Simplifies and accelerates security investigations by allowing security analysts to quickly visualize and analyze potential security issues, helping to pinpoint root causes.
Visual: Centralized Security Monitoring & Auditing
Choosing the Right Service and Organization-Wide Setup:
- CloudTrail across an Organization: An organization trail created in the management (or delegated administrator) account logs every member account to one central bucket in the logging account, and members cannot turn it off. Protect the logs with log file validation, a restrictive bucket policy and S3 Object Lock for immutable retention. The console's event history keeps only the last 90 days of management events, so retention beyond that needs a trail delivering to S3.
"CloudTrail"answers who called which API, when and from which IP;"Config"records resource configuration history, not who acted;"VPC Flow Logs"record traffic metadata. Central VPC Flow Logs and CloudTrail delivery also need a bucket policy that allows the log-delivery service principals to write. - Security Hub: Aggregates findings from
"GuardDuty","Inspector","Macie","IAM Access Analyzer","Config"and partners, runs automated checks against standards (AWS Foundational Security Best Practices, CIS, PCI DSS, NIST 800-53) and gives a security score; a delegated administrator sees all accounts (and, with aggregation, Regions), and"EventBridge"rules on findings drive automated response. It aggregates rather than detects threats or collects audit evidence. - GuardDuty: Analyzes
"CloudTrail"events,"VPC Flow Logs"and DNS logs on its own, without you enabling or managing those logs; protection plans (S3, EKS, Lambda, malware, RDS) are optional add-ons. For an Organization, designate a delegated administrator account (not the management account), turn on auto-enable for new accounts and the protection plans, and read all findings there; members managed this way cannot suspend or disable GuardDuty or change suppression rules themselves. It is Regional, so repeat per Region."Firewall Manager"does not manage it. - Inspector: Continuous vulnerability scanning of
"EC2"instances (via the SSM Agent, no third-party scanner),"ECR"container images (on push and continuously) and"Lambda"functions, for software CVEs and unintended network exposure, with risk-prioritized findings and organization-wide delegated administration; findings can fail a CI/CD stage."Patch Manager"applies patches but does not report vulnerabilities,"GuardDuty"finds threats,"Macie"finds sensitive data. - Config detect-and-fix: A managed rule (
restricted-ssh,iam-user-mfa-enabled,s3-bucket-public-read-prohibited) flags non-compliant resources and a remediation action running a"Systems Manager"Automation document fixes them. This is a detective control that acts after the change; an"SCP"is the preventive control."GuardDuty"and"VPC Flow Logs"do not evaluate resource configuration.
Security Hub CSPM, Central Configuration and the New Security Hub:
- Names: In 2025 AWS renamed the original service
"AWS Security Hub CSPM"(cloud security posture management): it runs automated checks (controls) against standards such as AWS Foundational Security Best Practices, CIS AWS Foundations, PCI DSS and NIST SP 800-53, produces findings and a security score, and aggregates findings from other services. A new"AWS Security Hub"(generally available December 2025) sits on top: it correlates signals from Security Hub CSPM,"Inspector","Macie","GuardDuty"and others into exposure findings that rank which resources are actually at risk. Its exposure features need Security Hub CSPM and Inspector turned on. A scenario that asks for continuous checks against a compliance standard is a Security Hub CSPM job. - Central configuration (Security Hub CSPM): from the delegated administrator, create configuration policies (which standards and controls are on, with parameters) and associate them with the organization root, OUs or accounts, in every linked Region. Centrally managed accounts cannot change those settings themselves, and cross-Region aggregation brings all findings into one home Region. This replaces per-account, per-Region enablement that drifts as account teams switch controls off.
- AWS Config conformance packs are the other continuous compliance tool: a pack is a set of Config rules and remediation actions deployed as one unit. AWS publishes sample templates (for example Operational Best Practices for PCI DSS or for HIPAA Security). An organization conformance pack, deployed from the management or a delegated administrator account, reaches every account, including accounts that join later, and an organization Config aggregator gives one view of compliance across accounts and Regions. Use conformance packs when you need your own rule set, custom rules or automatic remediation; use Security Hub CSPM when an AWS-maintained standard and a score fit.
⚠️ Common Pitfall: Enabling security services but not centralizing their findings. In a multi-account environment, findings scattered across dozens of accounts are impossible to manage effectively. Use "AWS Organizations" integration to designate a central security account for services like "GuardDuty" and "Security Hub".
Key Trade-Offs:
- Data Volume vs. Cost: These services generate a large volume of data (logs, findings). While essential for security, there are associated costs for data storage (
S3) and analysis that must be managed, often with lifecycle policies.
Reflection Question: How would you combine "AWS CloudTrail", "AWS Config", "Amazon GuardDuty", "AWS Security Hub", and "Amazon Detective" to create a comprehensive, centralized security monitoring and auditing solution for a complex multi-account AWS environment, enabling proactive threat detection and simplified security investigations?