Repository navigation
Conversation
scrubCommand redacts a credential by the name it is passed under, and the list of names had no PASSPHRASE. So `gpg --passphrase secret`, `BORG_PASSPHRASE=secret` and `PASSPHRASE=secret` were kept in clear in Action Recording and in the copy exported to a telemetry collector. Add PASSPHRASE to SECRET_NAME. The JSON key, NAME=value and flag rules all read that list. `--passphrase-fd 0` and `--passphrase-file` are unchanged.
cpruijsen
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 12, 2026 21:16
# Conflicts: # CHANGELOG.md
Author
|
Closing: #1530 removed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
scrubCommandinserver/src/telemetry/scrub.tsremoves credentials from a Bot's shell command before Action Recording keeps it and before the OTLP export sends it. Three of its rules find a credential by the name it is passed under, from theSECRET_NAMElist. That list had no PASSPHRASE, so these commands kept the passphrase in clear:gpg --batch --yes --passphrase hunter2 --decrypt secrets.txt.gpgBORG_PASSPHRASE=hunter2 borg create /mnt/backup::today ~/docsPASSPHRASE=hunter2 duplicity /home/me file:///mnt/backupMAVEN_GPG_PASSPHRASE=hunter2 mvn deployI added PASSPHRASE to
SECRET_NAME, so the JSON key,NAME=valueand--name valuerules now redact a passphrase.--passphrase-fd 0and--passphrase-file pw.txtdo not change. LikePASSWORD_FILE=today, an assignment to a longer name that contains PASSPHRASE is also redacted, for examplePASSPHRASE_FILE=pw.txtandBORG_PASSPHRASE_FD=3.I kept this to PASSPHRASE, the name these tools use. PASSCODE, which
shared/recorder-masking.tsandserver/src/approvals/policy.tsalso list, is one more word in the same list if you want it.I did not open an issue first. The README asks for an issue or coordination before substantial work, and this change is one word in one list.
Where it runs
scrubCommandis a pure function of the command it gets.Boundary and audit
Changelog
Unreleased, in Smaller changes.Proof
Action Recording rows for a Bot's computer, on PostgreSQL 17 with pgvector:
scrubCommand: the four above,GPG_PASSPHRASE=,gpg --passphrase=and a JSON body. I checked the Action Recording rows for a Bot's computer, the rows forhost/run_commandand the request bodies at a local OTLP/HTTP collector. Onmain, all 7 secrets reached all three. With this change, none did.bun test server/tests/enterprise-controls.test.ts: 57 pass. Withscrub.tsfrommainand the new rows kept: 54 pass, 3 fail, which are the gpg,BORG_PASSPHRASEand JSON rows. The--passphrase-fd 0row passes on both.bun test server/tests/otel-export-scrubbing.test.ts, which now also exports a gpg passphrase command to its collector: 1 pass. Withscrub.tsfrommainit fails, and the passphrase is in the request body.bun run format:check,bun run lint,bun run typecheck,bun run typecheck:testsandbun run buildexit 0.bun test server/with PostgreSQL 17: 8,161 pass, 26 skip, 6 fail. The 6 fail the same way onmainin that container, which cannot start a computer for them ("The computer did not start.").