Lesson 5 of 9 · 24m
Alert Enrichment That Actually Helps
Enrichment is judgment at machine speed; add context that changes a decision, cache it honestly, and label weak evidence as weak.
Most alert enrichment fails in one of two ways. Either it adds trivia that does not change the decision, or it presents weak inference as fact. Good enrichment answers the analyst's next three questions before they have to ask.
Enrich decisions, not fields
Start from the triage decision. For a suspicious login: who owns the identity, is the device managed, is the network expected, and what else happened nearby? For malware: what asset is this, how exposed is it, what data does it hold, and did the process lineage continue?
def enrich_login(alert: dict) -> dict:
return {
"user_owner": directory.lookup_user(alert["user"]),
"device": inventory.lookup_device(alert.get("device_id")),
"network": network_context(alert["source_ip"]),
"recent_incidents": incidents.recent_for_user(alert["user"], hours=72)}Each field should map to an action. If nobody would ever use isp_name to make a decision, do not put it in the triage panel just because an API returned it.
Cache with a memory horizon
Context changes at different speeds. Asset ownership may be valid for days, passive DNS for minutes, and reputation somewhere in between. Cache deliberately instead of hammering providers.
from time import time
class TTLCache:
def __init__(self, ttl_seconds: int):
self.ttl = ttl_seconds
self.items = {}
def get(self, key):
item = self.items.get(key)
return item["value"] if item and time() - item["stored_at"] < self.ttl else None
def set(self, key, value):
self.items[key] = {"value": value, "stored_at": time()}Store negative results too, but with a shorter TTL. A failed lookup during a provider outage should not be remembered as "no owner exists" for a week.
Label source, age, and confidence
Enrichment is evidence. It needs provenance: owner: payments-team means different things when it came from last night's CMDB export versus a spreadsheet uploaded in 2023.
{
"asset_owner": {
"value": "payments-operations",
"source": "cmdb",
"observed_at": "2026-11-29T22:10:00Z",
"confidence": "authoritative"
}
}A threat-intel timeout should not delete the original alert or block triage forever. Mark the enrichment unavailable, continue, emit a metric, and let operators see the degradation.
Field notes
- Never overwrite raw alert fields with enrichment; put enrichment in a separate namespace.
- Treat RFC 1918, carrier-grade NAT, and cloud metadata addresses specially — public IP lookups on private space are noise.
- An owner field is a routing hint for operational action, not a person to blame.
- Batch APIs when possible, but isolate per-item failures so one malformed indicator does not poison the batch.
- Measure enrichment by time saved in triage, not number of fields added.
Was this lesson helpful?