Repository navigation
feat(run): --mask hides fetched values in the command's output - #169
Merged
Merged
Conversation
groupsky
marked this pull request as ready for review
November 11, 2026 01:50
2 tasks
This was referenced Nov 11, 2026
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.
Refs #18
Progress
nodkey run --maskreplaces every fetched value in stdout and stderr with***, also when a value is split across reads. (internal/client/mask.go,internal/client/runmask.go)mask_test.go: split at every byte, binary value cut at every place;runmask_test.go: a realshwith canaries, a value written in two writes with a pause, binary output, signal, start failure, failed output)Choices
--maskis opt-in. Without it,nodkey runstill replaces itself withexecve, as before, so nothing changes for current users.--mask, the command is a child of nodkey (os/execwith the two mask writers asStdoutandStderr). This is the leanest way:os/execalready copies the pipes and closes them when a write fails, so the command getsEPIPE.SIGTERMandSIGHUPare passed on to the command.SIGINTandSIGQUITare caught and not passed on, because the terminal already sends them to the whole process group; passing them on would send them twice.Review findings not fixed
abandbcd, outputabcdgives***cd) show the rest of the second value. Real secrets rarely overlap; this is documented in DESIGN.md section 5 and in the code.kill -INTsent to nodkey alone does not reach the command; a terminal sendsSIGINTto the whole group. Documented.