Investigating Security Findings with Amazon Detective
This lesson explains how Amazon Detective helps investigate security findings by building a graph of activity across accounts, so analysts can see what happened and how far it spread.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how Detective collects and links data.
- Explain how Detective helps investigate a GuardDuty finding.
- Distinguish GuardDuty, Inspector and Detective.
How Detective works
Amazon Detective collects security data automatically, with no agents: AWS CloudTrail logs, VPC Flow Logs, Amazon EKS audit logs and Amazon GuardDuty findings. It organises this data into behaviour graphs that link principals, IP addresses, instances and roles, covering up to a year of history, so an analyst can see how each entity normally behaves and what changed.
Detective also groups related findings into finding groups, which show the full scope of an incident, for example a compromised credential used from an unusual IP address to launch instances that then contacted a malicious host.
Using Detective in an investigation
Detective is typically used to investigate a finding reported by GuardDuty. Suppose GuardDuty reports an instance communicating with a known malicious IP address. From the finding, the analyst opens Detective, which shows which role the instance used, which API calls it made, which other resources contacted the same IP address and when the unusual activity began.
With that context, the team can scope the incident, deciding which instances, credentials and data may be affected, and remediate all of them rather than only the one resource GuardDuty reported. The distinction for the exam is that GuardDuty detects threats, while Detective investigates them.
The three detection services
GuardDuty, Inspector and Detective are often confused because all three concern security findings, but each answers a different question. GuardDuty asks whether something malicious is happening now, such as an instance communicating with a known attacker. Inspector asks what is vulnerable, such as an image with an outdated library, before anyone exploits it.
Detective asks what happened and how far it spread, after a finding has appeared. It builds a graph of activity from CloudTrail, VPC Flow Logs, GuardDuty findings and EKS audit logs, so an analyst can see, for example, every API call a compromised role made and every IP address it was used from, without writing queries. The following table summarises the three services.
| Service | Question it answers |
|---|---|
| GuardDuty | Is something malicious happening? |
| Inspector | What is vulnerable? |
| Detective | What happened, and how far did it spread? |
The following diagram places the three services around an incident.

GuardDuty, Inspector or Detective?
Scoping an incident
GuardDuty reports that an IAM role's credentials were used from an unusual IP address. The team must find out what the attacker did and whether other resources were involved.
| Question | What Detective shows |
|---|---|
| When did the unusual activity start? | A timeline of the role's API calls compared with its normal behaviour |
| What did the attacker do? | The API calls made from the new IP address |
| Did anything else contact that IP? | Other principals and instances linked to the IP |
| Are other findings related? | A finding group combining related GuardDuty findings |
The team revokes the role's sessions, rotates the affected credentials and confirms from the graph that no other resources were touched.
When is Amazon Detective used?
Show answer
After a finding, to investigate it: Detective builds a behaviour graph from logs so an analyst can see the scope and root cause of suspicious activity.
Exam Tips
Remember for the exam
- To investigate the root cause of a GuardDuty finding, use Detective.
- To see all activity linked to a suspicious IP address or role across accounts, use Detective behaviour graphs.
- Detective requires GuardDuty to be enabled.