Skip to content

fix(installer): stop leaking user PII + tracebloc internals in logs/output (#576) - #579

Merged
shujaatTracebloc merged 5 commits into
developfrom
fix/576-log-hygiene
Aug 4, 2026
Merged

fix(installer): stop leaking user PII + tracebloc internals in logs/output (#576)#579
shujaatTracebloc merged 5 commits into
developfrom
fix/576-log-hygiene

Conversation

@shujaatTracebloc

@shujaatTraceblocshujaatTracebloc commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes#576.

Problem

A client's shared install log leaked both her identity and our internals:

  • User PII:Username: <redacted>, RunAs, Machine: <redacted>, host path, PID — from PowerShell's Start-Transcript header.
  • tracebloc internals: the installer's own source line (& $cosign @cosignArgs, At line:360 char:5), variable names, and internal codes (RFC-0001 R8, manifest.sha256) — from PowerShell rendering an unhandled native-command error.

What changed

Main installer (install-k8s.ps1) — the install-*.log users forward to support:

  • Removed Start-Transcript. Its fixed header is the PII, and it also captured PowerShell's raw error rendering into the log. The shareable log is now written only through the curated Log() writer, with a PII-free header.
  • Routed the message helpers (Info/Ok/Warn/Err/Step/PromptHeader/Hint) through Log() so the log stays useful without the transcript — it mirrors the curated on-screen output. No user PII, no internals, by construction. Removed the Stop-Transcript calls.

Bootstrap (install.ps1) — the console a user (or a support-requested transcript) sees:

  • Capture cosign's output (2>&1 | Out-Null under $ErrorActionPreference='Continue') instead of letting a native-stderr NativeCommandError dump this script's source line + internal identifiers. Only a curated message is shown.
  • Sanitized the verification-failure messages to plain language ("Couldn't confirm the installer download is authentic…") — no RFC-0001 R8 / manifest.sha256 / raw $_.

Bash (common.sh) — dropped the username from the HOST_DATASET_DIR "not writable" error (kept the uid number).

Tests

  • install-k8s.Tests.ps1+2: no Start-Transcript/Stop-Transcript; helpers feed the curated log and the transcript identity header can't appear.
  • install.Tests.ps1+3: cosign output is captured (no raw & $cosign … 2>$null 1>$null), messages carry no internal codes, still fails closed.
  • Both Pester suites green (418 passed / 0 failed / 9 skipped). manifest.sha256 regenerated; check-facts --check green.

Scope

Part of the installer-robustness set: #576 (this) · #577 · #578.


Note

Low Risk
Logging and user-facing error text only; verification still aborts on cosign failure with no change to install security behavior.

Overview
Install logs and console output are curated for support sharing so they no longer expose Windows identity (transcript headers) or installer internals (source lines, RFC codes, manifest names).

install-k8s.ps1: Drops Start-Transcript / Stop-Transcript in favor of a PII-free header and Log()-only writes. Info / Ok / Warn / Err / Step / Hint / preflight failures / summary branches now mirror on-screen messages into the log, including Final client state on every outcome.

install.ps1 & install.sh: Cosign verification stderr is captured so native errors do not dump script source; success/failure text is plain language (still fail-closed). common.sh drops the username from one HOST_DATASET_DIR error.

Tests and manifest.sha256 updated for the new messages and logging behavior.

Reviewed by Cursor Bugbot for commit a2a9c87. Bugbot is set up for automated code reviews on this repo. Configure here.

@shujaatTraceblocshujaatTracebloc self-assigned this Aug 4, 2026
@shujaatTracebloc
shujaatTracebloc marked this pull request as ready for review August 4, 2026 08:10
Comment threadscripts/install-k8s.ps1
…utput (#576)
Root-caused from a client's shared install log, which exposed both her identity
(Username/RunAs/Machine — the PowerShell transcript header) and our internals
(the `& $cosign @cosignArgs` source line + internal codes) when cosign errored.
Main installer (install-k8s.ps1):
- Drop Start-Transcript entirely — its fixed header IS the PII, and it also
captured PowerShell's raw error rendering (source lines, internal identifiers)
into the log. The shareable install-*.log is now written only via the curated
Log() writer, with a PII-free header.
- Route the message helpers (Info/Ok/Warn/Err/Step/PromptHeader/Hint) through
Log() so the log stays useful without the transcript — it mirrors the curated
on-screen output: no user PII, no tracebloc internals. Drop the Stop-Transcript
calls.
Bootstrap (install.ps1):
- Capture cosign's output (2>&1 | Out-Null under EAP=Continue) instead of letting
a native-stderr NativeCommandError dump THIS script's source line + internal
identifiers to the console / any user transcript. Sanitize the verification-
failure messages to plain language (no RFC-0001 R8 / manifest.sha256 / $_).
Bash (common.sh): drop the username from the HOST_DATASET_DIR "not writable"
error (keep the uid number).
Tests: +2 Pester (main: no transcript; helpers feed the curated log) and +3
Pester (bootstrap: cosign output captured, messages carry no internal codes,
still fails closed). Both suites green (418/0/9). Manifest regenerated.
Scope: the top-level error boundary that stops PowerShell rendering ANY unhandled
throw raw is #577; a broader sweep of internal identifiers out of all remaining
messages continues under #576.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment threadscripts/install-k8s.ps1
… (Bugbot #579)
Removing Start-Transcript (for #576) left Write-PfFail and a few summary failure
headlines screen-only, so a forwarded install-*.log no longer showed the actual
failing preflight checks (disk/virt/storage/connectivity/memory) — only the
generic Err summary + hints. Route Write-PfFail and the bad_creds / image_pull_ca
/ diagnostics-archive failure headlines through Log().
+1 Pester (Write-PfFail reaches the log). Manifest regenerated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 95d782e. Configure here.

Comment threadscripts/install-k8s.ps1
…ch (Bugbot #579)
The default Print-Summary branch (image_pull / crash / other non-ready) still
printed its failure headline via Write-Host only, so those outcomes missed the
curated log after the Start-Transcript removal — while bad_creds / image_pull_ca
were routed. Add a central `Log "Final client state: <state>"` before the switch
so EVERY branch is covered, and route the default headline too.
+1 Pester (Print-Summary records the final state). Manifest regenerated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment threadscripts/install.ps1
saadqbal
saadqbal previously approved these changes Aug 4, 2026

@saadqbalsaadqbal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, careful PR — integrity chain verified (manifest hashes match the branch files), cosign stays fail-closed, and the e2e smoke assert still lands because Creating k3d cluster goes through Log(). 👍

One parity note (below). The couple of nits I found are all cosmetic.

…view parity)
Reviewer (saadqbal) on #579: install.ps1's cosign message was sanitized but the
bash bootstrap still printed 'cosign signature verification FAILED for
manifest.sha256 — refusing to install', leaking the same internals. Match the
PowerShell wording: 'Couldn't confirm the installer download is authentic, so the
install stopped before changing anything on your machine.' Same for the success
line ('Download verified as published by tracebloc').
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…view)
install.sh's cosign-failure message was sanitized in 2aa35db (reviewer parity),
so install-bootstrap.bats's 'cosign signature failure aborts' test — which pinned
the old 'signature verification FAILED' string — must expect the new plain
wording. Behaviour coverage (aborts + never degrades to a same-channel sha256)
is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shujaatTracebloc
shujaatTracebloc merged commit afc2c4f into developAug 4, 2026
70 of 71 checks passed
@shujaatTracebloc
shujaatTracebloc deleted the fix/576-log-hygiene branch August 4, 2026 11:39
shujaatTracebloc added a commit that referenced this pull request Aug 5, 2026
…rap messages (#581) (#602)
* refactor(installer): scrub remaining internal identifiers from bootstrap messages (#581)
Follow-up from the #576/#579 review (saadqbal). The cosign verification-failure message
was sanitized in #579; this sweeps the remaining lower-signal internal identifiers still
in user-facing bootstrap messages — the `manifest.sha256` release-asset filename and the
`RFC-0001 R8` internal spec code — to plain language, for consistency. No behaviour
change: fail-closed paths, verification logic, and exit codes are untouched; only the
wording of echo/throw/Warn strings changes.
- install.sh: "manifest.sha256" -> "the installer's integrity checksums" / "signed
checksum list"; ".sig/.cert not published" / "authenticate the manifest" ->
"the installer's signature isn't published" / "confirm the download is authentic".
- install.ps1: same wording, plus `(RFC-0001 R8)` removed from every throw
(Resolve-InstallRef, Confirm-ManifestSignature, Confirm-ScriptIntegrity, the temp-dir
guard). RFC-0001 stays in code COMMENTS (not user-facing) and the actual
manifest.sha256 file paths/URLs are untouched.
- Tests: updated the two pinned assertions (install-bootstrap.bats + install.Tests.ps1)
from "no entry in manifest" to "isn't in the installer's signed checksum list".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(#581): scrub the PS AllowUnverified warn too (Bugbot)
The unverified-opt-in warn on the sig/cert path still said "manifest signature/cert
not published" while the bash warn and the PS throw on the same path were already
updated to "The installer's signature isn't published". My grep keyed on
"manifest.sha256", so this "manifest signature/cert" variant slipped through. Aligned
it with the rest. (The generic word "manifest" in the cosign-unavailable messages is
descriptive supply-chain English, not the filename/spec-code #581 scopes, so it stays.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(installer): align cosign-unavailable messages to #576 vocabulary
Address saadqbal's consistency nit on #602: the two cosign-unavailable
strings still said "signed manifest" / "manifest signature" while the
sibling sig-not-published messages just below now say "the installer's
signature". Align both the WARN (AllowUnverified) and the fail-closed
throw/echo in install.ps1 and install.sh, and update the matching
install-bootstrap.bats assertion.
No behaviour change: only wording of the echo/throw/Warn strings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for freeto 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.

Installer must never expose tracebloc internals or user PII in logs/output

3 participants

@shujaatTracebloc@saadqbal@LukasWodka