Sub topic 1
Where GuardDuty and Security Hub fit in AWS security
Prerequisites
This chapter assumes you know the following:
- AWS accounts, Regions, and IAM roles and policies.
- How to run commands with the AWS CLI or find a service in the Management Console.
- That AWS CloudTrail records API calls, VPC Flow Logs record network traffic metadata, and Route 53 resolver logs record DNS queries.
- How to read basic JSON.
You do not need to have enabled either service yet. Later chapters cover setup.
The problem these services solve
An AWS environment produces a large volume of activity records. CloudTrail logs every API call, flow logs record network connections, and DNS logs record name lookups. Reading these by hand does not scale, and a single suspicious event is easy to miss among millions of normal ones.
Two services address this at different layers:
- Amazon GuardDuty is a threat detection service. It analyzes AWS log and activity data and produces a finding when it sees behavior that looks malicious or unauthorized.
- AWS Security Hub is a central place to collect findings from many services and to check your configuration against security standards. It is a aggregation and posture service. It does not detect threats by itself.
The short version: GuardDuty answers "is something bad happening?" and Security Hub answers "what is the overall security state, and where are all the findings?"
The security services landscape
GuardDuty and Security Hub sit alongside other AWS security services. Each has a distinct job.
| Service | Main question it answers | Typical output |
|---|---|---|
| Amazon GuardDuty | Is there active malicious or suspicious behavior? | Threat findings |
| AWS Security Hub | What is my overall posture, and what are all my findings? | Aggregated findings and control results |
| Amazon Detective | What happened around this finding, and how far did it reach? | Investigation graphs and timelines |
| Amazon EventBridge | How do I react automatically to an event? | Routed events to targets |
| AWS CloudTrail | Who called which API, and when? | Audit logs |
Notice that GuardDuty and Security Hub use CloudTrail as input or context but do not replace it. CloudTrail is the record. GuardDuty reads the record and judges it.
How the pieces connect
A typical pipeline has four stages: detect, aggregate, route, and respond. Investigation happens alongside them when an analyst needs more context.
This tutorial follows that flow. First you learn how GuardDuty detects and how to read its findings. Then you learn how Security Hub collects them, how EventBridge routes them, and how a Lambda function can act on them.
Common misunderstandings
- GuardDuty does not block traffic. It reports. Blocking requires a separate action, such as a response you build with EventBridge and Lambda.
- You do not configure log collection for GuardDuty. It reads its foundational data sources independently, so you do not need to turn on CloudTrail trails or flow logs for it to work.
- Security Hub is not a replacement for GuardDuty. Without a detection source feeding it, Security Hub has few threat findings to show. Its own checks cover configuration, not live attacks.
- Both services are Regional. Findings are tied to the Region where they were generated, so multi-Region coverage needs deliberate setup.
What you will build
By the end of this tutorial you will be able to enable GuardDuty, read and tune its findings, query them in Security Hub with the AWS CLI, and build an EventBridge rule that triggers a Lambda function for high-severity findings.
Exercise
A teammate says, "We turned on Security Hub, so we are now detecting threats in our EC2 instances." What is wrong with this statement, and which service would you enable to add threat detection?
Show answer
Security Hub aggregates findings and evaluates configuration against security standards. It does not analyze logs for malicious behavior itself. Enabling Amazon GuardDuty adds threat detection, and its findings can then flow into Security Hub.
Exercise
Which service would you use to decide how to react automatically when a finding appears, and which service would you use to look at the timeline around that finding afterward?
Show answer
Use Amazon EventBridge to route the finding to an automated target such as Lambda, and Amazon Detective to investigate the activity around the finding.