Sub topic 8
Security standards and controls
This chapter explains how Security Hub evaluates your resources against security standards. It assumes you know the earlier chapters' basics: AWS accounts and Regions, IAM, and the AWS CLI. You should also be able to read JSON. Security Hub as a findings aggregator was covered in the previous chapter. Here the focus is its posture-checking side, the part that tells you whether your configuration is safe, not whether someone is attacking you.
Standards, controls, and checks
GuardDuty reports behavior, such as a probe or an unusual API call. Security Hub standards report configuration, such as an S3 bucket without encryption or a root account without MFA. Three terms organize this:
- A standard is a published set of security requirements. Security Hub implements several, including AWS Foundational Security Best Practices (FSBP), the CIS AWS Foundations Benchmark, NIST SP 800-53, and PCI DSS.
- A control is one requirement inside a standard. Controls have readable IDs such as
S3.1,IAM.4, orGuardDuty.1. The prefix is the service and the number is the check. - A check is a single evaluation of one resource against one control. A control with 40 buckets in scope produces 40 checks.
Security Hub also keeps a security control layer. A security control such as S3.1 is defined once, and every enabled standard that includes it points to the same definition. Enable FSBP and CIS together, and S3.1 is still evaluated once per resource.
The set of standards and the versions available change over time, so list them instead of memorizing ARNs.
aws securityhub describe-standards \
--query 'Standards[].{Name:Name,Arn:StandardsArn,EnabledByDefault:EnabledByDefault}' \
--output tableHow evaluation works
Most controls rely on AWS Config. Security Hub creates service-linked Config rules in your account and reads their results. If AWS Config is not recording the relevant resource types in a Region, the controls that depend on it cannot evaluate. Their status becomes No data, which is easy to mistake for "nothing is wrong".
Each control runs in one of two modes:
| Trigger | When it runs | Example effect |
|---|---|---|
| Change-triggered | When Config records a change to the resource | A new public bucket fails within minutes |
| Periodic | On a fixed schedule, roughly every 12 or 24 hours | Access key age is rechecked on the schedule |
This distinction matters during remediation. After you fix a resource governed by a periodic control, the finding can stay FAILED until the next scheduled run.
flowchart TDDo not use the line above. The chapter's diagram follows.
Control status and finding fields
Each control has a status shown on the console, and each finding has fields you can filter on. They overlap but are not identical.
| Field | Values | Meaning |
|---|---|---|
| `Compliance.Status` | `PASSED`, `FAILED`, `WARNING`, `NOT_AVAILABLE` | Result of the check on that resource |
| `Severity.Label` | `INFORMATIONAL`, `LOW`, `MEDIUM`, `HIGH`, `CRITICAL` | Fixed per control, not per resource |
| `Workflow.Status` | `NEW`, `NOTIFIED`, `SUPPRESSED`, `RESOLVED` | Your triage state, set by you or automation |
| `RecordState` | `ACTIVE`, `ARCHIVED` | Whether Security Hub still considers the finding current |
Two details cause common confusion. First, severity belongs to the control. S3.1 has the same severity for a test bucket and a production bucket, so you need tags or account context to prioritize. Second, Workflow.Status is separate from Compliance.Status. Setting a finding to SUPPRESSED hides it from workflows, but the resource is still non-compliant and still lowers your score unless you disable the control or fix the resource.
A control's overall status on the console is derived from its checks. It shows Passed only if every check passes, Failed if any fails, Unknown if some checks cannot be determined, and No data if there are no resources in scope or no Config data.
Enabling and inspecting standards
Enabling Security Hub with default standards turns on FSBP and may turn on others, depending on the current defaults. Confirm what is on.
aws securityhub enable-security-hub --enable-default-standards
aws securityhub get-enabled-standards \
--query 'StandardsSubscriptions[].{Arn:StandardsArn,Status:StandardsStatus}' \
--output tableStandardsStatus moves from PENDING to READY. A standard in INCOMPLETE usually means Config is not enabled or lacks the permissions it needs. To add a standard, take its ARN from describe-standards:
STANDARD_ARN=$(aws securityhub describe-standards \
--query "Standards[?contains(StandardsArn, 'aws-foundational-security-best-practices')].StandardsArn | [0]" \
--output text)
aws securityhub batch-enable-standards \
--standards-subscription-requests StandardsArn="$STANDARD_ARN"Enabling a standard is Regional. Repeat it in each Region you use, or manage it centrally with the delegated administrator setup covered in a later chapter. Central configuration policies can then apply the same standards and controls to many accounts at once.
Querying failed controls
Control findings come from the product named Security Hub, unlike GuardDuty findings, which come from GuardDuty. This query returns active, failed, critical or high findings from controls:
aws securityhub get-findings \
--filters '{
"ProductName":[{"Value":"Security Hub","Comparison":"EQUALS"}],
"ComplianceStatus":[{"Value":"FAILED","Comparison":"EQUALS"}],
"RecordState":[{"Value":"ACTIVE","Comparison":"EQUALS"}],
"SeverityLabel":[
{"Value":"CRITICAL","Comparison":"EQUALS"},
{"Value":"HIGH","Comparison":"EQUALS"}
]
}' \
--max-items 10 \
--query 'Findings[].{Control:Compliance.SecurityControlId,Title:Title,Severity:Severity.Label,Resource:Resources[0].Id}' \
--output tableMultiple values for the same filter field are combined with OR. Different fields are combined with AND. That is why the query above returns critical or high findings that are also failed and active.
Tuning controls
Not every control fits every account. A sandbox account may legitimately have resources that a production control flags. You have three levers, in decreasing order of bluntness:
- Disable a control for a standard. It stops generating findings, and it is removed from the score calculation.
- Change a control parameter where the control supports it, such as the maximum age for access keys. This keeps the control active with a threshold that matches your policy.
- Suppress findings with workflow status or automation rules. The control still evaluates, but the finding is hidden from triage.
Look up a control's current state across standards, then disable it where you have a documented reason:
aws securityhub list-standards-control-associations \
--security-control-id S3.1
aws securityhub batch-update-standards-control-associations \
--standards-control-association-updates \
"SecurityControlId=S3.1,StandardsArn=$STANDARD_ARN,AssociationStatus=DISABLED,UpdatedReason=Sandbox accounts use account-level public access settings reviewed by security team"The reason string is stored with the association, so write one an auditor could read.
The security score
Security Hub calculates a security score as a percentage: passed checks divided by total checks that have a status of passed or failed. It is available per standard and as an overall figure. The score depends on how many resources exist. One failing check among five resources reduces it far more than the same failure among five thousand. Use it as a trend line, not as a pass/fail grade, and compare it only across similar scopes.
Common errors
- Standards show
INCOMPLETEor controls showNo data. AWS Config is not enabled, or does not record the needed resource types in that Region. Enable it and wait for the first evaluation. - A fixed resource still shows
FAILED. The control is periodic and has not rerun. Wait for the schedule, or check the finding'sUpdatedAt. - Findings are missing in one Region. Standards are enabled per Region. Compare
get-enabled-standardsacross Regions. - Duplicate-looking findings across standards. With consolidated control findings turned on, you should get one finding per control and resource. If you see one per standard, check that setting.
- A
GuardDuty.1failure. This control checks that GuardDuty itself is enabled. It links this chapter to the detector setup you did earlier.
Exercise
A Security Hub control for S3 bucket encryption shows No data in eu-west-1, while the same control shows Failed in us-east-1. List two likely causes for No data, and give the CLI command you would run first to check the standards in eu-west-1.
Show answer
Likely causes: (1) AWS Config is not enabled, or is not recording S3 bucket resources, in eu-west-1, so the service-linked Config rule has nothing to evaluate. (2) There are no S3 buckets in scope in that Region or account, or the standard containing the control is not enabled there. First command: aws securityhub get-enabled-standards --region eu-west-1, then check each standard's StandardsStatus for READY or INCOMPLETE.
Exercise
Your team sets Workflow.Status to SUPPRESSED on every failed S3.1 finding in a sandbox account, expecting the security score to improve. The score does not change. Why, and what are two ways to change it?
Show answer
Workflow status is a triage label and does not change Compliance.Status, so the checks are still FAILED and still count toward the score. To change the score, either fix the resources so the checks pass, or disable the S3.1 control for that account or standard with batch-update-standards-control-associations, recording the reason.