Agent Foskett Academy • Microsoft Sentinel • Module 6 • Lesson 55

Lesson 55 — Automatically Enriching Sentinel Incidents

Turn a basic incident notification into an evidence-first enrichment workflow. Use approved context sources to help analysts decide what to investigate, without confusing a lookup result with proof of compromise.

Module 6 — SOC Automation and Response • Incident enrichment
Agent Foskett Microsoft Sentinel automated incident enrichment
What you will learn

Build a controlled, auditable incident enrichment workflow.

✓ Incident entity context
✓ Approved lookup sources
✓ Logic Apps branching and errors
✓ Evidence-first analyst notes

The case — the suspicious address

A Sentinel incident includes an unfamiliar IP address. An analyst needs to know whether it belongs to a trusted service, appears in an approved watchlist or has relevant reputation context. Agent Foskett builds a playbook that gathers context and records what it actually found — without automatically declaring the IP malicious.

What you will learn

  • Distinguish incident enrichment from detection and response.
  • Extract incident entities using supported Sentinel connector actions.
  • Choose approved internal and external enrichment sources.
  • Validate missing, ambiguous and stale lookup results.
  • Add a readable incident comment with provenance and limitations.
  • Test failure paths, duplicate runs and access permissions.

Where enrichment fits

SENTINEL INCIDENT CREATED ↓ NARROW AUTOMATION RULE ↓ LOGIC APPS INCIDENT PLAYBOOK ↓ EXTRACT / VALIDATE ENTITIES ↓ LOOK UP APPROVED CONTEXT ↓ RECORD RESULT + SOURCE + TIME ↓ ANALYST REVIEWS ORIGINAL EVIDENCE

Enrichment adds context to an investigation. It does not establish that an account, device or address is compromised.

Prerequisites and lab safety

  • Complete Lessons 53 and 54 or have equivalent experience with automation rules and Logic Apps.
  • Use a dedicated lab incident with a known test IP or other non-sensitive entity.
  • Confirm Sentinel and Logic Apps permissions, connector identities and organizational approval for lookup sources.
  • Do not send personal or sensitive incident data to external services without approval.
  • Start with comment-only output; no account disablement, IP blocking or automatic closure.

Step 1 — Define the enrichment contract

InputOutputGuardrail
Incident resource and entitiesSelected entity identifiersValidate type and presence
Approved lookup sourceContext and source timestampRecord provenance and errors
Enrichment resultAnalyst-facing incident commentNo unsupported verdict or response

Step 2 — Choose a suitable entity

For the first lab, enrich a single IP address entity. Some incidents contain multiple IPs, none at all, or mixed account, host and URL entities. Define whether the workflow processes the first matching IP or iterates over all matching IPs, and document the limit.

Do not assume an IP address is an attacker: it may be a VPN egress address, proxy, internal resolver or shared service.

Step 3 — Create a copy of your playbook

  1. Open the tested Lesson 54 Logic App.
  2. Save or deploy a separate lab version named AF-LAB-Incident-Enrichment.
  3. Retain the Microsoft Sentinel incident trigger and a dedicated, narrow automation rule.
  4. Verify the workflow identity and permissions before changing actions.
  5. Record the resource group, owner and rollback steps.

Step 4 — Retrieve incident entities

Use the Microsoft Sentinel connector’s supported incident-entity action or the incident trigger’s documented entity data, depending on your workflow and connector version. Inspect dynamic content and a controlled test run to confirm the actual payload.

Prefer the designer’s typed dynamic content to hand-built JSON paths. An incident number, resource ID and entity identifier are not interchangeable.

Step 5 — Filter and normalize IP entities

  1. Inspect the returned entity array.
  2. Use a filter or condition for IP-type entities supported by your connector schema.
  3. Extract the address value and trim whitespace.
  4. Handle empty values, malformed strings and unexpected types.
  5. For the initial lab, cap the number of addresses processed and record any truncation.

Use sample run history to confirm field names; connector outputs can differ across versions.

Step 6 — Choose an approved context source

SourceUseful contextLimitation
Internal asset inventoryOwnership and business roleMay be outdated
Sentinel watchlistOrganization-maintained trusted or monitored addressesEntry does not prove benign or malicious
Approved threat-intelligence feedIndicator reputation and observed contextCan be stale, incomplete or false positive

For this exercise, start with an approved internal reference source. External reputation lookups require privacy, licensing, egress and credential review.

Step 7 — Build a controlled lookup

  1. Add the approved connector action or authorized API call for your reference source.
  2. Pass only the validated IP address required by that source.
  3. Use managed identity where supported, otherwise store credentials in an approved secret mechanism.
  4. Capture lookup status, source name, retrieval time and returned classification or notes.
  5. Do not log secrets or raw authentication headers.

Watchlist data is often queried through Log Analytics/KQL; it is not automatically exposed as a one-click Logic Apps lookup action. Choose an integration method supported by your tenant.

Step 8 — KQL: inspect your approved watchlist

Validate the watchlist schema before integration
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
_GetWatchlist("SOC-IP-Context")
| project SearchKey, TimeGenerated,
          Description = tostring(column_ifexists("Description", "")),
          Classification = tostring(column_ifexists("Classification", ""))
| take 20

Replace SOC-IP-Context with a watchlist alias that exists in your workspace. Watchlist columns are defined by the uploaded data; inspect the real schema first. SearchKey is the designated search key, not necessarily a validated IP address.

