Sub topic 7
What Security Hub does
This chapter assumes you know basic AWS concepts (accounts, Regions, IAM), can read JSON, and have used the AWS CLI. You should also know that GuardDuty produces findings from sources such as CloudTrail, VPC Flow Logs, and DNS logs.
The problem Security Hub solves
Several AWS services each produce their own security output. GuardDuty reports threats. Amazon Inspector reports vulnerabilities. Amazon Macie reports sensitive data exposure. IAM Access Analyzer reports unintended access. Reviewing each console separately is slow and makes it hard to see what matters most.
AWS Security Hub is a service that collects findings from these sources in one place. It also runs its own automated checks against security standards. It gives you two things:
- A central, normalized list of findings from AWS services and partner products.
- A measure of your security posture, which is how well your resources follow security best practices.
Security Hub does not detect threats itself. GuardDuty does that. Security Hub aggregates and organizes what other services find, and its own checks evaluate resource configuration.
The working model
Security Hub has three main parts.
- Finding ingestion. Integrated services send findings to Security Hub. Findings arrive in a common format, so a GuardDuty finding and an Inspector finding can be filtered with the same fields.
- Controls and standards. Security Hub runs checks called controls against your resources. Each control passes or fails. Controls are grouped into standards, which the next chapters cover. A failed control becomes a finding.
- Aggregation. In a multi-account setup, findings from member accounts, and optionally from several Regions, flow to one administrator account.
Enabling Security Hub
Enable it in each Region where you want coverage. This command also turns on the default standards.
aws securityhub enable-security-hub --enable-default-standardsSecurity Hub depends on AWS Config to evaluate most controls. If AWS Config recording is not on, many controls cannot produce results. Check this first when controls show no data.
Reading findings
Each finding has a workflow status and a record state. These are separate fields.
| Field | Values | Meaning |
|---|---|---|
| `RecordState` | `ACTIVE`, `ARCHIVED` | Whether the finding is current. The source service controls it. |
| `Workflow.Status` | `NEW`, `NOTIFIED`, `SUPPRESSED`, `RESOLVED` | Where the finding is in your review process. You control it. |
| `Severity.Label` | `INFORMATIONAL`, `LOW`, `MEDIUM`, `HIGH`, `CRITICAL` | How serious the finding is. |
Retrieve active GuardDuty findings like this:
aws securityhub get-findings \
--filters '{"ProductName":[{"Value":"GuardDuty","Comparison":"EQUALS"}],"RecordState":[{"Value":"ACTIVE","Comparison":"EQUALS"}]}' \
--max-items 5Common errors
- Enabled in one Region only. Security Hub is Regional. Findings from an unenabled Region do not appear, so a threat there goes unseen.
- AWS Config not recording. Controls report no results or stay in a no-data state.
- Confusing the two status fields. Setting a finding to
RESOLVEDin Security Hub does not fix the underlying issue. Source services can also reopen findings when conditions persist. - Expecting Security Hub to replace GuardDuty. Without GuardDuty enabled, there are no threat detection findings to aggregate.
Exercise
A teammate enabled Security Hub and sees no GuardDuty findings, although GuardDuty is active in the same account. Name two checks you would make.
Show answer
First, confirm that GuardDuty and Security Hub are enabled in the same Region, because both are Regional. Second, check that there are findings to send, for example by generating sample findings, and that you are filtering with RecordState ACTIVE and ProductName GuardDuty rather than hiding results with a mismatched filter.
Exercise
Why does a Security Hub control sometimes show no results even though Security Hub is enabled?
Show answer
Most controls rely on AWS Config resource recording. If AWS Config is not recording in that Region, the control has nothing to evaluate.