15.3 Automated Threat Detection: GuardDuty, Inspector & Security Hub
Key Takeaways
- Amazon GuardDuty provides continuous, serverless, and agentless threat intelligence by analyzing CloudTrail management/data logs, VPC Flow Logs, DNS logs, EKS audit logs, RDS login logs, and EBS volume snapshots using machine learning and anomaly detection.
- GuardDuty findings are assigned severity values on a 1.0–10.0 scale grouped into four levels — Low (1.0–3.9), Medium (4.0–6.9), High (7.0–8.9), and Critical (9.0–10.0) — pinpointing threats such as EC2 cryptocurrency mining, Tor exit node communications, and IAM credential exfiltration outside AWS.
- Amazon Inspector delivers automated, continuous vulnerability assessments across Amazon EC2 instances (via SSM Agent or agentless scanning), Amazon ECR container repositories (continuous scanning), and AWS Lambda functions, computing contextual risk scores against Common Vulnerabilities and Exposures (CVEs).
- AWS Security Hub acts as the centralized security posture management hub, ingesting and normalizing findings from GuardDuty, Inspector, Macie, IAM Access Analyzer, and third-party tools into the standard AWS Security Finding Format (ASFF).
- Security Hub continuously measures compliance against recognized security benchmarks (CIS AWS Foundations Benchmark, AWS Foundational Security Best Practices, PCI DSS), dispatching findings to Amazon EventBridge to execute automated remediation via AWS Systems Manager Automation or Lambda.
Automated Threat Detection & Security Posture Architecture
Enterprise DevOps environments require real-time visibility into unauthorized behaviors, software vulnerabilities, and compliance drift across hundreds of accounts. AWS provides a coordinated triad of automated detection and posture management services:
[ Telemetry Sources: CloudTrail, VPC Flow, DNS, EKS, EBS ]
│
▼
┌────────────────────────────────────────────────────────┐
│ Amazon GuardDuty (Behavioral Anomaly & Threat Intel) │
└──────────────────────────┬─────────────────────────────┘
│
[ Compute Assets: EC2, ECR Containers, Lambda Functions ]
│
▼
┌────────────────────────────────────────────────────────┐
│ Amazon Inspector (Continuous CVE Vulnerability Scans) │
└──────────────────────────┬─────────────────────────────┘
│
▼ Normalized ASFF Findings
┌────────────────────────────────────────────────────────┐
│ AWS Security Hub (Centralized Posture & Compliance) │
│ • CIS AWS Foundations Benchmark • AWS FSBP • PCI-DSS │
└──────────────────────────┬─────────────────────────────┘
│ Near-Real-Time Findings
▼
┌────────────────────────────────────────────────────────┐
│ Amazon EventBridge (Event Pattern Matching) │
└───────┬────────────────────────────────────────┬───────┘
▼ ▼
[ AWS Systems Manager Automation ] [ AWS Lambda Remediation ]
(Quarantine SG / Snapshot Host) (Revoke Stolen IAM Session)
Amazon GuardDuty: Intelligent Threat Detection
Amazon GuardDuty is a fully managed, serverless threat detection service that continuously monitors AWS accounts and workloads for malicious activity and unauthorized behavior. Crucially, GuardDuty is completely agentless and operates independently of customer compute resources, meaning it incurs zero performance overhead on running applications.
Telemetry Ingestion Streams
GuardDuty ingests massive volumes of operational telemetry directly from the underlying AWS service virtualization layer:
- AWS CloudTrail Management Events: Monitors control plane API calls for unauthorized reconnaissance, privilege escalation, and console logins from Tor exit nodes.
- AWS CloudTrail S3 Data Events: Analyzes object-level operations (
GetObject,PutObject) to identify compromised credentials exfiltrating bulk data or attempting ransomware encryption. - Amazon VPC Flow Logs: Evaluates network connection metadata (IP addresses, ports, protocols, byte counts) to detect command-and-control (C2) communication, port scanning, and denial-of-service traffic.
- Amazon Route 53 DNS Query Logs: Inspects DNS queries issued by EC2 instances to identify Domain Generation Algorithms (DGA), DNS data exfiltration, and communication with known malware domains.
- Amazon EKS Audit Logs & Runtime Monitoring: Analyzes Kubernetes API control plane events and deploys an optional lightweight eBPF kernel agent to monitor host/container runtime activities.
- Amazon RDS Login Activity: Monitors failed and anomalous database login attempts against Aurora, PostgreSQL, and MySQL databases.
- Amazon EBS Malware Protection: Initiates automated, agentless malware scans on attached EBS volumes when GuardDuty detects suspicious EC2 behavior (e.g., cryptocurrency mining).
Finding Anatomy & Severity Scoring
GuardDuty findings follow a structured naming convention:
Examples include CryptoCurrency:EC2/BitcoinTool.B!DNS and UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS.
| Severity Tier | Numerical Range | Operational Meaning & Incident SLA |
|---|---|---|
| Low | 1.0 – 3.9 | Suspicious or unusual behavior detected; low immediate risk. Should be reviewed in daily security operations logs. |
| Medium | 4.0 – 6.9 | Suspicious activity observed (e.g., port scanning or API calls from an unusual location). Requires operational investigation within hours. |
| High | 7.0 – 8.9 | Resource is actively compromised (e.g., active cryptocurrency mining, C2 communication, or IAM credentials exfiltrated outside AWS). Requires immediate automated remediation. |
| Critical | 9.0 – 10.0 | An attack sequence is in progress or recently completed across multiple resources (GuardDuty Extended Threat Detection correlates related signals into one finding). Top triage priority — these frequently precede ransomware. |
Amazon Inspector: Automated Vulnerability Management
Amazon Inspector is an automated vulnerability management service that continually scans AWS workloads for software vulnerabilities (Common Vulnerabilities and Exposures - CVEs) and unintended network exposure.
Modern Amazon Inspector vs. Inspector Classic
| Dimension | Amazon Inspector Classic (Legacy) | Modern Amazon Inspector |
|---|---|---|
| Execution Model | Scheduled assessments via standalone agent | Continuous, automated, event-driven scanning |
| Agent Requirements | Dedicated Inspector Classic Agent required | Uses AWS Systems Manager (SSM) Agent or hybrid agentless snapshot scanning |
| Target Resources | EC2 instances only | EC2 instances, Amazon ECR container images, and AWS Lambda functions |
| ECR Container Scanning | Basic scanning (OS packages only) on push or on demand | Enhanced scanning on push + continuous re-scanning as new CVEs emerge |
| Risk Scoring | Standard CVSS base score only | Contextual Inspector Score factoring in real-world exploitability and network reachability |
Contextual Risk Scoring Engine
Unlike traditional scanners that report raw CVSS base scores, Amazon Inspector computes a Contextual Inspector Score by correlating:
- The Common Vulnerability Scoring System (CVSS) base metric.
- Network Reachability: Evaluates VPC route tables, security groups, Internet Gateways, and Network ACLs to determine if the vulnerable package is accessible from the public internet.
- Exploit Availability: Checks public exploit databases (such as CISA Known Exploited Vulnerabilities catalog) to determine if active exploit code exists in the wild.
If a vulnerability has a high CVSS base score but resides on an isolated private EC2 instance with no internet ingress and no active exploit code, Inspector downweights the score to prevent alert fatigue.
AWS Security Hub: Centralized Posture & Compliance Governance
AWS Security Hub provides a centralized security and compliance management center. It aggregates, normalizes, and prioritizes findings from GuardDuty, Inspector, Macie, IAM Access Analyzer, AWS Firewall Manager, and third-party partner products.
AWS Security Finding Format (ASFF)
Security Hub normalizes all ingested findings into a standard JSON schema known as AWS Security Finding Format (ASFF). This enables DevOps engineers to build unified EventBridge routing rules regardless of which security service generated the finding.
{
"SchemaVersion": "2016-11-21",
"Id": "arn:aws:securityhub:us-east-1:111122223333:subscription/cis-aws-foundations-benchmark/v/1.2.0/2.2/finding/ab12cd34",
"ProductArn": "arn:aws:securityhub:us-east-1::product/aws/securityhub",
"GeneratorId": "cis-aws-foundations-benchmark/v/1.2.0/2.2",
"AwsAccountId": "111122223333",
"Types": ["Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"],
"FirstObservedAt": "2026-09-11T12:00:00Z",
"Severity": {
"Label": "HIGH",
"Normalized": 70
},
"Title": "2.2 Ensure CloudTrail log file validation is enabled",
"Description": "CIS Benchmark recommendation for verifying log integrity.",
"Resources": [
{
"Type": "AwsCloudTrailTrail",
"Id": "arn:aws:cloudtrail:us-east-1:111122223333:trail/main-trail",
"Partition": "aws",
"Region": "us-east-1"
}
],
"Compliance": {
"Status": "FAILED"
}
}
Automated Remediation Pipelines
DevOps teams automate remediation using Security Hub Custom Actions (manual trigger from console) or Amazon EventBridge Rules (fully automated real-time matching):
- EventBridge Rule: Matches ASFF findings where
ProductNameisGuardDutyandSeverity.LabelisHIGHorCRITICAL. - Remediation Targets:
- Compromised EC2 Instance: Lambda invokes
ec2:ModifyInstanceAttributeto strip existing security groups and attach an isolated quarantine security group (no ingress, no egress), while triggering an SSM Automation runbook to capture a forensic memory dump and EBS snapshot. - Exfiltrated IAM Credentials: Lambda attaches an inline IAM policy to the compromised role with an explicit Deny for all API calls where
aws:TokenIssueTimeis earlier than the incident detection timestamp, neutralizing stolen temporary session tokens. - Vulnerable Container Image in Production: EventBridge invokes an AWS CodePipeline or GitHub Actions webhook to trigger a clean rebuild using patched base images.
- Compromised EC2 Instance: Lambda invokes
A security team at a multi-national retailer observes an Amazon GuardDuty finding: UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS with a severity score of High (8.0). The finding indicates that temporary security credentials issued to an EC2 instance profile role have been used from an external IP address outside the AWS network. The DevOps team needs an immediate, automated response that revokes the compromised temporary credentials and isolates the affected EC2 instance without waiting for manual human intervention. Which architecture meets these criteria?
A financial institution deploys containerized microservices to Amazon Elastic Container Service (Amazon ECS) using container images hosted in Amazon Elastic Container Registry (Amazon ECR). Corporate compliance mandates that container images must be continuously evaluated for newly discovered Common Vulnerabilities and Exposures (CVEs) not only when pushed, but throughout their entire lifecycle in the registry. If a Critical CVE is published for an image currently running in production, an automated alert must be dispatched to the security engineering team. How should this requirement be fulfilled?
A multinational enterprise with 200 AWS accounts organized under AWS Organizations needs to centralize security compliance tracking against the CIS AWS Foundations Benchmark and the AWS Foundational Security Best Practices (FSBP) standard. The security team requires a consolidated dashboard in a dedicated Security Account, unified finding formats across all native security tools, and the ability for security analysts to trigger one-click automated remediation of non-compliant resources directly from the console. Which solution satisfies these architectural requirements?