Skip to content

Mask credentials in plugin tool logging#579

Open
bschwedler wants to merge 1 commit into
mainfrom
credential-handling
Open

Mask credentials in plugin tool logging#579
bschwedler wants to merge 1 commit into
mainfrom
credential-handling

Conversation

@bschwedler

Copy link
Copy Markdown
Contributor

Secret values (wizcli client secret, GH_TOKEN) were appearing unredacted in process listings, log output, and error metadata.

Add SensitiveArg to util.py to wrap secrets passed as CLI flags so
they render as *** in logs and error output while preserving the real
value for subprocess execution. Add display_command() and exec_args()
as helpers to use alongside it.

Apply throughout the plugin layer:

- wizcli: wrap client_secret in SensitiveArg; use exec_args() when
  invoking subprocess so the real value is passed to the process
- dgoss: move GH_TOKEN forwarding from image_environment (where the
  value was embedded as -e GH_TOKEN=VALUE in the command line) to
  dgoss_environment (subprocess env), passed via -e GH_TOKEN
  (name-only) so the value never appears in logs or error metadata.
  Add redacted_dgoss_environment for safe logging. Add
  container_passthrough_env_vars for the name-only -e entries.
- hadolint, oras: use display_command() for log output

Update error __str__ methods to call str(x) per item so SensitiveArg
values in cmd lists render as *** rather than raising TypeError.
@bschwedler bschwedler requested a review from ianpittwood as a code owner June 9, 2026 18:22
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Test Results

1 652 tests  +18   1 652 ✅ +18   8m 35s ⏱️ +32s
    1 suites ± 0       0 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit 137bdca. ± Comparison against base commit 6bc441c.

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.

1 participant