# Threat mapping

> Every device alert tagged with its MITRE ATT&CK techniques and compliance controls, and the realm's alerts laid over the ATT&CK matrix.

An alert that names only a rule means little to an auditor or an incident lead. Every alert from your devices comes
tagged with what it means: the MITRE ATT&CK techniques it's evidence of, and the PCI DSS, GDPR, HIPAA, NIST 800-53
and SOC 2 controls it touches. The ATT&CK view shows where your realm's alerts fall across tactics and techniques, so
you see the shape of an attack, not a list of lines.

## Before you begin

- **Who:** an administrator of the realm, in a group holding `RealmOwner` or `RealmViewer` on the realm or a realm
  above it (see [Delegated administration](../../../platform/realms/delegated-administration/)). Reading needs no
  more than `RealmViewer`.
- **Where:** the API.
- **First:** alerts in the range; the matrix counts them.

## How it works

The tags come from the shipped ruleset: each rule names its techniques and controls, and each alert it raises
carries them, as `rule.mitre` and `rule.compliance`. The matrix counts the realm's alerts in a time range under each
tactic and technique of the **Enterprise ATT&CK matrix, version 13**, its tactics in the order of an attack.

## Set it up

Nothing to turn on. The matrix gives every tactic and its techniques, each with the realm's alerts over the range.
Through the API ([Call the API](../../../develop/api/)), read the realm's alerts over the matrix, then one technique to
read what it is:

```sh
curl "https://foobar.cvyuh.com/api/v0/endpoint/dar/v1/mitre/matrix?from=<RFC 3339 time>&to=<RFC 3339 time>" \
  -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

curl https://foobar.cvyuh.com/api/v0/endpoint/dar/v1/mitre/techniques/T1110 \
  -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
```

Add `agent=<sensor id>` to the matrix for one device. The alerts that name a technique are
[Security events](../../security-log/events/) with `preset=mitre`, filterable by `technique` and `tactic`.

## Limits and defaults

| Limit | Value |
|---|---|
| ATT&CK matrix | Enterprise, version 13 |
| Compliance frameworks tagged | PCI DSS, GDPR, HIPAA, NIST 800-53, SOC 2 (Trust Services Criteria) |
| Default range | The last day |
| What's tagged | Device alerts only |

## Good to know

- **Device alerts only.** Decisions at the realm's gateway and the realm's audit trail carry no framework tags yet;
  see [Compliance tags on gateway and audit events](../whats-next/#compliance-tags-on-gateway-and-audit-events).
- **A tag is evidence, not coverage.** The matrix shows where your alerts fall, not which techniques the ruleset can
  detect.

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| The matrix is empty | No alert in the range names a technique | Widen the range |
| `400` for `agent` | It isn't a sensor id | Use the device's sensor id (see the [API reference](../../api/)) |

## Audit record

Reading the matrix writes no audit record.

## Related

- [Security events](../../security-log/events/): each alert, with its tags.
- [Configuration assessment](../configuration-assessment/): checks tagged with the controls they serve.
