Apply sanitization to network telemetry by akxue · Pull Request #470 · kernel/kernel-images · GitHub
Skip to content

Apply sanitization to network telemetry - #470

Open
akxue wants to merge 2 commits into
mainfrom
hypeship/strip-network-credentials
Open

akxue wants to merge 2 commits into
mainfrom
hypeship/strip-network-credentials

Conversation

@akxue

@akxue akxue commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

context

network telemetry published each request's body (post_data) and every request and response header as CDP reported them. that's the same view as the DevTools Network panel, which assumes the person reading it is the person using the browser. telemetry is read elsewhere (stored events, SSE, OTLP export), so it should default to what's safe to share.

this applies sanitization to network telemetry, starting with Chrome's sanitized HAR export defaults (Chrome 130+), which leave out Cookie, Set-Cookie and Authorization. request bodies can hold form input, including passwords, so they're left out for now and come back once a redaction layer can remove sensitive fields before events are published.

changes

  • network_request no longer includes post_data, and the pending request state no longer holds it.
  • request and response headers leave out Authorization, Proxy-Authorization, Cookie and Set-Cookie, matching any capitalization.
  • post_data stays in the schema as an optional field so existing clients keep decoding events. the openapi descriptions, regenerated oapi.go and the cdpmonitor README describe what's left out.
  • response bodies are unchanged.

#462 adds headers from requestWillBeSentExtraInfo / responseReceivedExtraInfo and a request_headers field on responses. those should go through publishedHeaders as well; whichever PR merges second needs a rebase.

testing

  • new unit test TestNetworkEvents/credentials_left_out sends canary values in the body and each credential header and checks none are published.
  • KERNEL_CDPMONITOR_CHROME_E2E=1 go test ./lib/cdpmonitor/ against real Chromium. the frames and workers capture tests now assert post_data is absent.
  • go test -race $(go list ./... | grep -v /e2e$)
  • not run: the image e2e suite (make test).

Note

Medium Risk
Changes what network telemetry exposes (breaking for consumers that relied on post_data or auth headers) but reduces credential leakage; response bodies may still contain secrets.

Overview
Sanitizes CDP network telemetry so stored/SSE events no longer carry secrets that DevTools would show only to the browser operator.

network_request events stop publishing post_data and pending request state no longer retains bodies. Request and response headers are filtered through publishedHeaders, dropping Authorization, Proxy-Authorization, Cookie, and Set-Cookie (any casing). Truncated response bodies for text MIME types are unchanged.

OpenAPI, regenerated oapi.go, and the cdpmonitor README document the new behavior; post_data remains optional in the schema for backward-compatible decoding. Tests cover credential stripping (credentials_left_out) and Chrome e2e cases now expect absent request bodies.

Reviewed by Cursor Bugbot for commit a6f65c2. Bugbot is set up for automated code reviews on this repo. Configure here.

@akxue
akxue marked this pull request as ready for review October 15, 2026 23:56
@akxue
akxue requested a review from Sayan- October 15, 2026 23:56
@akxue akxue changed the title Stop publishing request bodies and credential headers in network telemetry Apply sanitization to network telemetry Oct 19, 2026
@akxue
akxue force-pushed the hypeship/strip-network-credentials branch from c376f74 to a6f65c2 Compare October 19, 2026 17:25

@Sayan- Sayan- 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.

holding while we discuss first

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