Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 37 ยท Threat Intelligence and Hunting

IOCs and Alert Enrichment

Learn indicator types, the Pyramid of Pain, STIX-style sharing and how to enrich alerts with watchlists, reputation and asset data, with runnable examples.

An indicator of compromise (IOC) is a piece of evidence that a system may have been attacked or compromised: a malicious file hash, a command-and-control domain, an IP address, a registry key, a mutex name, an email sender. IOCs are the most concrete and machine-friendly form of threat intelligence, and a SIEM can match them against logs automatically. They are also the cheapest for attackers to change, so use them wisely.

This lesson covers common indicator types, how valuable each is, how to match them without drowning in false positives, and how enrichment adds context to every alert.

Common indicator types

Type Example Typical lifetime Where you match it
File hash SHA-256 of a malicious file Long, but trivially changed Endpoint, email gateway
IP address 203.0.113.50 Hours to weeks Firewall, proxy, auth logs
Domain / URL bad-invoice.example Days to months DNS, proxy, mail logs
Email indicator Sender, subject, attachment name Short Mail logs
Host artifact Registry key, service name, file path Medium Endpoint telemetry
Network pattern JA3/user-agent string, beacon interval Medium Network and proxy logs

All addresses and domains in this course use reserved example ranges (RFC 5737 and .example) and point to nothing real.

The Pyramid of Pain

The Pyramid of Pain describes how much trouble it causes an attacker when you detect each kind of indicator.

flowchart TD
    T["TTPs: tough for the attacker to change"]
    U["Tools"]
    N["Network and host artifacts"]
    D["Domain names"]
    I["IP addresses"]
    H["Hash values: trivial to change"]
    T --> U --> N --> D --> I --> H

Top = most painful for attackers (and most valuable to defenders). Bottom = easiest for attackers to change.

Climbing the pyramid

Hashes Change one byte, new hash
IPs and domains Cheap to replace
Artifacts and tools Costly to rebuild
TTPs Habits are hard to change

Block hashes for speed, detect behaviors for lasting value.

1 / 2

Hash and IP matching is quick to deploy and good for catching known commodity threats; behavior-based detections (detection rules and ATT&CK coverage) last far longer.

Sharing indicators: STIX and TAXII

Organizations exchange indicators in standard formats. STIX (Structured Threat Information eXpression) is a JSON format that describes indicators, malware, campaigns and the relationships between them. TAXII is a protocol for transporting STIX between servers. You will often see a simplified record like the one below. This is an illustrative, shortened shape, not a complete STIX object.

JSON
{
  "type": "indicator",
  "pattern": "[domain-name:value = 'bad-invoice.example']",
  "valid_from": "2025-06-10T00:00:00Z",
  "valid_until": "2025-08-10T00:00:00Z",
  "confidence": 80,
  "labels": ["phishing"]
}

Notice valid_until: a well-formed indicator carries an expiry so that old entries stop matching.

Matching indicators in logs

A SIEM keeps indicators in a watchlist (also called a lookup table or reference set) and compares each log event with it. Important details:

  • Normalize first: lowercase domains, strip trailing dots and ports, compare hashes in one case.
  • Match the right field: a destination IP in a firewall log, a query name in DNS logs.
  • Handle expiry: drop or ignore expired entries.
  • Keep a hit's context: store which feed and campaign the indicator came from so analysts can judge it.
Python Watchlist matching with expiry

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Enrichment

Enrichment adds context to an alert so analysts decide faster. Typical additions:

  • Asset context: owner, business criticality, operating system, location.
  • Identity context: department, role, privilege level, manager, whether the account is a service account.
  • Network context: internal or external, geolocation, ASN (the network operator), reverse DNS.
  • Reputation: results from threat-intelligence lookups and your own watchlists.
  • History: previous alerts and incidents for the same user, host or address.

Enrichment can happen at ingest time (fast to search later, but stale if data changes), at search time (always fresh, but slower), or in a playbook that calls external services when an alert fires (automating enrichment).

Python Enrich an alert from local lookup tables

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The enriched alert tells a story at a glance: a privileged service account on a high-value database server contacting an external address that appears in a command-and-control feed. Without enrichment the analyst would run four separate searches to learn the same thing.

Handling false positives

Indicator matches have a high false-positive rate if you are careless:

  • Shared hosting and CDN addresses serve both good and bad sites.
  • Old IP addresses get reassigned to innocent organizations.
  • Very short or generic strings (a file name like update.exe) match legitimate software.
  • Whitelist known-good entries (your own scanners, partner addresses) and review them regularly.
  • Prefer indicators with context ("this domain is used for credential phishing") over bare lists.

Common mistakes

  • Importing a feed once and never expiring it.
  • Matching on fields that do not mean what you think (a proxy's own IP instead of the client's).
  • Skipping normalization, so Example.COM. never matches example.com.
  • Over-relying on IOCs and neglecting behavior-based detection.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is a file hash a weak long-term indicator?

    Hashes sit at the bottom of the Pyramid of Pain because they are trivially altered.
  2. 2. What does an expiry date on an indicator achieve?

    Infrastructure is reused or cleaned up, so old indicators should stop matching.
  3. 3. Which is an example of enrichment?

    Enrichment adds context that speeds up triage decisions.
  4. 4. Why normalize values before matching against a watchlist?

    Equivalent values must be compared in one canonical form.

Summary

  • IOCs are hashes, IPs, domains, artifacts and patterns; the lower on the Pyramid of Pain, the faster an attacker changes them.
  • Share them as STIX-style records with confidence and expiry, and match against normalized fields.
  • Enrich alerts with asset, identity, network, reputation and history data.
  • Filter feeds, expire entries and balance indicator matching with behavior-based detection.

Next: Threat Hunting Methodology