Detection · Topic 3 of 7

GuardDuty and Detective

Learn how GuardDuty finds threats from CloudTrail, flow and DNS data, its protection plans, organization setup and how Detective supports investigations.

  • 5 min
In a nutshell
  • GuardDuty uses CloudTrail management events, VPC flow logs and DNS logs by default, and you do not have to enable those logs yourself.
  • Protection plans for S3, EKS, runtime, malware, RDS and Lambda are optional and enabled separately.
  • GuardDuty is Regional, so enable it in all Regions and use a delegated administrator with auto enable for members.

What it is

Amazon GuardDuty is a managed threat detection service. It analyses several AWS data sources with threat intelligence, anomaly detection and machine learning, and produces findings that describe suspicious activity such as a compromised instance or misused credentials.

Amazon Detective is a different tool for a different moment. GuardDuty answers "is something wrong?", and Detective helps you answer "what happened, who did it and how far did it spread?".

CloudTrail, flow logs, DNSindependent data streamsanalysedGuardDutyfindingsinvestigateDetectivebehavior graph

How it works

Data sources

GuardDuty reads its own copy of the foundational sources, so you do not need to enable flow logs or a trail for it to work. The foundational sources are CloudTrail management events, VPC (Virtual Private Cloud) flow logs and DNS query logs from the VPC resolver.

Optional protection plans add more coverage and are turned on separately.

Protection planAdds coverage for
S3 ProtectionS3 data events, such as unusual object reads or deletes
EKS ProtectionKubernetes audit logs for Amazon EKS clusters
Runtime MonitoringBehaviour inside EC2, ECS and EKS workloads, using a security agent
Malware Protection for EC2Scanning of EBS volumes when a finding suggests malware
Malware Protection for S3Scanning of newly uploaded objects
RDS ProtectionSuspicious sign in activity on supported databases
Lambda ProtectionNetwork activity from Lambda functions

Reading a finding

A finding has a type, a severity and the affected resource. The type name follows a pattern of threat purpose, resource and detail, for example UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS. That one means credentials from an EC2 instance role were used from an address outside AWS.

Severity is a numeric score that maps to levels such as Low, Medium and High. Use the numeric severity in EventBridge patterns to page only for high findings.

Tuning

  • Suppression rules automatically archive findings that match criteria you define. The findings are still recorded, but they are not shown as current.
  • Trusted IP lists name addresses that are safe, so GuardDuty does not alert on them for some finding types.
  • Threat lists name addresses that are known to be bad, so activity involving them raises findings.
  • Lists are uploaded as files in S3 and are Regional, so repeat them in each Region where you use them.

Organization setup

Enable GuardDuty in every Region, because findings are Regional and an attacker will use the Region you forgot. Use AWS Organizations to designate a delegated administrator account, which then enables GuardDuty for member accounts automatically, including new ones.

# AWS CLI, run in the Organizations management account
aws guardduty enable-organization-admin-account \
  --admin-account-id 222233334444

# AWS CLI, run in the delegated administrator account
aws guardduty update-organization-configuration \
  --detector-id 12abc34d567e8fa901bc2d34e56789f0 \
  --auto-enable-organization-members ALL

The administrator account sees member findings and can export them. Exporting findings to S3 requires an S3 bucket and a KMS key whose policies allow GuardDuty, and the export is the way to keep findings beyond the retention period in the service.

Member accountsGuardDuty onfindingsAdministratordelegated accountruleEventBridgealert or respond

What GuardDuty does not do

GuardDuty does not block traffic, change configuration or fix anything. It reports, and you connect the report to a response, as the incident response chapter explains.

Amazon Detective

Detective collects CloudTrail logs, VPC flow logs, GuardDuty findings and other sources into a behavior graph. It then shows timelines, geolocation of sign ins, and resource relationships for a finding or an entity such as a role, user or IP address.

Use Detective to answer scoping questions: which other resources did this role touch, did the same address appear in other accounts, and when did the behaviour start. Pivot into Detective straight from a GuardDuty finding in the console.

QuestionService
Is there suspicious activity right now?GuardDuty
Which accounts and resources were involved, and when did it start?Detective
Is a resource misconfigured or vulnerable?Security Hub, Inspector or Config

What to remember for the exam

  • GuardDuty uses CloudTrail management events, VPC flow logs and DNS logs by default, and you do not have to enable those logs yourself.
  • Protection plans for S3, EKS, runtime, malware, RDS and Lambda are optional and enabled separately.
  • GuardDuty is Regional, so enable it in all Regions and use a delegated administrator with auto enable for members.
  • Suppression rules archive noise. Trusted IP lists suppress some alerts, and threat lists add known bad addresses.
  • Finding names tell the story: Recon, UnauthorizedAccess, CryptoCurrency, Backdoor and similar prefixes show the threat purpose.
  • GuardDuty detects only. Automation through EventBridge, Lambda or Systems Manager does the containment.
  • Detective is for investigation and scoping, and it builds its graph from logs and findings.
  • Export findings to S3 with a KMS key for long term storage and external analysis.
Exam tip

If a question mentions "investigate the root cause across accounts and visualise relationships", choose Detective. If it mentions "detect compromised instance communicating with a command and control server", choose GuardDuty.

Common mistakes

Thinking GuardDuty needs flow logs turned on. It reads its own streams, and turning off your flow logs does not affect it.

Enabling it in one Region only. Attackers often launch resources in unused Regions, so unmonitored Regions become blind spots.

Treating a suppression rule as a deletion. Suppressed findings are archived and still exist, so you can review them later.

Expecting GuardDuty to stop the attack. Without an automated response, the finding just sits there.

Watch out

A suppression rule that is too broad can hide a real attack for months, so scope each rule to a specific finding type and resource.

Check yourself

  • Which logs does GuardDuty analyse by default?

    CloudTrail management events, VPC flow logs and DNS query logs, read from its own independent streams.

  • How do you enable GuardDuty for all current and future accounts in an organization?

    Designate a delegated administrator and turn on auto enable for organization members, in every Region.

  • When would you use Detective instead of GuardDuty?

    After a finding, to investigate scope and timeline using the behavior graph of related activity.

Topic 3 of 7 in Detection

Test yourself on Detection

The full AWS SCS-C03 question bank has 858 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.