Detecting Threats with Amazon GuardDuty
This lesson explains how Amazon GuardDuty, the managed threat detection service AWS recommends enabling in every account and Region, finds malicious or unauthorised activity from its foundational data sources without agents or log pipelines.
Learning outcomes
After completing this lesson, you will be able to:
- Describe what GuardDuty is, how a detector enables it in each Region and how it is priced.
- Identify the foundational data sources GuardDuty analyses.
- Distinguish threat intelligence, anomaly detection and machine learning detection.
- Interpret a finding's type, severity and details.
- Identify what GuardDuty does not do and which services fill those gaps.
What GuardDuty is
Amazon GuardDuty is a managed threat detection service. It continuously analyses activity in an AWS account, looking for signs that an attacker is present or that a resource is being misused, and reports each problem it finds as a finding: a record that describes the suspicious activity, the resource involved, the actor and a severity. There are no agents to install for its foundational coverage, no rules to write and no logs to collect, which is why AWS recommends enabling it everywhere as a baseline control.
GuardDuty is enabled per account and per Region by creating a detector, the resource that holds its configuration. Because it is a Regional service, a detector in one Region sees nothing in another, so it must be enabled in every Region, including those an organisation does not use, where an attacker's activity would otherwise go unnoticed. Pricing is based on the volume of data analysed, such as the number of CloudTrail events and the gigabytes of flow and DNS logs, and a 30-day free trial shows the expected cost before charges begin. GuardDuty detects; it does not prevent, as the last section of this lesson explains.
GuardDuty basics
Foundational data sources
As soon as a detector is enabled, GuardDuty analyses a set of foundational data sources without any additional configuration. CloudTrail management events show the API calls made in the account, such as an IAM user creating access keys. VPC Flow Logs show the network connections made by instances and other resources. Route 53 Resolver DNS query logs show the domain names that resources look up, which reveals contact with malicious domains.
GuardDuty reads these directly from AWS's internal streams. You do not need to enable or store the logs yourself, and GuardDuty does not keep a copy for you.
Detection methods
Amazon GuardDuty uses three methods to detect threats. Threat intelligence compares the IP addresses and domains in your logs with lists of known malicious ones from AWS and its partners, so an instance contacting a known command-and-control server is flagged immediately. Anomaly detection and machine learning learn what is normal for your account and flag departures, such as an IAM user suddenly calling APIs from a new country or at unusual volume. No list is needed for this, so it catches new attacks.
Extended Threat Detection looks across signals over time and correlates several related events into one attack sequence finding of critical severity, mapped to MITRE ATT&CK tactics. For example, a credential compromise, followed by privilege escalation and then data exfiltration from S3, appears as a single finding instead of several unrelated low-severity ones. The following table summarises the methods.
| Method | What it catches |
|---|---|
| Threat intelligence | Known malicious IPs and domains from AWS and partners |
| Anomaly detection and machine learning | Departures from your account's normal behaviour, e.g. an IAM user suddenly calling APIs from a new country |
| Extended Threat Detection | Attack sequences: several signals over time correlated into one critical finding mapped to MITRE ATT&CK, e.g. credential compromise, privilege escalation, then S3 exfiltration |
Which detection method?
Reading findings
Every finding has a type name in the format ThreatPurpose:ResourceType/ThreatName, and each part of the name answers a question. The threat purpose says what the activity is trying to achieve, such as Recon for reconnaissance, UnauthorizedAccess, CryptoCurrency for mining or Backdoor for a compromised resource controlled by an attacker. The resource type says what is affected, such as EC2, IAMUser or S3. The threat name describes the specific behaviour. Reading the name therefore tells an analyst, before opening the details, what kind of problem it is and where to look.
Each finding also has a severity, a number from 1 to 10 grouped into bands: low (1.0 to 3.9), medium (4.0 to 6.9), high (7.0 to 8.9) and critical (9.0 to 10.0). High-severity findings usually mean that a resource is already compromised and needs immediate action, while low-severity findings often record attempts that were blocked. The finding details add the actor, such as the remote IP address and its country, the resource, such as the instance ID or the access key, and the action, such as the API called or the port probed, together with a count of how many times it was seen. The following table explains some findings that exam scenarios use often.
| Finding | Meaning |
|---|---|
UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS | Instance role credentials used outside AWS |
CryptoCurrency:EC2/BitcoinTool.B | Cryptocurrency mining |
Recon:EC2/PortProbeUnprotectedPort | Port scanning |
Backdoor:EC2/C&CActivity | Command-and-control traffic |
Policy:IAMUser/RootCredentialUsage | Root user activity |
The following diagram reads an InstanceCredentialExfiltration.OutsideAWS finding: what it shows happened to an instance's role credentials, the likely cause and the response.

Reading finding types
What GuardDuty does not do
GuardDuty detects threats but has defined limits to its scope, and exam answers often depend on knowing them. Most importantly, it does not block or fix anything: a finding is a report, so stopping an attack needs a response, which is automated with EventBridge rules, as the lesson on multi-account management and response explains. GuardDuty also looks for active threats rather than weaknesses, so it does not scan software for known vulnerabilities, which is the job of Amazon Inspector, and it does not search data for sensitive content such as personal information, which is the job of Amazon Macie. The following list summarises these limits and the services that fill them.
- It does not block or fix anything, so automate responses.
- It does not scan for software vulnerabilities (Amazon Inspector).
- It does not find sensitive data (Macie).
GuardDuty, Inspector or Macie?
Reading an exfiltration finding
A finding arrives with type UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS and severity 8. The JSON contains everything needed to decide what happened. The parts an analyst reads first are these:
{
"type": "UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS",
"severity": 8,
"resource": {
"resourceType": "AccessKey",
"accessKeyDetails": {
"accessKeyId": "ASIAEXAMPLE7QXYZ",
"principalId": "AROAEXAMPLEID:i-0a1b2c3d4e5f67890",
"userType": "AssumedRole",
"userName": "web-app-role"
}
},
"service": {
"action": {
"actionType": "AWS_API_CALL",
"awsApiCallAction": {
"api": "ListBuckets",
"remoteIpDetails": { "ipAddressV4": "198.51.100.23", "country": { "countryName": "Unknown" } }
}
},
"count": 14
}
}The principal ID ends with an instance ID, so the credentials belong to the role of instance i-0a1b2c3d4e5f67890. They were used from an IP address outside AWS, 14 times. The most likely story is that an attacker obtained the instance's temporary credentials, often through a server-side request forgery flaw against IMDSv1, and is now using them from their own machine. The response therefore has two parts: revoke the role's active sessions so the stolen credentials stop working, and investigate the instance to close the hole, starting with enforcing IMDSv2.
Must VPC Flow Logs or DNS logging be enabled for GuardDuty to analyse them?
Show answer
No. GuardDuty reads these sources directly from AWS without your own flow logs or DNS logs being enabled.
Exam Tips
Remember for the exam
- Instance role credentials used from outside AWS produce an InstanceCredentialExfiltration finding.
- Cryptocurrency mining on EC2 produces a CryptoCurrency finding; isolate the instance.
- GuardDuty does not need you to enable flow logs or DNS logs in order to analyse them.
- A multi-stage attack correlated into one finding is an Extended Threat Detection attack sequence.
- GuardDuty detects but does not block, so automate the response with EventBridge.