TExcelTAD
Home › Defensive Security: SOC, SIEM, Detection Engineering & Threat Hunting › Enrichment with Asset and Identity Context

Enrichment with Asset and Identity Context

The same alert, "PowerShell downloaded a file", means three different things on a developer's test VM, on the CFO's laptop and on a domain controller. An analyst who sees only the alert has to look up who owns the host, how important it is, who the user is and whether the remote address is known, before deciding anything. Enrichment does those lookups automatically, before the alert reaches a human, and turns them into a priority. It is the cheapest large improvement most SOCs can make.

What to enrich with

Context Source Changes the decision how
Asset: owner, role, criticality, environment, OS, exposure CMDB / asset inventory, cloud tags, EDR inventory A DC or payment server raises severity; a lab VM lowers it; an Internet-facing host changes the likely attack
Identity: department, manager, privileged or not, account type (human, service, admin), status (active, on leave, terminated), usual locations HR system, directory, identity provider Activity of a terminated or on-leave user is suspicious by itself; a privileged account raises severity
Threat intelligence: reputation of IPs, domains and hashes, known campaigns Intel platform, feeds (Threat Intelligence) A known C2 address makes a weak signal strong
History: earlier alerts and cases for the same entity, first-seen dates SIEM, case system Repeat offender or a new pattern
Vulnerability state: open critical vulnerabilities on the host Scanner An exploit attempt against an unpatched service matters more

Enrichment and risk-based prioritisation

The program enriches a morning's alerts with an asset table, an identity table and an intel list, computes a priority from base severity and context, and also accumulates risk per entity: the idea behind risk-based alerting, where low-confidence detections add risk to a user or host and only the entity crossing a threshold becomes an alert.

python · try it yourself
import pandas as pd

alerts = pd.DataFrame([
    ("A1", "08:10", "office app spawned shell", 40, "ws31", "grace", ""),
    ("A2", "08:40", "powershell download",      50, "lab-vm07", "ivan", "198.51.100.77"),
    ("A3", "09:05", "powershell download",      50, "ws02", "frank", "203.0.113.66"),
    ("A4", "09:20", "new service installed",    30, "dc01", "svc-deploy", ""),
    ("A5", "09:31", "rare domain lookups",      30, "ws02", "frank", ""),
    ("A6", "09:50", "sign-in from new country", 30, "", "mallory", "203.0.113.9"),
    ("A7", "10:02", "office app spawned shell", 40, "ws02", "frank", ""),
], columns=["id", "time", "rule", "base", "host", "user", "remote_ip"])
assets = pd.DataFrame([("ws31", "finance", 2, "workstation"), ("lab-vm07", "dev lab", 1, "lab"),
                       ("ws02", "executive", 3, "workstation"), ("dc01", "IT", 5, "domain controller")],
                      columns=["host", "owner_dept", "criticality", "role"])
identity = pd.DataFrame([("grace", "finance", False, "active"), ("ivan", "engineering", False, "active"),
                         ("frank", "executive (CFO)", False, "active"), ("svc-deploy", "IT", True, "service"),
                         ("mallory", "sales", False, "terminated 2026-01-02")],
                        columns=["user", "dept", "privileged", "status"])
BAD_IPS = {"203.0.113.66": "known C2 (intel feed, high confidence)"}

e = alerts.merge(assets, on="host", how="left").merge(identity, on="user", how="left")

def priority(r):
    p, why = r.base, []
    if r.criticality >= 4: p += 30; why.append(f"critical asset ({r.role})")
    if r.criticality == 1: p -= 20; why.append("lab system")
    if r.criticality == 3: p += 15; why.append("executive device")
    if r.privileged: p += 15; why.append("privileged account")
    if str(r.status).startswith("terminated"): p += 40; why.append("account of a terminated user")
    if r.remote_ip in BAD_IPS: p += 40; why.append(BAD_IPS[r.remote_ip])
    return pd.Series({"priority": p, "why": "; ".join(why) or "-"})

e = e.join(e.apply(priority, axis=1)).sort_values("priority", ascending=False)
print(e[["id", "time", "rule", "host", "user", "priority", "why"]].to_string(index=False))

# Risk-based view: sum base risk per user over the morning; one alert only if the user crosses 100.
risk = alerts.groupby("user").base.sum().sort_values(ascending=False)
print("\nrisk per user:", risk.to_dict())
print("users over 100:", list(risk[risk >= 100].index))
id  time                     rule     host       user  priority                                                      why
A3 09:05      powershell download     ws02      frank       105 executive device; known C2 (intel feed, high confidence)
A4 09:20    new service installed     dc01 svc-deploy        75   critical asset (domain controller); privileged account
A6 09:50 sign-in from new country             mallory        70                             account of a terminated user
A7 10:02 office app spawned shell     ws02      frank        55                                         executive device
A5 09:31      rare domain lookups     ws02      frank        45                                         executive device
A1 08:10 office app spawned shell     ws31      grace        40                                                        -
A2 08:40      powershell download lab-vm07       ivan        30                                               lab system

