Skip to content

Log watchdog integrity failures and drift to the event log - #49

Merged
BiosSystem merged 1 commit into
masterfrom
feature/watchdog-event-log
Sep 17, 2026
Merged

BiosSystem merged 1 commit into
masterfrom
feature/watchdog-event-log

Conversation

@BiosSystem

Copy link
Copy Markdown
Owner

What

The watchdog logged only to %ProgramData%\Winnow\watchdog.log, a text file a local attacker on the box can also edit and that nothing collects centrally. For a control that runs as SYSTEM and fails closed on tampering, the tamper signal is exactly what you want auditable off-box.

  • Installer registers a Winnow event source in the Application log (admin, already held; warns and continues if it can't).
  • The payload mirrors its security-relevant lines to the event log: integrity failure as Error (event 2000), corrected drift as Warning (event 1000).
  • Write-WinnowWatchdogEvent is guarded on the source existing (Test-WinnowWatchdogEventSource) and never throws; a missing source falls back to the text log alone. The text log still records everything, including intact runs.

Validation

  • Tests\Invoke-StaticValidation.ps1 -RequirePSScriptAnalyzer clean (120 files).
  • Tests/Unit/Test-UpdateWatchdog.ps1 (Pester 5.7.1): 16/16 pass (adds source-present writes-once and source-missing stays-silent/no-throw).

Not verified here (needs a live SYSTEM run against a real update): the actual event entries landing in the Application log. Docs (docs/Telemetry-And-Privacy.md) and CHANGELOG [Unreleased] updated.

The watchdog only wrote to a text file in %ProgramData%\Winnow, which a
local attacker with access to that box can also edit, and which nothing
collects centrally. For a control that runs as SYSTEM and fails closed on
tampering, the tamper signal is the thing you most want auditable.

Register a Winnow event source in the Application log at install and have
the payload mirror its security-relevant lines there: an integrity failure
as an Error (event 2000) and a corrected drift as a Warning (event 1000).
Writing is guarded on the source existing and never throws, so a missing
source just falls back to the text log.

Added event-source-present and event-source-missing cases to the tests.
@BiosSystem
BiosSystem merged commit 9605ce4 into master Sep 17, 2026
1 check passed
@BiosSystem
BiosSystem deleted the feature/watchdog-event-log branch September 17, 2026 05:36
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