Sub topic 9
Understanding the finding format
This chapter assumes you can read JSON, have used the AWS CLI, and know what GuardDuty findings are from the earlier chapters. It explains the two schemas Security Hub uses to describe a finding, shows how a GuardDuty finding maps into each, and covers the mistakes people make when they query them.
Why a common format exists
GuardDuty, Amazon Inspector, Amazon Macie, IAM Access Analyzer, and third-party products each describe problems in their own way. A GuardDuty finding has a type such as Recon:EC2/PortProbeUnprotectedPort. An Inspector finding has a CVE ID. A Security Hub control failure has a control ID.
Security Hub cannot sort, filter, or route these findings together unless they share field names. The shared schema gives every finding the same top-level fields for the title, severity, affected resource, and workflow state. A single filter can then work across all products.
Security Hub supports two schemas:
- AWS Security Finding Format (ASFF) is the JSON schema Security Hub has used since launch. It is the format that the Security Hub
get-findingscommand returns, and the one the EventBridge eventSecurity Hub Findings - Importedcarries. - Open Cybersecurity Schema Framework (OCSF) is an open, vendor-neutral schema. AWS uses it in Amazon Security Lake, and newer Security Hub capabilities also use it.
Check the current AWS documentation for which Security Hub features in your account use which schema. The rollout differs by capability and is still changing. The examples in this chapter use ASFF, which is what the CLI commands in this tutorial return.
Anatomy of an ASFF finding
An ASFF finding is a JSON object. Security Hub requires a fixed set of top-level fields and allows optional ones. The fields you use most are in this table.
| Field | Meaning | Example |
|---|---|---|
| `SchemaVersion` | The ASFF version | `2018-10-08` |
| `Id` | A unique identifier for the finding, set by the product | an ARN |
| `ProductArn` | The product that sent the finding | the GuardDuty product ARN for the Region |
| `GeneratorId` | The detector or rule that produced it | `arn:aws:guardduty:...:detector/...` |
| `AwsAccountId` | The account that owns the affected resource | a 12-digit ID |
| `Types` | A namespace-style classification | `TTPs/Discovery/Recon:EC2-PortProbeUnprotectedPort` |
| `CreatedAt`, `UpdatedAt` | Timestamps in ISO 8601 format | `2026-11-26T18:00:00.000Z` |
| `Severity` | An object with `Label` and `Normalized` | `HIGH`, `70` |
| `Title`, `Description` | Human-readable text | |
| `Resources` | A list of affected resources | an EC2 instance |
| `Compliance` | Pass or fail status, used by control findings | `FAILED` |
| `Workflow` | The state you manage, such as `NEW` or `SUPPRESSED` | `NEW` |
| `RecordState` | Whether Security Hub still considers the record active | `ACTIVE` or `ARCHIVED` |
| `ProductFields` | A free-form map of fields from the source product | GuardDuty-specific values |
Two details cause most confusion.
First, Workflow.Status and RecordState are different things. RecordState belongs to the provider. When GuardDuty archives a finding, for example because a suppression rule matched, the provider sets RecordState to ARCHIVED. Workflow.Status belongs to you. You change it to NOTIFIED, SUPPRESSED, or RESOLVED as you work through the finding.
Second, Severity has several parts. Label is one of INFORMATIONAL, LOW, MEDIUM, HIGH, or CRITICAL. Normalized is a number from 0 to 100. The product-specific number, such as GuardDuty's 0 to 10 scale, is kept in Severity.Original or in ProductFields.
The severity conversion
GuardDuty severity is a decimal from 1.0 to 8.9 or so. Security Hub maps it to its own scale. As a rule of thumb, GuardDuty 7.0 and above is HIGH, and the normalized value is roughly ten times the GuardDuty value. Treat that as an approximation and confirm the mapping in the documentation before you build thresholds on it.
This matters because the two services use different numbers in their filters. A GuardDuty filter uses the 0 to 10 scale. A Security Hub filter on SeverityNormalized uses the 0 to 100 scale. Mixing them up produces a filter that matches nothing, or everything.
How a GuardDuty finding maps into ASFF
GuardDuty sends findings to Security Hub automatically once both services are enabled in the same Region. GuardDuty translates its native finding into ASFF. Here is how the main pieces line up.
| GuardDuty field | ASFF field |
|---|---|
| `type` | `Types` (reformatted) and `ProductFields` |
| `severity` | `Severity` |
| `title`, `description` | `Title`, `Description` |
| `resource` | `Resources` |
| `service` details such as the actor and the action | `ProductFields` and related objects |
| `accountId` | `AwsAccountId` |
| `updatedAt` | `UpdatedAt` |
The translation is not lossless in structure. The detailed GuardDuty service.action object, for example, does not become a set of dedicated top-level ASFF fields. Some of it appears in ProductFields as flattened keys. If you need a GuardDuty-specific detail, such as the remote IP address of a port probe, look in ProductFields or in the original GuardDuty finding before you assume ASFF has no place for it.
The diagram shows a point worth remembering. GuardDuty publishes its own native event to EventBridge, and Security Hub publishes a separate ASFF event. They carry different JSON shapes. An EventBridge pattern written for one will not match the other.
Reading ASFF with the CLI
The following command retrieves GuardDuty findings from Security Hub and uses a JMESPath query to pull out the fields that matter. It uses the ProductName filter from the earlier chapter.
aws securityhub get-findings \
--filters '{"ProductName":[{"Value":"GuardDuty","Comparison":"EQUALS"}],"RecordState":[{"Value":"ACTIVE","Comparison":"EQUALS"}]}' \
--max-items 5 \
--query 'Findings[].{Title:Title,Label:Severity.Label,Normalized:Severity.Normalized,Account:AwsAccountId,Workflow:Workflow.Status}' \
--output tableTo filter by severity inside Security Hub, use the normalized scale. This command asks for findings in the HIGH label:
aws securityhub get-findings \
--filters '{"SeverityLabel":[{"Value":"HIGH","Comparison":"EQUALS"}],"ProductName":[{"Value":"GuardDuty","Comparison":"EQUALS"}]}' \
--max-items 10 \
--query 'Findings[].[Id,Title]' \
--output textFiltering on SeverityLabel avoids the numeric-scale mix-up entirely. Prefer it when a label is precise enough for your need.
Updating the workflow state
Because Workflow.Status is yours to set, you can record triage progress on a finding. The call needs the finding's Id and ProductArn.
aws securityhub batch-update-findings \
--finding-identifiers Id="$FINDING_ID",ProductArn="$PRODUCT_ARN" \
--workflow Status=NOTIFIED \
--note Text="Owner paged",UpdatedBy="oncall"This changes the Security Hub record only. It does not archive the finding in GuardDuty, and it does not stop GuardDuty from producing similar findings later. To stop future noise, use a GuardDuty suppression rule.
A short look at OCSF
OCSF organizes events into classes. A detection finding in OCSF has a class, a category, an activity, and a status. Where ASFF puts the product's own data in ProductFields, OCSF has a structured finding_info object and uses typed objects for resources, actors, and evidence. Its field names are lowercase with underscores, such as finding_info.title and severity_id. Severity is an integer enum rather than a label plus a number.
Practical differences to expect when you work with OCSF:
- Field names and nesting differ, so a JMESPath query or an EventBridge pattern written for ASFF must be rewritten.
- Many values are numeric IDs with matching string captions, such as
severity_idandseverity. - Amazon Security Lake stores OCSF as Parquet files that you query with SQL tools such as Amazon Athena, not with
get-findings.
If your team has downstream tools, check which schema they expect before you choose a path.
Common errors
- Using the wrong event shape in EventBridge. The
detailof a GuardDuty event hasseverityas a number from 0 to 10. Thedetail.findings[]of a Security Hub event is an array of ASFF objects withSeverity.Label. Pattern and handler code must match the source. - Reading
findingsas a single object. Security Hub events deliver a list indetail.findings. A handler that readsdetail.findings["Title"]fails. Loop over the list. - Comparing severity across scales. Use 0 to 10 for GuardDuty and 0 to 100 for normalized Security Hub values.
- Searching only in Regions where you did not enable the service. Security Hub findings live in the Region where they were generated unless you configure cross-Region aggregation. An empty result can mean you are in the wrong Region.
- Assuming a Workflow change reaches the source. Updating
Workflow.Statusdoes not affect GuardDuty's own record. - Ignoring
ProductFields. It is where product-specific detail often hides, and its keys are not guaranteed to be stable across products.
The handler below reads an ASFF event correctly. It loops over detail.findings and reads fields from the ASFF structure.
def handler(event, context):
results = []
for finding in event["detail"]["findings"]:
resources = finding.get("Resources", [])
resource_id = resources[0]["Id"] if resources else None
results.append(
{
"title": finding["Title"],
"label": finding["Severity"]["Label"],
"account": finding["AwsAccountId"],
"resource": resource_id,
"workflow": finding.get("Workflow", {}).get("Status"),
}
)
print(results[-1])
return resultsDecision guide
| You want to... | Use |
|---|---|
| Filter GuardDuty findings by its own 0 to 10 severity | GuardDuty `list-findings` |
| Query findings from many products at once | Security Hub `get-findings` with ASFF filters |
| React to a finding in near real time from GuardDuty only | EventBridge with the `aws.guardduty` source |
| React to findings from all products | EventBridge with the `aws.securityhub` source |
| Run large-scale SQL analysis on a data lake | Amazon Security Lake with OCSF |
Exercise
You write an EventBridge rule for the source aws.securityhub and use the pattern {"detail": {"severity": [{"numeric": [">=", 7]}]}}. It never matches. Give two reasons and say how to fix it.
Show answer
First, a Security Hub event does not have detail.severity. Its findings are an array at detail.findings, and severity is in Severity.Label and Severity.Normalized inside each item, so the path does not exist. Second, even if you point at the right field, Security Hub's normalized scale runs from 0 to 100, so a threshold of 7 is the wrong scale for it. The fix is to match on detail.findings.Severity.Label with the value HIGH (or CRITICAL), or on detail.findings.Severity.Normalized with a numeric threshold on the 0 to 100 scale. Alternatively, use the aws.guardduty source, where detail.severity does exist on the 0 to 10 scale.
Exercise
Your analyst runs batch-update-findings to set a GuardDuty finding to SUPPRESSED. The next day, the same type of finding appears again. Why, and what should be done?
Show answer
Workflow.Status only changes the Security Hub record for that one finding. It does not change GuardDuty's behavior. GuardDuty keeps producing findings of that type. To stop them, create a suppression rule in GuardDuty with create-filter and --action ARCHIVE, using criteria that match the benign activity.