Skip to content
Documentation

Windows sensors

This page is published from the agent repository. Edit on GitHub View source

The Windows agent collects telemetry through four independent sources. Each one is its own crate under crates/sensors/windows, depends only on schema, and compiles to an empty stub on other operating systems, so cargo check --workspace works on every host.

SourceCrate (package)MechanismRolePage
ETWetw/ (sensor-windows)One real-time ETW session, 14 providersPrimary: process, image, file, network, DNS, registry, script, WMI, LDAP, NTLM, BITS, cross-processetw.md, etw-enrichment.md
Event Logeventlog/ (sensor-windows-eventlog)EvtQuery polling (default) or EvtSubscribeSupplementary: logons, service/task/account persistence, AppLocker, WDAC, Defender, RDP sessions, log clears, Kerberoseventlog.md
Socket tablesockets/ (sensor-windows-sockets)GetExtendedTcpTable / GetExtendedUdpTable snapshotsSupplementary: listening ports for the LISTENER-DRIFT rulesockets.md
Minifilterminifilter/ (sensor-windows-minifilter) + driver/minifilter (C)Filter Manager communication portOptional: file deletes, renames, timestamp changes, raw volume opensminifilter.md

How the agent runs them

All four are started by run_windows_sensors and write into one shared sink (wrapped in the command-line credential redactor). ETW is the primary sensor and runs on the calling thread. The other three run on background threads.

flowchart LR
    subgraph agent["agent run (run_windows_sensors)"]
        ETW["WindowsSensor::run<br/>(calling thread)"]
        EL["EventLogSensor::run<br/>(thread + 1 thread per poll target)"]
        SOCK["socket-poller thread<br/>(10 s)"]
        MF["minifilter thread<br/>(channel::run)"]
    end
    ETW -->|PulsingSink| SINK[(shared EventSink<br/>+ redaction)]
    EL --> SINK
    SOCK --> SINK
    MF --> SINK
    SINK --> PIPE[detection pipeline]

Startup order and failure handling:

  • Silence heartbeats are registered before ETW starts (register_heartbeats), so an ETW session that never starts becomes a silence alert instead of nothing.
  • An ETW failure does not end the run. hold_after_primary logs the error, prints a hint (not elevated? for a refused start, or "stopped or blinded from outside" when the error comes from the in-sensor liveness check, see etw_failure_hint), and keeps the thread parked until Ctrl-C so the Event Log, socket and minifilter sources keep running.
  • Failures of the supplementary sources are logged and never fatal.
  • Ctrl-C sets the ETW stop flag, the Event Log stop flag and a shared shutdown flag, which also stops the socket poller and the minifilter thread.

Silence monitoring

Each source has a heartbeat registered on the agent's SilenceMonitor (a silence raises a T1562-style alert). They pulse on different things, so the deadlines differ:

HeartbeatPulsed byDeadlineConstant
windows-etwevery event the ETW sensor forwards (PulsingSink)120 sETW_SILENCE_DEADLINE_NS
windows-eventlog:<target>every successful poll tick of that target (one per enabled target)60 sEVENTLOG_SILENCE_DEADLINE_NS
windows-socketsevery successful snapshot30 s (3 polls)SOCKET_SILENCE_DEADLINE_NS
windows-minifilterevery driver message, idle heartbeats included30 sMINIFILTER_SILENCE_DEADLINE_NS

The ETW sensor also has its own 30 s in-process canary that fails the trace (see ETW liveness). The Event Log Subscribe transport exposes no liveness counters, so it is not watched (see eventlog.md). The minifilter heartbeat is only registered when the driver is loaded at startup.

Shared conventions

  • Paths. NT device paths (\Device\HarddiskVolume3\...) are rewritten to drive-letter form through a live QueryDosDeviceW map. The ETW sensor (normalize_nt_path) and the minifilter client (VolumeMap) each carry a copy, because sensor crates may not depend on each other. Unknown devices keep the raw path rather than a guessed drive.
  • Byte parsers are hostile-input code. Anything that reads attacker-influenced bytes (Zone.Identifier streams, BITS URLs, Event Log XML, minifilter messages) lives in a platform-independent module with unit tests on every CI leg and a never-panic robustness suite.
  • Bounded and counted. Every in-memory map has a cap, and anything dropped or forgotten at the cap is counted and logged at power-of-two intervals.
  • Container attribution is filled only by the ETW sensor. Event Log, socket and minifilter events carry container: None.

Platform requirements

SourceNeeds
ETWAdministrator (kernel providers). ProcessMembershipInformation (Windows 11 22H2 / Server 2025) for container attribution.
Event LogAdministrator to read Security and run auditpol. Some channels are off by default (Task Scheduler Operational, Kerberos Operational).
Socket tableNothing: the IP Helper tables are readable by everyone.
MinifilterThe test-signed SynthaeaFilter driver loaded, and the agent running as the SynthaEDR service (its service SID is checked by the driver).