Sub topic 9
Understanding the finding format
This chapter assumes you can read JSON, know what an AWS account and Region are, and have seen a GuardDuty finding in the console or CLI. Security Hub receives findings from many services, so it needs one shared shape for them. This chapter covers that shape and the two formats that describe it.
Why a common format matters
GuardDuty, Inspector, Macie, and third-party tools each describe problems in their own way. If Security Hub stored them as-is, you could not filter or sort them together. Security Hub converts every finding into a standard schema. You then write one query and get results from every source.
Security Hub supports two schemas:
| Format | Full name | Where you meet it |
|---|---|---|
| ASFF | AWS Security Finding Format | Security Hub findings, `get-findings`, EventBridge events from Security Hub |
| OCSF | Open Cybersecurity Schema Framework | Newer Security Hub findings and the open-source security data ecosystem |
ASFF is a JSON format defined by AWS. OCSF is an open, vendor-neutral schema. Check which format your Security Hub setup uses before you write filters or rules, because the field names differ.
Anatomy of an ASFF finding
An ASFF finding is a JSON object with top-level fields. These are the ones you use most.
| Field | Meaning |
|---|---|
| `Id` | Unique ID of the finding |
| `ProductArn` | The service or product that produced it |
| `ProductName` | Readable product name, such as `GuardDuty` |
| `AwsAccountId` | Account where the issue was found |
| `Types` | Category path, such as `TTPs/Discovery` |
| `Severity.Label` | `INFORMATIONAL`, `LOW`, `MEDIUM`, `HIGH`, or `CRITICAL` |
| `Resources` | The affected resources, each with a `Type` and `Id` |
| `RecordState` | `ACTIVE` or `ARCHIVED` |
| `Workflow.Status` | Your triage state: `NEW`, `NOTIFIED`, `SUPPRESSED`, or `RESOLVED` |
Here is a shortened finding, based on a GuardDuty sample:
{
"SchemaVersion": "2018-10-08",
"ProductName": "GuardDuty",
"AwsAccountId": "111122223333",
"Types": ["TTPs/Discovery/Recon:EC2-PortProbeUnprotectedPort"],
"Severity": { "Label": "LOW", "Normalized": 1 },
"Resources": [
{ "Type": "AwsEc2Instance", "Id": "arn:aws:ec2:us-east-1:111122223333:instance/i-0abc123" }
],
"RecordState": "ACTIVE",
"Workflow": { "Status": "NEW" }
}How GuardDuty fields map to ASFF
GuardDuty's native finding is not the same as the ASFF version. Security Hub translates it:
- GuardDuty
typebecomes an entry inTypes. - GuardDuty
severity(a number from 0 to 10) becomesSeverity.Label, plus aNormalizedscore from 0 to 100. - GuardDuty
resourcebecomes an entry inResources. - The original GuardDuty detail is kept under
ProductFields.
Because of this mapping, a number like severity >= 7 in an EventBridge rule on GuardDuty events does not carry over to Security Hub events. Use Severity.Label there.
Common errors
- Filtering on the wrong field.
get-findingsfilters use ASFF names such asProductNameandRecordState. GuardDuty names such astypedo not work there. - Mixing severity scales. GuardDuty uses 0 to 10. ASFF uses a label and a 0 to 100 normalized score.
- Ignoring
Workflow.Status. Triage state is separate fromRecordState. A finding can beACTIVEandRESOLVEDin workflow terms.
Exercise
A teammate writes an EventBridge rule for Security Hub findings that matches "severity": [{"numeric": [">=", 7]}], copied from a GuardDuty rule. It never matches. Why, and what should they use instead?
Show answer
Security Hub events use ASFF, where severity is stored in Severity.Label (and Severity.Normalized on a 0 to 100 scale), not as a 0 to 10 severity number. They should match on Severity.Label values such as HIGH and CRITICAL, or use the normalized score.