Back to projects

Detection engineering

Detection-as-code pipeline

Built a Sigma pipeline that tests, validates, and converts detection rules to KQL for Sentinel and Defender before anything merges.

Year

2026

My role

Author and maintainer.

Tools & technologies

Sigma · KQL · MITRE ATT&CK · GitHub Actions · Sentinel · Defender

Outcome

Five detections mapped to MITRE ATT&CK. Four are Sigma rules in the pipeline: password spray (T1110.003), brute force (T1110.001), malicious inbox rules (T1098.002, T1114.003), and OAuth consent grant abuse (T1528). The fifth, impossible travel (T1078), is a KQL query in the companion catalog.

The problem

Detection logic written as one-off SIEM queries is unreviewable and quietly rots. It needed to live in version control with the same gates as application code.

What I built and owned

Detection validation workflow
Sigma rulesVersioned in Git
GitHub ActionsTest, validate & convert
KQL outputDetection queries
Sentinel
Defender

Runs on every pull request that changes a rule, the pipeline, or the tests, and on every push to main.

Review. Validate. Convert.

Every pull request that touches a rule, the pipeline, or the tests, and every push to main, runs four gates in GitHub Actions: rule requirement tests in pytest, Sigma syntax validation, conversion to KQL through a pipeline that maps each log source to its Sentinel table, and an uploaded query artifact for review.

One detection, two forms

The same password-spray detection for T1110.003, written twice. The Sigma rule is the portable source that CI validates and converts; it matches the failed sign-ins and is still marked experimental. The catalog query is the Sentinel version: it adds the ten-account threshold, ships with its own validation steps, and is marked stable in the catalog.

Sigma ruledetection-as-code/rules/credential-access/password-spray.yml (opens on GitHub in a new tab)
title: Azure AD Password Spray From Single Source
id: 7f1c2e90-3b4a-4d77-9b21-2c6f5a8e1d44
status: experimental
description: >
  Detects a single source address failing authentication across many
  distinct accounts in a short window, the signature of a password spray.
references:
  - https://attack.mitre.org/techniques/T1110/003/
author: Edward Griggs
date: 2026/06/23
logsource:
  product: azure
  service: signinlogs
detection:
  selection:
    ResultType:
      - '50126'   # invalid username or password
      - '50053'   # account locked
  condition: selection
  timeframe: 30m
fields:
  - IPAddress
  - UserPrincipalName
  - ResultType
falsepositives:
  - Shared corporate egress IP behind NAT
  - Applications replaying stale credentials
level: high
tags:
  - attack.credential-access
  - attack.t1110.003
Sentinel KQLdetection-engineering/detections/T1110.003-password-spray/detection.kql (opens on GitHub in a new tab)
// T1110.003 - Password Spray Detection
// Surfaces a single source failing authentication across many distinct
// accounts inside a short window, the signature of a low-and-slow spray.
//
// Tactic:    Credential Access
// Technique: T1110.003 (Password Spraying)
// Source:    SigninLogs (Microsoft Entra ID)

let lookback = 1h;
let sprayWindow = 30m;
let accountThreshold = 10;     // distinct accounts targeted from one source
SigninLogs
| where TimeGenerated > ago(lookback)
| where ResultType in (
    "50126",   // invalid username or password
    "50053",   // account locked from repeated failures
    "50055"    // expired password presented
  )
| summarize
    FailedAttempts   = count(),
    TargetedAccounts = dcount(UserPrincipalName),
    AccountList      = make_set(UserPrincipalName, 100),
    ResultCodes      = make_set(ResultType)
    by IPAddress, bin(TimeGenerated, sprayWindow)
| where TargetedAccounts >= accountThreshold
| project TimeGenerated, IPAddress, TargetedAccounts, FailedAttempts, AccountList, ResultCodes
| order by TargetedAccounts desc

ATT&CK coverage

Five detections across the two repositories, four of them as Sigma rules. Status is the KQL catalog status from each detection’s metadata, so work still in tuning is labeled as such.

Explore the work

Detection-as-code pipeline source (opens in a new tab)Detection catalog source (opens in a new tab)Validation lab (Sentinel and Wazuh) (opens in a new tab)
All projectsNext: FlightSentry: context-aware alert triage

Let’s connect.

Remote, hybrid, or in office · Open to relocation