Skip to content

Add -VerifyWatchdog to report watchdog health - #48

Merged
BiosSystem merged 1 commit into
masterfrom
feature/watchdog-health-readout
Sep 17, 2026
Merged

BiosSystem merged 1 commit into
masterfrom
feature/watchdog-health-readout

Conversation

@BiosSystem

Copy link
Copy Markdown
Owner

What

The hardened watchdog (#47) fails closed: a payload that no longer matches its recorded hash refuses to run and only writes to its log. Correct, but silent, so a tampered or half-installed watchdog is indistinguishable from a healthy one without inspecting the box.

Adds a read-only -VerifyWatchdog mode:

  • Get-WinnowWatchdogHealth returns a state object: task registered, payload present, integrity OK (current SHA256 vs the hash recorded in the admin-only HKLM key), directory still locked down (ACL protected + no user write), schema version, install time, and last run time/result.
  • Show-WinnowWatchdogHealth prints it.
  • Winnow.ps1 -VerifyWatchdog exits 0 when healthy and 2 when degraded or not installed, matching the existing -Verify codes, so it drops into a scheduled check or monitoring script.

Read-only: touches no state, needs no mutation.

Validation

  • Tests\Invoke-StaticValidation.ps1 -RequirePSScriptAnalyzer clean (120 files).
  • Tests/Unit/Test-UpdateWatchdog.ps1 (Pester 5.7.1): 14/14 pass (adds healthy, hash-mismatch, not-installed cases with mocked scheduler/registry/ACL cmdlets).
  • Smoke-tested Show-WinnowWatchdogHealth on a machine with no watchdog installed: prints the NotInstalled path and returns Healthy=False.

Docs: README verification section, docs/Telemetry-And-Privacy.md, and CHANGELOG [Unreleased] updated.

The hardened watchdog fails closed: if its payload no longer matches the
hash recorded at install, it refuses to run and only writes a line to its
log. That is the right behaviour but it is silent, so a tampered or
half-installed watchdog looks the same as a healthy one from outside.

Add a read-only -VerifyWatchdog mode that reports whether the task is
registered, whether the payload still matches its recorded hash, whether
the directory is still locked down, and when it last ran. Exits 0 when
healthy and 2 when degraded or not installed, matching the -Verify codes,
so it fits a scheduled check. Get-WinnowWatchdogHealth returns the state
object and Show-WinnowWatchdogHealth prints it.

Extended Test-UpdateWatchdog.ps1 with healthy, hash-mismatch, and
not-installed cases.
@BiosSystem
BiosSystem merged commit 0405132 into master Sep 17, 2026
1 check passed
@BiosSystem
BiosSystem deleted the feature/watchdog-health-readout branch September 17, 2026 05:32
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