Step 9 — KQL: compare observed IP activity with context

Example sign-in context for approved lab IPs
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
let Context =
    _GetWatchlist("SOC-IP-Context")
    | project IPAddress = tostring(SearchKey),
              Classification = tostring(column_ifexists("Classification", ""));
SigninLogs
| where TimeGenerated > ago(24h)
| where isnotempty(IPAddress)
| summarize SignIns = count(),
            FailedSignIns = countif(ResultType != "0")
    by IPAddress
| join kind=leftouter Context on IPAddress
| project IPAddress, SignIns, FailedSignIns, Classification
| order by FailedSignIns desc

This query is an analyst validation example, not a claim that the playbook automatically executes KQL. If the workflow needs query results, configure and authorize a supported Log Analytics query action separately. The SigninLogs table requires appropriate ingestion and access.

Step 10 — Design honest result categories

ResultSuggested note
Approved context found“Reference entry found; analyst validation required.”
No match“No match in this source at lookup time.”
Lookup failed“Enrichment unavailable; source did not return a usable result.”
No supported IP entity“IP enrichment skipped: no valid IP entity present.”

“No match” does not mean “safe”. “Matched indicator” does not by itself mean “confirmed attack”.

Step 11 — Add a structured incident comment

Agent Foskett — automated enrichment Entity type: IP address Entity: [validated address] Source: [approved lookup source] Result: [match / no match / unavailable] Checked: [UTC time] Assessment: Context only; analyst review required

Build the note using validated dynamic fields. Avoid dumping complete incident payloads into comments or including unnecessary personal data.

Step 12 — Handle empty and multiple results

Use conditions to skip unsupported entities and avoid passing null values to connectors. When more than one valid IP is present, use a bounded loop or an explicit single-IP lab scope. Keep the output readable and make the processed count visible.

Step 13 — Build an error path

  1. Group lookup actions in a Logic Apps Scope.
  2. Add a fallback Scope configured with run after for failure, timeout or skipped states as appropriate.
  3. Record a neutral “lookup unavailable” note without exposing secrets.
  4. Preserve the run ID and failed action for troubleshooting.
  5. Do not treat a failed lookup as a negative reputation result.

Step 14 — Prevent duplicate enrichment

Automation rules, connector retries and manual playbook runs can create repeated notes. Use an approved idempotency strategy, such as an incident/workflow/version marker in a durable state store, when required. A comment-only lab can demonstrate duplicates safely, but production workflows must define retry and deduplication behaviour explicitly.

Step 15 — Test with a matching incident

  1. Create or select an approved lab incident with a known IP entity.
  2. Confirm the automation rule matches only the intended test incident.
  3. Run the playbook and inspect trigger inputs and action outputs.
  4. Compare the incident comment with the original reference source.
  5. Verify that no severity, status, ownership or containment changes occurred.

Step 16 — Test non-matching and failure cases

  • Incident with no IP entity.
  • Valid IP with no context match.
  • More than one IP entity.
  • Lookup service timeout or denied permission.
  • Incident that should not match the automation rule.
  • Repeated execution of the same test incident.

Capture the expected and observed outcomes for each case.

Step 17 — Review permissions and data handling

Verify the Logic App identity can access only required resources. Confirm the lookup connector’s authentication, network egress, retention, logs and cost. Apply organizational rules for sensitive identifiers, external services and incident data. A workflow can succeed technically while violating a data-handling requirement.

Step 18 — Troubleshoot a missing enrichment note

SymptomCheck first
No Logic App runAutomation rule trigger, condition and playbook authorization
Run fails on entity extractionActual payload schema and missing values
Lookup returns emptySource scope, search key, normalization and permissions
Lookup succeeds but no commentIncident reference and connector identity
Multiple commentsRetries, overlapping rules and duplicate executions

Step 19 — Agent Foskett case file: The trusted address

The playbook marks an IP address as “trusted” because it appears on an internal watchlist. The SOC analyst is ready to close the case.

Agent Foskett checks the entry. It was added two years ago for a retired VPN gateway.

“Excellent,” he says. “We have successfully automated our historical assumptions.”

Lesson: reference data is context, not a verdict. Always check its owner, age and relevance.

Hands-on assessment

  1. Build a dedicated enrichment playbook with a narrow Sentinel automation rule.
  2. Extract and validate an IP entity from a controlled incident.
  3. Query one approved context source and preserve provenance.
  4. Add an honest, structured incident comment.
  5. Demonstrate the no-match and lookup-failure paths.
  6. Verify the playbook makes no disruptive security changes.
  7. Document permissions, retry behaviour, cost and rollback.

Publishing and operational checklist

  • Incident and entity schema verified in a test run.
  • Lookup source approved and documented.
  • Inputs validated; empty and multiple entities handled.
  • Comments identify source, timestamp and limitations.
  • Failure does not masquerade as “clean”.
  • Duplicate execution considered.
  • Least-privilege access and data-handling rules checked.
  • Test evidence and rollback instructions retained.

Agent Foskett takeaway

Enrichment should make an analyst better informed, not falsely certain. Gather context, show where it came from, explain what is missing and leave the investigation decision to the evidence.

The logs already knew. The lookup merely introduced itself.

Lesson 55 complete — evidence-first incident enrichment!
You can now design, test and audit a safe Sentinel incident enrichment workflow with clear source context and analyst oversight.
Sentinel Academy Home

Related Agent Foskett learning

Review the playbook and automation skills behind safe incident enrichment.