Agent Foskett Academy • Microsoft Sentinel • Module 7 • Lesson 61

Lesson 61 — Introduction to Advanced Threat Hunting in Microsoft Sentinel

Move beyond reacting to alerts. Learn to form hypotheses, search available telemetry, test alternative explanations and document defensible findings in Microsoft Sentinel.

Module 7 — Advanced Threat Hunting and Investigation • Foundations
Agent Foskett Microsoft Sentinel advanced threat hunting investigation
What you will learn

Think like a threat hunter, not an alert counter.

✓ Build testable hunting hypotheses
✓ Validate data coverage and baselines
✓ Hunt with scoped KQL queries
✓ Record evidence and next pivots

Agent Foskett case file — The alert that never fired

There is no high-severity Sentinel incident. Yet an analyst notices a service account authenticating at unusual hours. Is this an expected batch job, a maintenance change or early evidence of misuse? Agent Foskett begins with a question, not a verdict.

What advanced threat hunting means

Threat hunting is a proactive, hypothesis-driven search for suspicious activity that may not have generated an alert. It differs from alert triage: hunters choose a question, inspect relevant evidence, compare behavior against a baseline and decide whether further investigation is justified.

Learning objectives

  • Distinguish proactive hunting from incident response and scheduled detection.
  • Translate a suspicion into a testable hypothesis.
  • Check which telemetry is actually ingested and retained.
  • Use KQL to scope, summarize and investigate candidate anomalies.
  • Document negative findings, coverage limits and follow-up pivots.

The evidence-first hunting cycle

OBSERVATION / THREAT INTELLIGENCE ↓ HYPOTHESIS + ALTERNATIVE EXPLANATIONS ↓ TELEMETRY COVERAGE + BASELINE ↓ BOUNDED KQL HUNT ↓ VALIDATE CANDIDATES + BUILD TIMELINE ↓ DOCUMENT EVIDENCE / GAPS / DECISION ↓ TUNE DETECTION OR PLAN NEXT HUNT

Prerequisites and lab safety

  • Complete the earlier Sentinel KQL and investigation lessons or have equivalent experience.
  • Use an authorized Microsoft Sentinel workspace and a controlled lab account.
  • Confirm Entra SigninLogs is ingested before running the examples.
  • Have permission to read logs and document a hunt.
  • Keep this lesson read-only: do not disable accounts or block addresses based on a single anomaly.

Step 1 — Start with a hypothesis

Example: “A service account may be signing in interactively outside its normal operating window.” This is testable. The statement “The account is compromised” is a conclusion and must not be used as the starting assumption.

Step 2 — List competing explanations

  • Approved overnight maintenance or scheduled processing.
  • A legitimate application deployment or service migration.
  • Clock, time-zone or ingestion effects.
  • Unexpected use of credentials by an operator.
  • Unauthorized access requiring deeper investigation.

Write these down before viewing the results to reduce confirmation bias.

Step 3 — Identify relevant data sources

QuestionPotential sourceLimitation
When did an account sign in?SigninLogsRequires Entra diagnostic ingestion
What identity changes occurred?AuditLogsAudit operation context varies
What did a device execute?Defender XDR advanced huntingDifferent query surface and permissions
What alerts were produced?Sentinel incidents/alertsAbsence of alert is not absence of activity

Step 4 — Check coverage before hunting

Verify the relevant table exists, has recent data and covers the intended users and time range. A query returning no records could reflect a data collection gap rather than an absence of suspicious behavior.

Step 5 — KQL: inspect sign-in coverage

Sentinel Logs — SigninLogs coverage
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
SigninLogs
| where TimeGenerated >= ago(7d)
| summarize Events = count(),
            FirstSeen = min(TimeGenerated),
            LastSeen = max(TimeGenerated),
            Accounts = dcount(UserPrincipalName)
    by bin(TimeGenerated, 1d)
| order by TimeGenerated asc

Run this in the Sentinel Log Analytics workspace where SigninLogs is available. Look for missing days or sudden drops before drawing conclusions.

Step 6 — Establish a sensible baseline

Compare recent behavior with a longer, comparable period. Account for working days, maintenance windows, shift patterns and time zones. A deviation is a lead; it is not proof of malicious activity.

Step 7 — KQL: find accounts with unusual sign-in hours

Sentinel Logs — off-hours candidate hunt
  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 Lookback = 7d;
SigninLogs
| where TimeGenerated >= ago(Lookback)
| where isnotempty(UserPrincipalName)
| extend HourUTC = datetime_part("hour", TimeGenerated)
| where HourUTC between (0 .. 5)
| summarize Attempts = count(),
            DistinctIPs = dcount(IPAddress),
            FirstSeen = min(TimeGenerated),
            LastSeen = max(TimeGenerated)
    by UserPrincipalName
| where Attempts >= 3
| order by DistinctIPs desc, Attempts desc

The hours are UTC, not necessarily local business hours. The threshold is an illustrative filter; validate expected schedules and account types before interpreting results.

Step 8 — Why a hunting result is not an incident

An account appearing in the results simply met the query conditions. Check approved activity, device context, source IP ownership and sign-in outcome. Record whether the hypothesis was supported, contradicted or remained inconclusive.

