AWS GuardDuty

Difficulty: Intermediate

Question

What is Amazon GuardDuty, what data does it analyze, and how do you respond to its findings?

Answer

Amazon GuardDuty is a managed threat detection service that continuously analyzes AWS logs and runtime activity to spot malicious or unauthorized behaviour, such as compromised EC2 instances mining crypto, stolen IAM credentials being used from an unusual location, or reconnaissance against your network. You turn it on per account and Region, it needs no agents for its core data sources, and it produces findings you can route to alerts or automated remediation.

What GuardDuty looks at

GuardDuty has foundational data sources that are always analyzed once it is enabled, and you do not have to turn on these logs yourself because GuardDuty reads independent streams of them:

  • CloudTrail management events: API calls such as CreateUser, StopLogging, GetSecretValue.
  • VPC Flow Logs: network traffic metadata for EC2 instances.
  • Route 53 Resolver DNS query logs: domains your workloads look up, useful for catching calls to known command-and-control or mining pools.

On top of that are optional protection plans:

  • S3 Protection: CloudTrail data events on S3, for suspicious access patterns.
  • EKS Protection: Kubernetes audit logs.
  • Runtime Monitoring: a lightweight agent on EKS, ECS (including Fargate) and EC2 that sees process, file and network activity inside the workload.
  • Malware Protection: scans EBS volumes of suspicious EC2 instances, and separately scans newly uploaded S3 objects.
  • RDS Protection: anomalous login activity on Aurora and RDS.
  • Lambda Protection: network activity from Lambda functions.

How detection works

GuardDuty combines threat intelligence feeds (known bad IPs and domains), machine learning baselines of normal behaviour for your account, and anomaly detection. Since late 2024, Extended Threat Detection correlates multiple signals into "attack sequence" findings, for example credential misuse followed by data exfiltration, rather than just isolated events.

Findings follow a ThreatPurpose:ResourceType/ThreatFamily naming style:

  • UnauthorizedAccess:EC2/SSHBruteForce
  • CryptoCurrency:EC2/BitcoinTool.B!DNS
  • Recon:EC2/PortProbeUnprotectedPort
  • UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS

Each has a severity (Low, Medium, High, and Critical for attack sequences).

Responding to findings

GuardDuty detects; it does not block. A typical response pipeline:

  1. GuardDuty publishes the finding to EventBridge.
  2. An EventBridge rule filters by severity or type.
  3. Targets: SNS or Slack for humans, a Lambda or Step Functions workflow for automated containment, such as replacing the instance's security group with an isolation group, revoking the IAM role session, or snapshotting the volume for forensics.
  4. Findings also flow into Security Hub and Amazon Detective for investigation.

In a multi-account setup you designate a delegated administrator account in AWS Organizations so GuardDuty is auto-enabled for every new account and all findings land in one place.

Gotchas worth knowing

  • It is Regional. Enable it in every Region, including ones you do not use, because attackers love launching instances in unused Regions.
  • Use suppression rules and trusted IP lists to cut noise from known scanners or pentests, rather than ignoring the service.
  • Cost scales with the volume of events and logs analyzed; there is a 30-day free trial that shows the estimated cost.
  • GuardDuty is not a firewall or a vulnerability scanner. Pair it with WAF/Network Firewall for blocking and Inspector for CVEs.
GuardDuty detection and response. Logs and runtime signals feed GuardDuty, and EventBridge turns findings into action.
  1. CloudTrail, Flow Logs, DNS: Foundational sources, read without extra setup.
  2. Protection plans: S3, EKS, runtime, malware, RDS, Lambda signals.
  3. GuardDuty analysis: Threat intel, ML baselines and anomaly detection.
  4. Finding with severity: Typed finding such as SSHBruteForce.
  5. EventBridge response: Alert, isolate the instance or revoke credentials.

Code examples

Enable GuardDuty and route high-severity findings

# Turn on GuardDuty in the current Region
aws guardduty create-detector --enable \
  --finding-publishing-frequency FIFTEEN_MINUTES

# EventBridge rule: only findings with severity >= 7 (High)
aws events put-rule --name guardduty-high \
  --event-pattern '{
    "source": ["aws.guardduty"],
    "detail-type": ["GuardDuty Finding"],
    "detail": { "severity": [{ "numeric": [">=", 7] }] }
  }'

# Send matches to an SNS topic that pages the on-call engineer
aws events put-targets --rule guardduty-high \
  --targets Id=sns,Arn=arn:aws:sns:ap-south-1:111122223333:sec-alerts

GuardDuty severity is numeric (High is 7.0 to 8.9), so a numeric EventBridge filter keeps low-noise alerts going to humans while everything else can be reviewed in Security Hub.

Key points

  • Foundational sources: CloudTrail management events, VPC Flow Logs and DNS logs, no setup needed.
  • Optional protection plans add S3, EKS, runtime, malware, RDS and Lambda coverage.
  • GuardDuty detects only; respond via EventBridge, Lambda or Step Functions.
  • Regional service: enable everywhere and use a delegated admin in Organizations.
  • Finding names follow ThreatPurpose:ResourceType/ThreatFamily.

Common follow-up questions

  • How would you automatically isolate an EC2 instance flagged for crypto mining?
  • What is the difference between GuardDuty, Inspector and Macie?
  • How do you enable GuardDuty across 50 accounts in an organization?
  • How do suppression rules work and when should you use them?

Interview tips

  • Say clearly that GuardDuty is detective, not preventive, then describe the EventBridge response path.
  • Name the three foundational data sources; it shows you know what it actually reads.
  • Mention enabling it in unused Regions and centralizing with a delegated administrator; that sounds like real operations experience.

Concepts covered

Threat Detection, VPC Flow Logs, CloudTrail, DNS Logs, Findings, Runtime Monitoring

More AWS & Cloud Fundamentals questions