Skip to content

fix: Windows guard install, and lead every response path with rotation - #32

Merged
AviOfLagos merged 1 commit into
mainfrom
fix/windows-guard
Aug 29, 2026
Merged

fix: Windows guard install, and lead every response path with rotation#32
AviOfLagos merged 1 commit into
mainfrom
fix/windows-guard

Conversation

@AviOfLagos

Copy link
Copy Markdown
Owner

A Windows user hit could not create the scheduled task with no further detail, having just found ~15 infected repositories.

guard install on Windows

schtasks.exe is a Windows program and needs a Windows path for the executable it runs — it was being handed an MSYS path like /usr/bin/bash. Worse, every error was discarded (>/dev/null 2>&1), so the user saw a bare failure with nothing to act on.

Now: converts the path with cygpath, sets MSYS_NO_PATHCONV so /TN isn't rewritten as a path, and prints the actual schtasks error. On failure it falls back to a Startup-folder entry (no admin rights), and failing that explains how to run the guard by hand.

notify templates led with the wrong step

Both templates said "re-clone" first and mentioned rotation second. Credentials are the objective — rotation is first, npm write tokens ahead of everything, and checking your own machine comes before cleaning any repo, since cleaning first just lets an infected machine re-inject. The mail template now carries the full list including the clipboard, and warns about the Actions workflow that keeps exfiltrating after the dropper is gone.

docs: incident-response walkthrough

New "If you're infected" section, placed before the command reference because that's the state people arrive in. Rotate → clean the machine → repos → tell people, with the reasoning for the order.

It also answers what this user's output raised: guard scan saying "clean" while repos are infected is expected, not a contradiction — the loader runs when a build runs or an editor opens the folder, then exits.

A Windows user hit "could not create the scheduled task" with no further
detail, having just found roughly fifteen infected repositories.

guard install on Windows
  schtasks.exe is a Windows program and needs a Windows path for the executable
  it runs. It was being handed an MSYS path such as /usr/bin/bash, which cannot
  work. Worse, every error was discarded with 2>&1 >/dev/null, so the user saw
  a bare failure with nothing to act on and no way to report it usefully.

  It now converts the bash path with cygpath, sets MSYS_NO_PATHCONV so the /TN
  flags are not rewritten as paths, and PRINTS the actual schtasks error when
  it still fails. On failure it falls back to a Startup-folder entry, which
  needs no administrator rights, and if that is unavailable it explains how to
  run the guard by hand rather than leaving the user stuck.

notify templates led with the wrong step
  Both the issue and the mail template said "delete your clone and re-clone"
  first and mentioned rotation second. Credentials are this family's objective,
  so rotation is first, npm write tokens ahead of everything else, and checking
  your own machine comes before cleaning any repository — cleaning first simply
  lets an infected machine re-inject.

  The mail template now spells out the full rotation list, including the
  clipboard, and warns about the Actions workflow that keeps exfiltrating
  secrets after the dropper is gone.

docs: an incident-response walkthrough
  A new "If you're infected" section, placed before the command reference
  because that is the state someone arrives in. Rotate, clean the machine, then
  the repositories, then tell people — with the reasoning for the order rather
  than just the order.

  It also answers the question this user's output raised: `guard scan` reporting
  "clean" while repositories are infected is the expected result, not a
  contradiction. The loader runs when a build runs or an editor opens the
  folder, then exits.
@AviOfLagos
AviOfLagos merged commit 56df09b into main Aug 29, 2026
2 checks passed
@AviOfLagos
AviOfLagos deleted the fix/windows-guard branch August 29, 2026 09:47
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.

2 participants