Sub topic 1
Where GuardDuty and Security Hub fit in AWS security
Prerequisites
This chapter assumes you already know the following:
- Basic AWS concepts: accounts, Regions, and IAM roles and policies.
- How to run commands with the AWS CLI or find a service in the AWS Management Console.
- What AWS CloudTrail, VPC Flow Logs, and Route 53 DNS query logs record, at a high level.
- How to read JSON.
You do not need to have enabled any security service yet. This chapter builds the mental map that later chapters fill in. It has no hands-on steps, so it contains no code. The commands come in the setup chapters.
Why a security services landscape exists
AWS gives you a lot of activity data: API calls, network flows, DNS queries, and configuration changes. No single person can read all of it. Security services turn that raw data into a smaller set of statements a human or a script can act on.
Those services do different jobs. Mixing them up is the most common mistake when people first design a detection pipeline. Four questions help separate them:
- Is something bad happening right now? That is threat detection.
- Is my configuration weaker than it should be? That is security posture management.
- Where do I see everything in one place? That is findings aggregation.
- What happened, and how far did it spread? That is investigation.
A finding is a record that a security service produces when it sees something worth your attention. It names the affected resource, describes the issue, and carries a severity. Almost everything in this tutorial is about producing, reading, routing, and acting on findings.
The core services and their jobs
Amazon GuardDuty: threat detection
Amazon GuardDuty is a managed threat detection service. It reads AWS data sources such as CloudTrail events, VPC Flow Logs, and Route 53 DNS query logs. It compares that activity against threat intelligence, anomaly detection, and machine learning models, and it produces findings.
Two properties matter for design:
- You do not have to turn on or store those logs yourself for GuardDuty to use them. GuardDuty reads the foundational data sources independently and does not depend on your own logging configuration.
- GuardDuty detects. It does not block traffic or change resources. Anything that happens after a finding is up to you.
A typical GuardDuty finding says that an EC2 instance is communicating with a known malicious IP address, or that credentials created for an instance are being used from an unexpected location.
AWS Security Hub: posture and aggregation
AWS Security Hub is a service that collects findings from many sources and evaluates your resources against security standards. It does two related jobs:
- Aggregation. It receives findings from AWS services such as GuardDuty and from supported partner products, and shows them in one place.
- Posture management. It runs automated checks, called controls, against your resources. A control might check that an S3 bucket blocks public access or that a security group does not allow unrestricted SSH. The result is a finding that says the check passed or failed.
The difference to remember: GuardDuty findings describe suspicious activity. Security Hub control findings describe configuration state. Security Hub brings both kinds into one list.
Amazon Detective: investigation
Amazon Detective builds a linked view of your AWS activity over time. When a finding raises a question such as "what else did this role do in the last week?", Detective helps you answer it. It is a later step, used after a finding already exists. A later chapter covers it.
Amazon EventBridge: routing
Amazon EventBridge is an event bus. GuardDuty and Security Hub publish their findings as events. EventBridge rules match those events and send them to targets such as a Lambda function, an SNS topic, or a ticketing integration. EventBridge turns a finding from something you read into something that triggers work.
How the pieces connect
The services form a pipeline. Data sources feed GuardDuty. GuardDuty findings flow to Security Hub and to EventBridge. Security Hub adds its own control findings. People and automation consume the results, and Detective supports deeper investigation.
Read the diagram from top to bottom. The dotted line to Detective is different from the solid lines because it is a human decision, not an automatic flow.
Detection versus posture
A short comparison makes the split concrete.
| Aspect | GuardDuty | Security Hub controls |
|---|---|---|
| Question answered | Is something suspicious happening? | Is something configured weakly? |
| Input | Activity logs and runtime signals | Resource configuration state |
| Typical finding | Instance contacting a malicious IP | S3 bucket allows public access |
| Time frame | Events as they occur | Periodic and change-triggered checks |
| Fix | Investigate, contain, remediate | Change the configuration |
Both matter. A well-configured account can still be attacked with stolen credentials, and GuardDuty may be the only service that notices. A weakly configured account may have no attacker at all, and only a posture check will tell you about the risk. Running only one gives you half the picture.
Scope: accounts and Regions
Both services are Regional. A GuardDuty detector, which is the resource that represents GuardDuty in a Region, exists in one account and one Region. Findings about activity in eu-west-1 appear in eu-west-1 unless you set up aggregation.
This has practical consequences:
- Enabling GuardDuty in only your main Region leaves other Regions unmonitored. An attacker who gets credentials may deliberately work in a Region you ignore.
- Each account has its own detectors and findings by default. In an organization with many accounts, you want one place to see all of them.
AWS Organizations lets you name a delegated administrator account that manages GuardDuty and Security Hub for all member accounts. Security Hub can also designate an aggregation Region so findings from several Regions appear in one. The multi-account chapter covers the exact setup. For now, keep in mind that a detection design is a decision about accounts and Regions, not only about services.
Where each service sits in an incident
Consider a realistic sequence to see how the services divide the work.
- An access key for an IAM user leaks. Someone uses it from an unfamiliar network.
- GuardDuty sees unusual API activity in CloudTrail and raises a finding about the credential use.
- The finding is delivered to Security Hub, which shows it next to control findings for the same account, and to EventBridge.
- An EventBridge rule matches the high-severity finding and invokes a Lambda function or notifies the on-call engineer.
- The engineer opens Detective to see what else the key did and which resources it touched.
- The team rotates the key, fixes the process that leaked it, and uses a Security Hub control to confirm that similar keys are not old or unused.
Each service has one clear job in the sequence. No step requires one service to do another service's work.
Common misunderstandings
- "GuardDuty is a firewall." It is not. It never blocks traffic. Blocking requires a separate action, such as updating a security group or network ACL, often triggered by a finding.
- "Security Hub detects threats." Security Hub aggregates and checks configuration. Threat findings in it mostly come from GuardDuty and other integrated products.
- "Enabling one account is enough." Findings and detectors are per account and per Region unless you configure central management.
- "A finding means a confirmed breach." A finding is a signal. Some are benign, such as a security scan you ran yourself. Later chapters show how to tune the noise and how to judge severity.
- "More services means better coverage." Each service has a cost and an operational burden. Choose services for the questions you need to answer.
What the rest of the tutorial covers
The remaining chapters follow the pipeline in the diagram. First you learn how GuardDuty detects threats, what its optional protection plans add, how to read findings, and how to enable it and reduce noise. Then you move to Security Hub: standards, finding formats, and how GuardDuty findings appear there. After that come multi-account management, routing with EventBridge, automated response with Lambda, investigation with Detective, and cost control.
Exercise
A teammate says, "We enabled Security Hub, so we no longer need GuardDuty." Explain what is wrong with this claim, and name which kind of finding each service mainly produces.
Show answer
Security Hub does not analyze activity logs to detect threats. It aggregates findings from other services and runs controls that check resource configuration against security standards, so its own findings mainly describe weak configuration. GuardDuty analyzes CloudTrail events, VPC Flow Logs, and DNS logs and produces findings about suspicious activity, such as a compromised instance or misused credentials. Security Hub can display GuardDuty findings, but it does not create them. Without GuardDuty, the account loses its main source of threat detection findings.
Exercise
Your company runs workloads in three Regions across twelve accounts. You enable GuardDuty in one account in us-east-1 only. List two gaps this leaves and one AWS capability that helps close them.
Show answer
Gap 1: The other two Regions are not monitored, so activity there produces no findings. Gap 2: The other eleven accounts have no detectors, so their activity is not monitored either. AWS Organizations with a delegated administrator can manage GuardDuty and Security Hub for all member accounts. Security Hub's cross-Region aggregation can bring findings from several Regions into one view.
Exercise
Classify each as detective or preventive: an S3 Block Public Access setting, a GuardDuty finding about a DNS query to a malicious domain, and a security group rule that denies inbound SSH from the internet.
Show answer
S3 Block Public Access is preventive. The GuardDuty finding is detective. The security group rule is preventive.