How Detective Builds a Behavior Graph
Understand how Detective links events into an investigable graph.
How Detective Builds a Behavior Graph is a free AWS Security Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
From Alert to Understanding
Detection tells you something is wrong; investigation tells you what actually happened. Amazon Detective is the service built for investigation. It automatically analyzes activity and builds a visual model so you can understand the full story behind a finding, not just the alert.
What Detective Does
Detective continuously ingests and links log data to build a graph of behavior over time. Instead of manually correlating logs across services, you get a pre-built, queryable picture of how entities like accounts, instances, and IP addresses have interacted.
The Behavior Graph
The core construct is the behavior graph: nodes are entities (such as IAM roles, EC2 instances, IP addresses, and accounts) and edges are the interactions and activity between them. The graph captures normal baselines and deviations, giving investigators a map rather than raw logs.
Data Sources Behind the Graph
Detective builds its graph from the same kinds of telemetry as detection: CloudTrail management events, VPC Flow Logs, and GuardDuty findings, plus EKS audit logs. It does the heavy correlation automatically, so you do not assemble these sources by hand.
No Logs to Manage
Like GuardDuty, Detective is agentless and fully managed. You enable it and it pulls the data it needs; you do not build log pipelines or storage. It also retains roughly a year of linked activity, giving long lookback for investigations without you managing retention.
Baselining Normal Behavior
Detective uses machine learning and statistics to learn what is normal for each entity, then highlights deviations. Knowing the baseline lets an investigator see that, say, an instance suddenly made far more API calls than usual, which is a strong signal of compromise.
Visual Investigation
The graph is presented as interactive visualizations: timelines, profiles for each entity, and activity charts. An analyst clicks through related entities to follow a trail. This visual approach turns hours of log grepping into guided exploration.
Detect versus Investigate
A key distinction: GuardDuty detects, Detective investigates. GuardDuty raises a finding; Detective helps you determine its scope, root cause, and impact. They are complementary, and the exam expects you to pick Detective when the need is investigation and root-cause analysis.
Organization Support
Detective integrates with AWS Organizations and supports a delegated administrator, so a security account can investigate activity across all member accounts in one behavior graph. This mirrors GuardDuty and Security Hub for consistent multi-account operations.
A Year of Linked History
Detective retains roughly a year of linked activity in the behavior graph, far longer than GuardDuty's default finding retention. This long lookback lets investigators see whether suspicious behavior began weeks ago, revealing slow, stealthy intrusions that a short window would miss. The extended history is a key reason Detective complements rather than duplicates detection.
GuardDuty Is a Prerequisite
A practical detail: Detective requires GuardDuty to have been enabled for a period (around 48 hours) before you can enable Detective. This is because Detective uses GuardDuty findings and the same underlying telemetry to seed its behavior graph. The two services are designed to work hand in hand, with detection feeding investigation.
Quick Check
Distinguish detection from investigation.
Recap
Detective is the agentless, managed investigation service. It links CloudTrail, VPC Flow Logs, GuardDuty findings, and EKS audit logs into a behavior graph of entities and interactions, baselines normal behavior, and presents interactive visualizations with about a year of lookback. GuardDuty detects; Detective investigates root cause and scope.
Frequently asked questions
Is the “How Detective Builds a Behavior Graph” lesson free?
Yes — the full text of “How Detective Builds a Behavior Graph” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “How Detective Builds a Behavior Graph”?
Understand how Detective links events into an investigable graph. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Security Academy?
No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “How Detective Builds a Behavior Graph” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Security Academy lesson?
Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- How Detective Builds a Behavior Graph
- Pivoting from a GuardDuty Finding
- Analyzing Entities and Time Windows
- Spotting Anomalous Activity Patterns