Step 9 — Pivot from account to IP and application

Choose one authorized lab account and examine its IP addresses, applications, sign-in outcomes and timing. Avoid immediately expanding to the whole tenant when a narrow pivot can answer the question more safely.

Step 10 — KQL: build an account investigation timeline

Sentinel Logs — targeted sign-in timeline
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
let TargetUPN = "analyst@example.com";
SigninLogs
| where TimeGenerated >= ago(7d)
| where UserPrincipalName =~ TargetUPN
| project TimeGenerated, UserPrincipalName,
          IPAddress, AppDisplayName,
          ResultType, ConditionalAccessStatus,
          CorrelationId
| order by TimeGenerated asc
| take 200

Replace the example UPN with an approved lab account. The row cap may truncate busy accounts; note that limitation in the hunt record.

Step 11 — Enrich candidates with approved context

Review asset ownership, account purpose, documented maintenance, known VPN egress and approved identity context. Do not treat a trusted IP label as a verdict. If using threat intelligence, record its source and observation date.

Step 12 — Separate event time from ingestion time

Use TimeGenerated consistently for event-based analysis, but remember ingestion delays can affect near-real-time completeness. Document when the hunt ran and the time window examined.

Step 13 — Hunting versus detections

A hunt is an exploratory investigation. If repeated testing produces a reliable signal, consider converting it into an analytic rule after validating false positives, scheduling, entity mapping and alert fatigue. Do not promote a one-off anomaly query directly into production detection.

Step 14 — Keep a hunt notebook

AGENT FOSKETT HUNT RECORD Hypothesis: [testable statement] Alternative explanations: [list] Scope: [accounts / assets / UTC dates] Sources: [tables and workspaces] Coverage gaps: [known limits] Queries: [versions or links] Candidate observations: [facts only] Validation: [approved context checked] Assessment: [supported / not supported / inconclusive] Next pivot: [specific follow-up]

Step 15 — Avoid common analytical traps

  • Confirmation bias: seeking only evidence that supports the first suspicion.
  • Survivorship bias: inspecting only devices or accounts with full telemetry.
  • Base-rate neglect: treating rare but legitimate behavior as inherently hostile.
  • Time-zone errors: interpreting UTC as local operating time.
  • False precision: claiming “no compromise” from a bounded query.

Step 16 — Define escalation criteria

Escalate when corroborating evidence indicates material risk, such as suspicious authentication coupled with unexplained privilege changes or endpoint activity. Follow the organization’s incident process and preserve query results, identifiers and timestamps.

Step 17 — Work within permissions and privacy

Use least-privilege log access, restrict exposure of user identifiers and document why each data source is needed. Hunting is not permission to export unrestricted identity or endpoint telemetry.

Step 18 — Cost and query performance

Start with a bounded time window, filter early, summarize before joining large tables and project only needed columns. Wide, unbounded queries can increase cost and produce misleadingly incomplete results due to limits.

Step 19 — Build a repeatable hunt

Save the hypothesis, parameters, query version, source dependencies and review criteria. A useful hunt can be repeated with updated data without quietly changing the investigative question.

Agent Foskett case file — The service account after midnight

The initial query highlights several overnight sign-ins. Investigation shows most belong to approved scheduled jobs, but one account is being used with an unexpected application. Agent Foskett records the anomalous application and asks the service owner to verify the change before escalating.

Finding: the hunt did not prove compromise. It narrowed the uncertainty to a specific, testable follow-up.

Hands-on lab — your first hypothesis-driven hunt

  1. Write one suspicious sign-in hypothesis and two alternative explanations.
  2. Verify seven days of SigninLogs coverage.
  3. Run the off-hours candidate query.
  4. Select a permitted test account and build its timeline.
  5. Check whether the account behavior matches approved operations.
  6. Record evidence, gaps and a follow-up pivot.
  7. Decide whether to close the hunt, repeat it or escalate.

Knowledge check

  1. Why is a testable hypothesis better than beginning with “compromise confirmed”?
  2. What does a zero-row query actually prove?
  3. Why must UTC hours be interpreted carefully?
  4. When is a hunt ready to become an analytic rule?
  5. What evidence should accompany an escalation?

Publishing and quality checklist

  • Lesson title, Module 7 label and canonical URL correct.
  • Opening GEMXIT HTML comment retained before doctype.
  • Original background, footer, scripts and navigation preserved.
  • All three KQL editors full width with visible line numbers.
  • Queries use actual Sentinel Logs tables and bounded windows.
  • Missing telemetry and alternative explanations acknowledged.
  • Previous lesson linked; unpublished next lesson not linked.

Agent Foskett takeaway

A threat hunter does not start by proving an attacker exists. A threat hunter starts by asking a question the logs can answer. Build the hypothesis, test it fairly, document what you can and cannot know, and follow the next piece of evidence.

The Logs Already Knew.

Lesson 61 complete — your first advanced threat hunt!
You can now frame a hypothesis, validate Sentinel telemetry, run bounded KQL hunts and document defensible findings.
Sentinel Academy Home

Related Agent Foskett learning

Continue from SOC automation into proactive, hypothesis-driven investigation.