Skip to content

fix(e2e): redact password values from test execution logs - #2042

Merged
TerryHowe merged 3 commits into
oras-project:mainfrom
TerryHowe:fix/clear-text-logging-password
May 5, 2026
Merged

TerryHowe merged 3 commits into
oras-project:mainfrom
TerryHowe:fix/clear-text-logging-password

Conversation

@TerryHowe

Copy link
Copy Markdown
Member

Summary

  • Passwords passed via --password, --from-password, or --to-password flags were logged in plain text in test output via fmt.Println(description) and ginkgo.By(description)
  • Added a redactArgs helper that replaces the value following any --*password* flag with *** before building the log description
  • Fixes CodeQL alert: clear-text logging of sensitive information (CWE-312)

Fixes: https://github.com/oras-project/oras/security/code-scanning/8

Test plan

  • Verify e2e tests still pass with the redaction in place
  • Confirm test output no longer contains plain-text passwords in the >> should ... >> lines

🤖 Generated with Claude Code

@codecov

codecov Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.25%. Comparing base (625105a) to head (8646ba1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2042      +/-   ##
==========================================
+ Coverage   87.18%   87.25%   +0.07%     
==========================================
  Files         138      138              
  Lines        5462     5462              
==========================================
+ Hits         4762     4766       +4     
+ Misses        419      415       -4     
  Partials      281      281              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Passwords passed via --password, --from-password, or --to-password
flags were logged in plain text in test output. Redact those values
before building the description string to avoid clear-text logging
of sensitive information (CWE-312).

Fixes: https://github.com/oras-project/oras/security/code-scanning/8
Signed-off-by: Terry Howe <[email protected]>
@TerryHowe
TerryHowe force-pushed the fix/clear-text-logging-password branch 2 times, most recently from 2369ab0 to b72807f Compare April 27, 2026 22:01
@TerryHowe
TerryHowe merged commit 0cde57c into oras-project:main May 5, 2026
9 checks passed
@TerryHowe
TerryHowe deleted the fix/clear-text-logging-password branch May 5, 2026 11:58
TerryHowe added a commit to TerryHowe/oras that referenced this pull request Jun 28, 2026
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.

2 participants