Skip to content

Filter secret values out of the command's output #18

Closed

Description

@groupsky

Why

Version 1 passes the value into the command's environment, but the command may still print it, and the agent then sees it (T15).

Done when

  • nodkey run --mask replaces every fetched value in stdout and stderr with ***, also when a value is split across reads.
  • Tests with canary values, binary output and a value split across chunks.

Activity

  1. added this to the later milestone on Oct 12, 2026
  2. groupsky commented on Nov 11, 2026

    @groupsky
    ContributorAuthor

    Done in #169 (squash commit 4444bef).

    • nodkey run --mask replaces every fetched value in stdout and stderr with ***, also when a value is split across reads: internal/client/mask.go (streaming mask writer that holds back only a possible start of a value), internal/client/runmask.go (the command runs as a child; stdout and stderr go through the mask). Documented in DESIGN.md sections 3, 5, 15 and 16, THREAT-MODEL.md T15, and docs/setup.md.
    • Tests with canary values, binary output and a value split across chunks: internal/client/mask_test.go (TestMaskWriter: canaries, a value split byte by byte and in two; TestMaskWriterBinary: a binary value in binary output, cut at every place), internal/client/runmask_test.go (TestMaskedCommand: canaries through a real sh; TestMaskedCommandSplit: a value written in two writes with a pause; TestMaskedCommandBinary; plus signal, left-behind process, closed output and start failure). CI green on PR feat(run): --mask hides fetched values in the command's output #169.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions