# hkb-forward-guardduty-findings

Fires on: GuardDuty findings of High or Critical severity (7 or higher), from every account.

Run the [common pre-checks](/wiki/runbooks/#common-pre-checks) first.

## Symptoms
An email from `hkb security alert` starting `GUARDDUTY FINDING`, with the severity, the finding type, the account, the Region and the finding's title. Only High and Critical findings (severity 7 or higher) are emailed. Medium and Low findings stay in the Security account's GuardDuty and Security Hub consoles and are found by review, with the same steps below.

## Pre-checks
1. Read the finding in the Security account as HKB-SecurityOps or HKB-ReadOnly: `aws guardduty list-findings --profile ro-hkb-security --region <region> --detector-id <id> --finding-criteria '{"Criterion":{"severity":{"Gte":7}}}'`, then `get-findings` for its resource, account and first and last time seen.
2. Match it to known activity: a test, a pentest window, or a Sandbox experiment. The [detection test](/architecture/sandbox/detection-test/) raises `Backdoor:EC2/C&CActivity.B!DNS` in Sandbox on the first Wednesday of each month, around 10:00 Denver time, on an instance named `hkb-detection-test`; sometimes an `InstanceCredentialExfiltration` finding for `hkb-detection-target` comes with it. Both are expected.

## Resolution
- **A known, accepted pattern:** archive it as HKB-SecurityOps with a note. SecurityOps can archive findings and add feedback; it can't change detectors.
- **Real:** contain the resource first (for a role, revoke its sessions; for a bucket, block public access), then follow the finding type's AWS remediation guidance and fix the cause in the templates.

## Post-checks
No new findings of the same type on the same resource.

## Rollback
Unarchive the finding if it was archived in error.

## Alert details

| Property | Value |
| --- | --- |
| Runs in | the Security account (the GuardDuty administrator), both Regions, forwarded to the `hkb-security-events` bus |
| Email | From `hkb security alert`: `GUARDDUTY FINDING severity <severity> <type> in account <account>, <region>, at <time>: <title>` |
| Source | `baseline/hkb-baseline-events.yaml`, resource `GuardDutyFindingsRule` |

The event pattern, as deployed:

```yaml
EventPattern:
  source: [aws.guardduty]
  detail-type: [GuardDuty Finding]
  detail:
    severity: [{ numeric: [">=", 7] }]
```
