Skip to content

Add device-code-theft correlation and admin-confirmed-compromise rules - #712

Merged
bryant-smith merged 6 commits into
quadrantsec:mainfrom
bryant-smith:main
Sep 2, 2026
Merged

Add device-code-theft correlation and admin-confirmed-compromise rules#712
bryant-smith merged 6 commits into
quadrantsec:mainfrom
bryant-smith:main

Conversation

@bryant-smith

Copy link
Copy Markdown
Contributor

covers sid:9870107 (device-registration attempt following device-code refresh token theft, flexbit-correlated with 5017986) and sid:5017987 (admin-confirmed compromised account via Identity Protection)

bryant-smith and others added 6 commits September 2, 2026 10:59
9870102 requires properties.result=="success" and a DESKTOP-* hostname
pcre to catch rogue device registration -- both proved non-generalizable
across two real incidents (aarias01 2026-08-05: python-requests UA,
DESKTOP-DXV2C0PN, join blocked; ssmith02 2026-08-26: standard Dsreg UA,
AB-386-PRT, join also blocked). Neither incident's failed join would
have matched 9870102 as written.

Rather than widen 9870102's content match, add a flexbit correlation
chain that keys off session identity instead of content:

- 5017986 (azureEventHub_entra.rules): duplicates 5017933's proven
  match conditions and sets a `device_code_theft` flexbit (noalert,
  by_src on .callerIpAddress, 3600s) alongside it. 5017933 itself is
  untouched.
- 9870107 (azure-eventhub-ad.rules, [EXPERIMENTAL] pending field
  validation): fires on any "Register device" op -- regardless of
  result or hostname -- gated on that flexbit. 9870102 itself is
  untouched.

Both new rules validated via `sagan -T` against the compiled engine
binary (~/github/sagan/src/sagan) -- clean load, zero errors.

Not yet done: live fire-through replay of the flexbit chain against
the aarias01/ssmith02 telemetry (needs Redis for flexbit persistence).

Ref: QIS-508, ~/sc-engine/logs/bg_compromise/{aarias01,ssmith02}-device-code-attack-report.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8Sa2QJf612vG3DttWE4uT
…lation

Add flexbit-correlated device-join detection for device-code token theft
Detects ConfirmAccountCompromised in Entra AuditLogs. No IP field exists
on this event type, so no parse_src_ip/threshold-by-IP is applicable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8Sa2QJf612vG3DttWE4uT
…ed-rule

Add rule for admin-confirmed compromised account via Identity Protection
…g fix

Brings in c2d2e45 (by_dst->by_src/1hr->1day fix for sid:9870000, and the
xbits->flexbits noalert fix for sid:9870007/5017969) that landed upstream
independently of this fork, ahead of local main.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8Sa2QJf612vG3DttWE4uT
@bryant-smith
bryant-smith merged commit 27f7c0f into quadrantsec:main Sep 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant