Skip to content

OTA-2025: Redact proxy URL credentials from AgenticRun readiness data - #1442

Open
jrangelramos wants to merge 1 commit into
openshift:mainfrom
jrangelramos:fix-proxy-credential-redaction
Open

OTA-2025: Redact proxy URL credentials from AgenticRun readiness data#1442
jrangelramos wants to merge 1 commit into
openshift:mainfrom
jrangelramos:fix-proxy-credential-redaction

Conversation

@jrangelramos

@jrangelramos jrangelramos commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Proxy URLs from the cluster Proxy CR may contain embedded credentials (user:password@host). The NetworkCheck readiness collector forwarded these unsanitized into the AgenticRun request sent to the LLM provider.
  • Added redactProxyURL() to strip the userinfo component via net/url.Parse before including proxy URLs in readiness output. Falls back to [configured] if parsing fails (fail-closed).
  • no_proxy is unchanged — it's a host list, not a URL.

Test plan

  • TestNetworkCheck_ProxyCredentialRedaction: credentials stripped, no-credentials passthrough, empty string
  • All 30 existing readiness tests pass with no regressions

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Proxy credentials are now removed from readiness results to prevent sensitive information from being exposed.
    • Invalid proxy URLs are displayed safely as [configured], while empty and credential-free values remain unchanged.
  • Tests

    • Added coverage for HTTP and HTTPS proxy credential redaction and edge cases.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@jrangelramos: This pull request references OTA-2025 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Proxy URLs from the cluster Proxy CR may contain embedded credentials (user:password@host). The NetworkCheck readiness collector forwarded these unsanitized into the AgenticRun request sent to the LLM provider.
  • Added redactProxyURL() to strip the userinfo component via net/url.Parse before including proxy URLs in readiness output. Falls back to [configured] if parsing fails (fail-closed).
  • no_proxy is unchanged — it's a host list, not a URL.

Test plan

  • TestNetworkCheck_ProxyCredentialRedaction: credentials stripped, no-credentials passthrough, empty string
  • All 30 existing readiness tests pass with no regressions

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jrangelramos, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e567fa1-a81e-4f45-a3d2-9cc17c9821e7

📥 Commits

Reviewing files that changed from the base of the PR and between 431c81a and 8d4a5a1.

📒 Files selected for processing (2)
  • pkg/readiness/checks_test.go
  • pkg/readiness/network.go

Walkthrough

The network readiness check now removes proxy credentials from HTTP and HTTPS results. It preserves empty and credential-free values, marks invalid URLs as [configured], and adds table-driven tests for these cases.

Changes

Readiness proxy redaction

Layer / File(s) Summary
Sanitize and validate proxy values
pkg/readiness/network.go, pkg/readiness/checks_test.go
redactProxyURL preserves empty values, replaces invalid URLs with [configured], and removes userinfo from valid URLs. NetworkCheck.Run applies it to HTTP and HTTPS proxy results. Tests cover credentialed, credential-free, empty, and invalid proxy values.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: redacting proxy URL credentials from AgenticRun readiness data.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The added Go test and its three t.Run names are fixed descriptive strings; no dynamic values or Ginkgo test titles appear in the relevant changes.
Test Structure And Quality ✅ Passed The added test is a standard Go table-driven unit test, not Ginkgo code; it uses a fake client, performs no waits or cluster resource changes, and includes diagnostic comparison messages.
Microshift Test Compatibility ✅ Passed The added test is a standard Go unit test (func Test... (t *testing.T)) in pkg/readiness, not a new Ginkgo e2e test; MicroShift e2e compatibility rules do not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added test is a standard Go unit test using fake dynamic clients, not a Ginkgo e2e test, and it makes no multi-node or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only proxy redaction in the readiness collector and tests; it adds no manifests, controllers, replicas, affinity, topology spread, selectors, tolerations, or PDB constraints.
Ote Binary Stdout Contract ✅ Passed The patch changes only readiness code and tests, with no process-level stdout writes; OTE routes GinkgoWriter to stderr and vendored klog defaults to stderr.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The added test is a standard Go unit test using a fake dynamic client, not a Ginkgo e2e test; it performs no network connections or IPv4-only operations.
No-Weak-Crypto ✅ Passed The PR adds only net/url-based proxy redaction and tests; exact added-line scans found no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only two Go files. The added-line scan finds no privileged settings, and existing flagged manifest entries are unchanged.
No-Sensitive-Data-In-Logs ✅ Passed The change adds no production logging; proxy userinfo is removed before readiness JSON serialization, and controller logs only versions/errors, not the readiness payload.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jrangelramos
Once this PR has been reviewed and has the lgtm label, please assign pratikmahajan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/readiness/checks_test.go`:
- Around line 742-746: Update the proxy redaction test around the https_proxy
assertion to always compare proxy["https_proxy"] with tt.wantHTTPS, including
empty expectations. Extend the test cases with the hostless proxy input
http:admin:s3cret@proxy.corp:8080 and expect [configured], preserving coverage
of fail-closed redaction.

In `@pkg/readiness/network.go`:
- Around line 81-86: Update the proxy URL sanitization flow after url.Parse and
before returning u.String() to validate that the parsed URL has both a scheme
and host; return "[configured]" when either is missing. Preserve removing u.User
before returning valid sanitized URLs.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c640fbe3-6a62-4dbc-a304-8f5b15936e70

📥 Commits

Reviewing files that changed from the base of the PR and between 97ee3b7 and 431c81a.

📒 Files selected for processing (2)
  • pkg/readiness/checks_test.go
  • pkg/readiness/network.go

Comment thread pkg/readiness/checks_test.go Outdated
Comment thread pkg/readiness/network.go
@jrangelramos
jrangelramos force-pushed the fix-proxy-credential-redaction branch from 431c81a to f0b656d Compare August 10, 2026 20:32
Proxy URLs from the cluster Proxy CR may contain embedded credentials
(user:password@host). These were forwarded unsanitized into the
AgenticRun request, which is sent to an LLM provider. Strip the
userinfo component before including proxy URLs in readiness output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jrangelramos
jrangelramos force-pushed the fix-proxy-credential-redaction branch from f0b656d to 8d4a5a1 Compare August 10, 2026 20:34
@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@jrangelramos: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants