Skip to content

Restrict HTTP debug logging to safe request metadata - #809

Open
sameerforge wants to merge 1 commit into
carvel-dev:developfrom
sameerforge:topic/sameerkh/upstream-audit-fixes-20261022
Open

sameerforge wants to merge 1 commit into
carvel-dev:developfrom
sameerforge:topic/sameerkh/upstream-audit-fixes-20261022

Conversation

@sameerforge

@sameerforge sameerforge commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Replace raw HTTP request/response dumps with method, sanitized endpoint and status metadata. Omit URL credentials and query values, headers, bodies and raw transport error text from debug output. Preserve the original requests, authentication headers, response cookies and response bodies.

Validation

  • go test ./pkg/imgpkg/registry/...
  • golangci-lint run
  • Regression coverage checks request/response cookies, authorization, URL credentials, query/fragment values, transport failures and unchanged transport inputs/results.
  • The broader go test ./pkg/... reaches existing registry integration tests that require IMGPKG_E2E_IMAGE and IMGPKG_E2E_RELOCATION_REPO; those environments were not configured for this run.
  • The malformed registry-hostname diagnostic is already sanitized on develop and its existing regression tests pass.

CI coverage

  • Update the debug end-to-end test to assert method, endpoint and status output while ensuring HTTP headers are omitted. Both debug-enabled and debug-disabled tests pass locally.
  • Use a Windows Server 2022 runner to match the registry container, and explicitly start Docker before running integration tests.

Does this PR introduce a user-facing change?

Registry HTTP debug logging displays safe request metadata rather than raw headers, bodies or credential-bearing URLs.

Replace raw HTTP request and response dumps with method, sanitized endpoint
and status metadata. Omit headers, bodies and raw transport error text from
diagnostics without changing authentication or response data. Add tests for
URL credentials, cookies, response cookies and transport failures.

Signed-off-by: Sameer Khan <sameer.khan@broadcom.com>
@sameerforge
sameerforge force-pushed the topic/sameerkh/upstream-audit-fixes-20261022 branch from 23e58ca to 5296434 Compare October 22, 2026 05:56

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

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant