Skip to content

Support watching child process traffic - #1877

Open
waldekmastykarz wants to merge 3 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-investigate-issue-1800
Open

waldekmastykarz wants to merge 3 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-investigate-issue-1800

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

Summary

  • add opt-in --watch-process-tree / watchProcessTree support
  • match connection owners against configured PID or process-name ancestors
  • cache decisions by PID and process start time to avoid PID-reuse errors
  • resolve process ancestry on Windows and Unix-like systems
  • update the v4 schema, configuration reference, and tests

Closes #1800

Validation

  • dotnet build DevProxy/DevProxy.csproj
  • dotnet test DevProxy.Proxy.Kestrel.Tests/DevProxy.Proxy.Kestrel.Tests.csproj --no-restore
  • dotnet test DevProxy.Tests/DevProxy.Tests.csproj
  • detached proxy smoke test with --watch-process-tree

Add opt-in process-tree filtering that walks ancestor processes and caches decisions by PID and process start time.

Closes dotnet#1800

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 12:21
@waldekmastykarz
waldekmastykarz requested a review from a team as a code owner September 21, 2026 12:21

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.

Copilot review overview

🔵 Needs a closer look

Address process-handle disposal and Windows PID-reuse ancestry validation issues.

Review effort: Lite
Findings: None

What changed in this PR

Adds opt-in process-tree traffic watching with cross-platform ancestry resolution and PID/start-time caching.

Changes:

  • Adds watchProcessTree configuration and --watch-process-tree.
  • Updates runtime filtering, schema, documentation, and tests.
  • Extends configuration contracts and test fakes.
File Reviewed changes
skills/​dev-proxy/​references/​configuration.md Documents process-tree watching.
schemas/​v4.0.0/​rc.schema.json Adds schema support.
DevProxy/​Proxy/​ProxyConfiguration.cs Adds configuration state.
DevProxy/​Commands/​DevProxyCommand.cs Handles the CLI option.
DevProxy.Tests/​Fakes.cs Updates the test configuration fake.
DevProxy.Proxy.Kestrel/​KestrelProxyEngine.cs Passes tree settings to filtering.
DevProxy.Proxy.Kestrel/​Internal/​ProcessFilter.cs Implements ancestry resolution, matching, and caching.
DevProxy.Proxy.Kestrel.Tests/​ProcessFilterTests.cs Adds process-filter tests.
DevProxy.Integration.Tests/​TestProxyConfiguration.cs Updates integration configuration.
DevProxy.Abstractions/​Proxy/​IProxyConfiguration.cs Extends the configuration contract.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@garrytrinder garrytrinder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes for the Windows ancestor PID-reuse issue. The process-handle disposal issue should also be addressed while touching this path.

Comment thread DevProxy.Proxy.Kestrel/Internal/ProcessFilter.cs
Comment thread DevProxy.Proxy.Kestrel/Internal/ProcessFilter.cs Outdated
Reject reused ancestor PIDs using process start times and dispose process handles after metadata lookup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)

bool ValidateSchemas { get; }
IEnumerable<int> WatchPids { get; set; }
IEnumerable<string> WatchProcessNames { get; set; }
bool WatchProcessTree { get; set; }
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.

Feature request: Intercept traffic from a process + all children processes

3 participants