Skip to content

Fixed process container proxy log redaction - #1696

Open
Vladexy88x wants to merge 3 commits into
microsoft:mainfrom
Vladexy88x:fix/process-container-proxy-log-redaction
Open

Vladexy88x wants to merge 3 commits into
microsoft:mainfrom
Vladexy88x:fix/process-container-proxy-log-redaction

Conversation

@Vladexy88x

@Vladexy88x Vladexy88x commented Nov 6, 2026 •

Copy link
Copy Markdown

📖 Description

ProcessContainer printed the effective proxy with to_url(), so if runtimeConfig.networkProxy contained credentials (http://user:pass@host:port), the password showed up in --debug output and in the --log-file log.

This PR passes the URL through redact_proxy_url before logging it, which is what the other backends already do. Only the log line changes; the sandbox still gets the real proxy URL.

It also adds a proxy-log-redaction case to tests/scripts/run_base_container_network_tests.ps1, which scheduled ProcessContainer validation already runs on native hosts. The case sets networkProxy to http://alice:hunter2@127.0.0.1:<port> and runs with --debug and --log-file. It checks that the workload succeeds, that the log file and debug output both contain effective proxy: http://***@127.0.0.1:<port>, and that the password appears nowhere in the log, stdout, or stderr.

🔗 References

No tracking issue.

🔍 Validation

  • run_base_container_network_tests.ps1 on Windows 11 Pro 10.0.26300.9711 (native ProcessContainer), PowerShell 7.6.9: proxy-log-redaction passes with the fix. With the fix reverted it fails, and the debug output shows effective proxy: http://alice:hunter2@127.0.0.1:<port>.
  • The other proxy, loopback, and egress cases in the script pass. The existing default-deny-blocks-icmp case fails on this host only because it matches English error text, and this Windows install reports "Access denied" in Russian; the ping is blocked as expected. This PR does not change that case.

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required: bug fix, so no spec is needed
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable): tests/scripts/README.md lists the new coverage
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes: Cargo.lock is not changed

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Vladexy88x and others added 2 commits November 6, 2026 16:19
Log networkProxy with redact_proxy_url instead of to_url(), so passwords
no longer reach --debug or --log-file output. Add a wxc-exec log test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Vladexy88x
Vladexy88x requested a review from a team as a code owner November 6, 2026 13:21
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:21
@Vladexy88x Vladexy88x changed the title Fix/process container proxy log redaction Fixed process container proxy log redaction Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new test can fail ordinary Windows CI on hosts without ProcessContainer support, while the scheduled supported-host suite does not run it, leaving a regression coverage gap.

1 open issue
What changed in this PR

This PR prevents ProcessContainer proxy passwords from appearing in diagnostic logs by using the existing redaction helper, without changing the proxy URL supplied to the sandbox.

Changes:

  • Redacts credentials in the effective-proxy log message.
  • Adds a Windows integration test that checks execution reaches that message and the log contains no proxy password.
File Description
src/​tools/​wxc/​tests/​proxy_log_redaction.rs Adds an executor-level regression test for proxy password leakage.
src/​mxc-sdk/​src/​backends/​process_container/​common/​base_container_runner.rs Applies the shared proxy URL redactor before logging.

Review effort: Balanced

…suite

The wxc integration test ran in the unfiltered Windows cargo test step,
which fails on hosts without ProcessContainer support, and the scheduled
ProcessContainer validation never ran it. Move the scenario into
run_base_container_network_tests.ps1, which nightly validation already
runs on native ProcessContainer hosts. It checks that the log file and
--debug output show the redacted proxy URL and never the password.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change to redact proxy credentials from diagnostic logs.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@Vladexy88x

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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