SkillSprout
Chapter 10 · Lesson 4
Intermediate
6 min read

GuardDuty

Overview

Amazon GuardDuty is a managed threat detection service. It continuously analyses data sources in your account, such as CloudTrail events, VPC Flow Logs and DNS query logs, and uses machine learning, anomaly detection and threat-intelligence feeds to flag suspicious or malicious behaviour.

Picture a security guard who watches camera footage around the clock and knows the faces of known criminals. GuardDuty reads the "footage" of your account and raises a finding when something looks wrong: an EC2 instance talking to a known command-and-control server, a bitcoin-mining pattern, or credentials used from an unusual country.

You turn it on with a few clicks. There are no agents to install for the core feature, no logs to enable and no impact on performance, which makes it the exam's go-to answer for "intelligent threat detection with minimal effort".

Key Concepts

  • GuardDuty analyses CloudTrail management events, VPC Flow Logs and DNS logs automatically, using independent copies, so you don't need to enable those services.
  • Optional protection plans: S3 data events, EKS audit logs and runtime monitoring, ECS/EC2 runtime monitoring, Malware Protection (EBS and S3), RDS login activity and Lambda network activity.
  • Detections come from machine learning, anomaly detection and threat intelligence (AWS, CrowdStrike, Proofpoint).
  • Findings have a severity (Low, Medium, High) and are sent to the console, EventBridge and Security Hub.
  • GuardDuty detects but does not block; combine it with Lambda, WAF, NACLs or security groups for automated response.
  • It is regional; use AWS Organizations with a delegated administrator to manage multiple accounts.
  • You can add trusted IP lists (no findings) and threat lists (known bad IPs).
  • 30-day free trial, then pay by volume of events and data analysed.

Detailed Notes

What GuardDuty analyses

Data sourceWhat it revealsEnabled by default?
CloudTrail management eventsUnusual API calls, credential misuse, IAM changesYes
VPC Flow LogsPort scans, traffic to malicious IPs, data exfiltration patternsYes
DNS logs (Route 53 Resolver)Queries to malware/crypto domains, DNS tunnellingYes
S3 data eventsSuspicious object access, unusual downloads, public exposureOptional plan
EKS audit logs / runtimeContainer threats, privileged podsOptional plan
Malware ProtectionScans EBS volumes of flagged instances and S3 uploadsOptional plan
RDS login eventsAnomalous database loginsOptional plan
Lambda network activityOutbound connections from functionsOptional plan

GuardDuty reads independent, internal copies of these logs. You do not need to enable VPC Flow Logs, and it does not consume your own flow log quota or incur those charges.

Findings

A finding is named ThreatPurpose:ResourceType/ThreatFamilyName.DetectionMechanism, e.g. CryptoCurrency:EC2/BitcoinTool.B!DNS or UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS. Each finding includes severity, the affected resource, actor IP and a timeline. Findings are retained for 90 days.

Common categories:

  • Recon - port probing, unusual API enumeration.
  • Backdoor / Trojan / CryptoCurrency - compromised instances.
  • UnauthorizedAccess - brute force, credentials used from Tor or outside AWS.
  • Exfiltration / Impact - unusual data movement or deletion.

Responding to findings

GuardDuty publishes each finding to EventBridge (usually within about five minutes). That enables an automated pipeline:

json
{
  "source": ["aws.guardduty"],
  "detail-type": ["GuardDuty Finding"],
  "detail": { "severity": [{ "numeric": [">=", 7] }] }
}

Possible targets: SNS (notify), Lambda (isolate the instance by swapping its security group, snapshot the volume, disable the IAM key, add a WAF IP block or NACL deny rule) and Step Functions playbooks. Security Hub and Amazon Detective aggregate and investigate.

Multi-account setup

  1. Enable GuardDuty in the management account and designate a delegated administrator.
  2. Enable auto-enable for new organisation accounts.
  3. Findings from members flow to the administrator account; you can export them to an S3 bucket (encrypted with KMS) for retention beyond 90 days.
