GuardDuty, Inspector and Macie
Amazon GuardDuty for intelligent threat detection, Amazon Inspector for automated vulnerability scanning of EC2, container images and Lambda, and Amazon Macie for finding sensitive data in S3.
Amazon GuardDuty
Amazon GuardDuty is intelligent threat discovery to protect an AWS account.
- Uses machine learning algorithms, anomaly detection and third-party threat intelligence.
- One click to enable (30-day trial), no need to install software.
- Input data includes:
- CloudTrail event logs: unusual API calls, unauthorized deployments;
- CloudTrail management events: create VPC subnet, create trail…
- CloudTrail S3 data events: get object, list objects, delete object…
- VPC Flow Logs: unusual internal traffic, unusual IP addresses;
- DNS logs: compromised EC2 instances sending encoded data within DNS queries;
- optional features: EKS audit logs, runtime monitoring, RDS and Aurora login activity, EBS and S3 malware scans, Lambda network activity, S3 data events…
- CloudTrail event logs: unusual API calls, unauthorized deployments;
- Flow Logs and DNS logging do not need to be turned on separately: GuardDuty reads the foundational sources directly.
- Set up EventBridge rules to be notified of findings; the rules can target Lambda or SNS.
- Can protect against cryptocurrency attacks (it has a dedicated finding for crypto mining).
GuardDuty also has Extended Threat Detection (free, on by default), which links separate events into one attack sequence finding.
Amazon Inspector
Amazon Inspector runs automated security assessments.
- For EC2 instances:
- uses the Systems Manager (SSM) agent (or an agentless scan of the volumes);
- analyzes against unintended network accessibility;
- analyzes the running OS against known vulnerabilities.
- For container images pushed to Amazon ECR: assesses images as they're pushed.
- For Lambda functions:
- identifies software vulnerabilities in function code and package dependencies;
- assesses functions as they're deployed.
- Reporting and integration with AWS Security Hub; sends findings to EventBridge.
What does Inspector evaluate?
- Remember: only EC2 instances, container images and Lambda functions.
- Continuous scanning of the infrastructure, only when needed (new package, new CVE…).
- Package vulnerabilities (EC2, ECR and Lambda), against a database of CVEs.
- Network reachability (EC2).
- A risk score is associated with every vulnerability, for prioritization.
Amazon Macie
Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to discover and protect sensitive data in AWS.
- Macie helps identify and alert on sensitive data, such as personally identifiable information (PII): names, credit card numbers, passport numbers…
- It works on S3: an inventory of the account's buckets, their security (public access, encryption), and automated discovery of sensitive data in objects.
- Findings go to EventBridge (and Security Hub) for integrations.
Real-world examples
- GuardDuty raises a
CryptoCurrency:EC2/BitcoinToolfinding for an instance a developer left open; an EventBridge rule runs a Lambda function that isolates it with a quarantine security group. - Inspector flags a critical CVE in a container image just pushed to ECR, and the pipeline blocks the deployment.
- Macie finds a CSV of customer emails and card numbers in a bucket meant for logs.
Exam tips
- "Detect threats", "compromised instance", "crypto mining", "unusual API calls" → GuardDuty.
- "Scan EC2, ECR images or Lambda for vulnerabilities (CVEs)" → Inspector.
- "Find PII or sensitive data in S3" → Macie.
- "Automate a response to a finding" → EventBridge rule → Lambda or SNS.
Common traps
- "Inspector scans RDS databases or S3." Only EC2, ECR images and Lambda.
- "Enable VPC Flow Logs first for GuardDuty." GuardDuty reads the flow and DNS data itself.
- "Macie scans EBS volumes." Macie is for S3.
Check yourself
GuardDuty and Inspector have free trials, but a meaningful test needs real activity, so instead:
Enable GuardDuty (it analyses VPC Flow Logs and DNS logs) and create an EventBridge rule on its findings that notifies an SNS topic.
Use Amazon Macie's automated sensitive data discovery on the S3 buckets, and review its findings and bucket security summary.
AWS documentation
DDoS resiliency best practices
The AWS best practices for DDoS resiliency, BP1 to BP7, edge location mitigation, infrastructure and application layer defense, and attack surface reduction.
Detective, Security Hub and Artifact
AWS Security Hub for a central view of security findings and best-practice checks, Amazon Detective for investigating the root cause of findings, and AWS Artifact for AWS compliance reports and agreements.