GuardDuty, Security Hub, Inspector and Findings Automation
Overview
Security tools produce findings: alerts about suspicious behaviour or weaknesses. Amazon GuardDuty detects threats by analysing CloudTrail, VPC Flow Logs, DNS logs and more; Amazon Inspector scans for software vulnerabilities; Amazon Macie finds sensitive data in S3; IAM Access Analyzer finds unintended access. AWS Security Hub pulls them together with security-standard checks into one view.
Imagine a hospital's monitoring station. GuardDuty is the nurse watching vitals for unusual patterns, Inspector is the routine health screening, Macie checks that sensitive records are in locked cabinets, and Security Hub is the central dashboard that lists every alert and triggers the response team.
DOP-C02 emphasises enabling these services organisation-wide with a delegated administrator, normalising findings (ASFF), and automating response with EventBridge and Lambda or Systems Manager, while avoiding noisy, manual processes.
Key Concepts
- GuardDuty is regional and uses ML and threat intel on CloudTrail (management + S3 data events), VPC Flow Logs, DNS logs, EKS audit logs, S3, RDS login, Lambda network and Malware Protection; no agents are needed for the core sources.
- Inspector continuously scans EC2 (via SSM agent or agentless snapshot scan), ECR images and Lambda functions for CVEs and unintended network exposure, and prioritises with an Inspector score.
- Security Hub CSPM runs automated checks against standards (AWS Foundational Security Best Practices, CIS, PCI DSS, NIST 800-53) and aggregates findings in ASFF from AWS services and partners.
- Cross-Region aggregation and delegated administrator with auto-enable provide one pane of glass for the organisation.
- Macie discovers PII in S3 and evaluates bucket exposure; Detective builds investigation graphs from log data.
- EventBridge receives findings (source
aws.guardduty,aws.securityhub) so rules can trigger Lambda, SSM Automation or Step Functions; Security Hub custom actions let analysts trigger a response manually. - Automation rules in Security Hub change finding fields (severity, workflow status, notes) automatically; suppression handles known benign findings.
- Trusted IP lists and threat lists (GuardDuty) and suppression rules reduce noise.
Detailed Notes
Service roles
| Service | Detects | Source of data |
|---|---|---|
| GuardDuty | Compromised credentials, crypto-mining, C2 traffic, exfiltration, malware | CloudTrail, VPC Flow, DNS, EKS, S3, RDS, Lambda, EBS |
| Inspector | CVEs, network reachability | EC2, ECR, Lambda |
| Macie | Sensitive data and public buckets | S3 objects and metadata |
| Access Analyzer | External or unused access | IAM, S3, KMS and others policies |
| Security Hub | Misconfigurations against standards, aggregates all | Config + integrations |
| Detective | Root cause investigation | CloudTrail, Flow, GuardDuty |
Organisation-wide enablement
# From the management account
aws guardduty enable-organization-admin-account --admin-account-id 111122223333
aws securityhub enable-organization-admin-account --admin-account-id 111122223333
aws inspector2 enable-delegated-admin-account --delegated-admin-account-id 111122223333
# From the delegated admin
aws guardduty update-organization-configuration --detector-id $DET --auto-enable-organization-members ALL
aws securityhub update-organization-configuration --auto-enable
aws securityhub create-finding-aggregator --region-linking-mode ALL_REGIONS
Security Hub needs AWS Config enabled to run most standard controls. Central configuration policies can enforce which standards and controls are enabled for OUs.
Findings and ASFF
{
"SchemaVersion": "2018-10-08",
"Id": "arn:aws:guardduty:us-east-1:111122223333:detector/abc/finding/xyz",
"ProductArn": "arn:aws:securityhub:us-east-1::product/aws/guardduty",
"Severity": { "Label": "HIGH" },
"Types": ["TTPs/Command and Control/Backdoor:EC2-C&CActivity.B"],
"Resources": [{ "Type": "AwsEc2Instance", "Id": "i-0abc1234" }],
"Workflow": { "Status": "NEW" },
"Compliance": { "Status": "FAILED" }
}
Custom or third-party tools can import findings with BatchImportFindings.
Automated response pattern
{
"source": ["aws.guardduty"],
"detail-type": ["GuardDuty Finding"],
"detail": { "severity": [{ "numeric": [">=", 7] }], "type": [{ "prefix": "UnauthorizedAccess:EC2" }] }
}
The rule targets a Step Functions workflow that: (1) tags the instance quarantine, (2) replaces its security groups with an isolation group, (3) snapshots the EBS volumes for forensics, (4) revokes the instance role sessions with an IAM deny policy (aws:TokenIssueTime), (5) notifies the team and opens a ticket. Use SSM Automation for step execution across accounts.
Common GuardDuty finding types
| Finding | Meaning |
|---|---|
| UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS | Instance role credentials used from outside AWS |
| CryptoCurrency:EC2/BitcoinTool.B | Instance talking to mining pool |
| Recon:EC2/PortProbeUnprotectedPort | Port scanning |
| Policy:S3/BucketPublicAccessGranted | Bucket made public |
| Backdoor:EC2/C&CActivity.B | Command-and-control traffic |
Security Hub standards and scoring
Each control returns PASSED, FAILED, WARNING or NOT_AVAILABLE; a security score per standard shows overall health. Disable controls that do not apply and use automation rules to set severity, assign notes and suppress. Use custom insights to group findings (by account, resource type, severity).
Inspector in pipelines
Enable ECR enhanced scanning so Inspector continuously scans images and raises EventBridge events (Inspector2 Finding). A pipeline gate can query findings via API and fail promotion if critical CVEs exist. For EC2, Inspector uses the SSM agent inventory; unsupported instances can use agentless scanning.
Retention, SIEM and data lake
Amazon Security Lake normalises logs and findings to OCSF in S3 for SIEMs. Forward findings to a ticketing tool via EventBridge API destinations. Archive findings for audits, since Security Hub retains them for 90 days.
Pitfalls
Auto-quarantine can cause outages on false positives; start with notify-only, then isolate high-confidence types. Remember GuardDuty must be enabled in every Region (including unused ones) to detect misuse of unused Regions.
Findings pipeline and triage
- Security Hub (with the CSPM standards: AWS Foundational Security Best Practices, CIS, PCI DSS, NIST) aggregates findings in ASFF format from GuardDuty, Inspector, Macie, Config, IAM Access Analyzer and partners; designate a delegated administrator and enable cross-Region aggregation.
- Automation rules in Security Hub can suppress, re-severity or tag findings; custom actions send selected findings to EventBridge for remediation.
- Detective builds behaviour graphs from CloudTrail, flow logs and GuardDuty to investigate root cause.
- Inspector scans EC2, ECR images and Lambda continuously and scores by exploitability; Macie discovers sensitive data in S3.
{
"source": ["aws.securityhub"],
"detail-type": ["Security Hub Findings - Imported"],
"detail": { "findings": { "Severity": { "Label": ["CRITICAL", "HIGH"] }, "Workflow": { "Status": ["NEW"] } } }
}
Route high-severity findings to Step Functions or SSM Automation, record workflow status updates (NOTIFIED, RESOLVED) in Security Hub and keep a suppression process documented.
Real World Example
Scenario: a crypto-mining attack in a forgotten Region. An attacker uses leaked access keys to launch GPU instances in ap-southeast-3. Because the security team enabled GuardDuty in all Regions through the delegated administrator, a CryptoCurrency finding is raised within minutes and aggregated to the central Security Hub.
An EventBridge rule starts a Step Functions workflow that isolates the instances, snapshots volumes, disables the compromised IAM user's keys and opens a ticket. An SCP is then added to deny unused Regions.
Architecture Diagram
Detection services feed Security Hub; EventBridge triggers response workflows.
- 1GuardDuty, Inspector and Config raise findings in each account and Region.
- 2Findings are aggregated to the delegated administrator in ASFF.
- 3Automation rules adjust severity and suppress known noise.
- 4EventBridge matches high-severity findings and starts a workflow.
- 5The workflow isolates resources, preserves evidence and notifies responders.
Best Practices
- ✓Enable GuardDuty and Security Hub in all Regions with delegated admin and auto-enable.
- ✓Automate response with EventBridge + Step Functions/SSM, starting in notify-only mode.
- ✓Use automation rules and suppression to cut noise and keep severity meaningful.
- ✓Enable Inspector on EC2, ECR and Lambda and gate pipelines on critical CVEs.
- ✓Send findings to Security Lake or a SIEM and keep evidence for audits.
Common Interview Questions
Exam Tips
DOP-C02 focus
- "Aggregate security findings across accounts and standards" = Security Hub (needs Config).
- "Detect compromised credentials, crypto mining, unusual API calls" = GuardDuty.
- "Scan ECR images / EC2 / Lambda for CVEs" = Inspector; "PII in S3" = Macie.
- "Respond automatically to findings" = EventBridge rule on aws.guardduty / aws.securityhub.
Finished this lesson?
0 of 44 lessons done · 0% of the course