bash
aws guardduty create-detector --enable --finding-publishing-frequency FIFTEEN_MINUTES
aws guardduty list-findings --detector-id $DETECTOR_ID \
  --finding-criteria '{"Criterion":{"severity":{"Gte":7}}}'

GuardDuty vs. neighbouring services

ServicePurpose
GuardDutyDetect threats from logs and behaviour
InspectorScan for software vulnerabilities (EC2, ECR, Lambda)
MacieDiscover sensitive data (PII) in S3
Security HubAggregate and prioritise findings from many services
DetectiveInvestigate root cause with a graph of relationships
ConfigResource compliance and configuration drift

Real World Example

Scenario — a startup discovers crypto-mining on a compromised instance.

A small engineering team enables GuardDuty in every Region through AWS Organizations, with the security account as delegated administrator. Two weeks later GuardDuty raises a High severity finding: CryptoCurrency:EC2/BitcoinTool.B!DNS for an instance in a development subnet that is querying a mining-pool domain.

An EventBridge rule for severity 7 and above triggers a Lambda function that:

  1. Replaces the instance's security group with a quarantine group that allows no traffic.
  2. Takes an EBS snapshot for forensics.
  3. Tags the instance and posts the details to the on-call channel with SNS.

Investigation with CloudTrail and Detective shows an exposed SSH key was reused from a public repository. The team rotates keys, enforces SSM Session Manager, and adds S3 and malware protection plans. Total effort to enable the detection: minutes, and no agents were installed.

Architecture Diagram

GuardDuty detection and automated response
Architecture
AWS Cloud
CloudTrail events
VPC Flow Logs
DNS logs
GuardDutyML + threat intel
EventBridgeseverity >= 7
Lambdaisolate instance
SNSalert SOC
Security Hub

GuardDuty reads account logs, raises findings, and EventBridge drives remediation.

  1. 1GuardDuty ingests CloudTrail, VPC Flow Logs and DNS logs (plus optional S3, EKS, runtime data) without agents.
  2. 2ML, anomaly detection and threat-intelligence feeds generate findings with severity.
  3. 3Findings are published to EventBridge and Security Hub.
  4. 4A rule triggers Lambda to isolate the resource and SNS to notify the security team.

Best Practices

  • ✓Enable GuardDuty in all Regions and accounts (even unused Regions) through AWS Organizations with a delegated administrator.
  • ✓Turn on the protection plans you need: S3, EKS, runtime monitoring and malware protection.
  • ✓Automate response with EventBridge, Lambda and Step Functions for high-severity findings.
  • ✓Aggregate in Security Hub and investigate with Detective for faster triage.
  • ✓Export findings to S3 with KMS encryption to retain them beyond 90 days.
  • ✓Use trusted IP and threat lists to reduce noise and add custom intelligence.
  • ✓Treat GuardDuty as one layer: combine with Inspector, Macie, WAF, Shield and Config.
  • ✓Suppress known benign findings with suppression rules after review.

Common Interview Questions

Exam Tips

SAA-C03 focus

  • "Intelligent threat detection", "compromised EC2 instance", "crypto mining", "anomalous API calls" -> GuardDuty.
  • GuardDuty inputs: CloudTrail, VPC Flow Logs, DNS logs (plus S3, EKS and others as optional plans). No agent needed.
  • GuardDuty detects only; automated response uses EventBridge + Lambda/SNS.
  • Don't confuse: Inspector = vulnerabilities, Macie = sensitive data in S3, GuardDuty = threats, Config = compliance.
  • Multi-account -> Organizations with delegated administrator. Aggregation -> Security Hub.
  • Findings retained 90 days; export to S3 for longer.
  • Trusted IP list = no findings from these IPs; threat list = known malicious IPs.
  • GuardDuty is regional and offers a 30-day free trial.

Finished this lesson?

0 of 64 lessons done · 0% of the course