risk per user: {'frank': 120, 'ivan': 50, 'grace': 40, 'mallory': 30, 'svc-deploy': 30}
users over 100: ['frank']

Sorted by base severity, the queue would start with the two PowerShell downloads (50) as equals and put mallory's sign-in (30) near the bottom. Enriched, it reads differently:

  • A3 is first (105): the download on the CFO's laptop went to an address the intel feed lists as a known C2 server. The identical rule on a developer's lab VM (A2) drops to the bottom (30).
  • A4 (75): a new service on a domain controller, created by a privileged service account. Possibly a deployment, but it has to be checked quickly.
  • A6 (70): a sign-in by mallory, whose employment ended on 2 January. No travel analysis was needed; the account should not work at all.
  • The risk view adds what single alerts miss: frank collected three different detections in an hour (rare domains, a download, Word spawning a shell) for a total of 120, the only user over the threshold. Combined with A3, that is an incident on ws02, not three separate tickets.

How enrichment goes wrong

  • Stale context. An asset table that still lists a decommissioned server, or an HR feed that marks leavers a month late, produces confident wrong priorities. Monitor the freshness of every enrichment source like a log source.
  • Missing entities. A host not in the inventory gets no criticality; the program's left join shows it as missing (NaN), and a careless score treats that as "not critical". Treat unknown assets as their own finding: an unmanaged device is a risk in itself.
  • Context that only lowers. If enrichment is mainly used to suppress ("it's a lab VM, ignore it"), attackers who reach lab systems and pivot from there are ignored too. Lab systems often have weak credentials and network paths to production.
  • Lookups on the analyst's side only. If enrichment happens when the analyst opens the case, the queue is still sorted by base severity; enrich at alert time.

How to build it well

  • Enrich in the pipeline, at ingestion or alert creation: asset and identity lookups by host and user, intel matches on IPs, domains and hashes.
  • Keep the reasons with the score (the why column): analysts trust a priority they can read.
  • Own the tables: someone is responsible for the asset inventory and identity feed, with data-quality checks.
  • Review the weights after incidents: if a true positive was prioritised low, find which context was missing or weighted wrongly.

Pitfalls

  • Double counting. "Executive device" and "executive user" are the same fact; adding both inflates the score.
  • Using enrichment to hide noisy rules. Fix the rule (Tuning, Suppression and Allow-Lists); enrichment orders what remains.
  • Exposing sensitive context. HR status and executive flags are personal data; limit who sees them and log access.

Practice

1. A8 at 10:15: "new service installed" (base 30) on an unknown host `ws99` by user `frank`. What does the program give it, and what should it give?

ws99 is not in the asset table, so criticality is missing and no asset adjustment applies: priority 30 from the base alone. It should be raised and flagged "unknown asset": an unmanaged machine is a finding itself, and frank is already at risk 120. Add an explicit rule: if pd.isna(r.criticality): p += 20; why.append("unknown asset").

2. Why does the risk-based view catch frank even though none of his alerts is high on its own?

His three alerts (rare domain lookups 30, PowerShell download 50, Office spawning a shell 40) add up to 120 within an hour (09:05 to 10:02). Each is common alone; three different detections on one entity are not. This is the same principle as the correlation engine (A Correlation Engine in pandas).

3. mallory's sign-in has base severity 30. Which single fact more than doubles its priority, and what is the fix?

Her account belongs to a terminated user (since 2026-01-02). Any successful activity of a leaver's account means deprovisioning failed and someone (the ex-employee or an attacker) is using it. Fix: disable accounts as part of the leaver process, and alert on any activity of disabled or leaver accounts.

Test yourself

What does enrichment add to an alert?

  1. More raw events
  2. Context about the asset, the identity, intel and history, so the alert can be prioritised without manual lookups
  3. Encryption
  4. A second copy of the alert

Why did A3 (PowerShell download on ws02) rank above A2 (the same rule on lab-vm07)?

  1. It came later
  2. ws02 is the CFO's device and the remote IP is a known C2 address, while lab-vm07 is a lab system
  3. A2 was a duplicate
  4. Alphabetical order

How should an asset missing from the inventory be treated?

  1. As not critical
  2. As unknown, which is a finding of its own
  3. It should be ignored
  4. As a domain controller

What is the idea of risk-based alerting?

  1. Every detection pages an analyst
  2. Detections add risk to an entity, and only an entity crossing a threshold becomes an alert
  3. Alerts are sorted alphabetically
  4. Risk is measured in dollars