Skip to content

πŸ› fix: bypass the proxy for the OMP_AUTH_BROKER_URL host in agent NO_PROXY - #15433

Closed
odttlnt wants to merge 1 commit into
hivecommons:v5from
odttlnt:fix/proxy-private-guard-auth-broker-15432
Closed

odttlnt wants to merge 1 commit into
hivecommons:v5from
odttlnt:fix/proxy-private-guard-auth-broker-15432

Conversation

@odttlnt

@odttlnt odttlnt commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #15432

Agents are launched with NO_PROXY=127.0.0.1,localhost,::1, so OMP_AUTH_BROKER_URL requests to a private broker address (e.g. the Docker bridge gateway) went through the proxy and were refused by the plain-forward guard (#14076), crashing the CLI on start.

agentNoProxy() in crux/agent/manager_env.go now appends the host of OMP_AUTH_BROKER_URL, and only that host. Unset, unparsable or host-less URLs add nothing, so all other private addresses stay behind the guard. Table tests cover IPv4, hostname, IPv6 literal, empty, invalid. Based on the reference implementation in the issue. The open question about a generic agents.no_proxy_extra is left for a follow-up.

Tests were not run locally per AGENTS.md; CI is the verdict.

β€” hive: backend=bob model=premium

…PROXY

Agents inherit OMP_AUTH_BROKER_URL, whose host is usually a private
address (Docker bridge gateway). Requests went through the hive proxy and
were refused by the plain-forward destination guard, so the CLI exited on
start. Append only that host to NO_PROXY; unparsable or host-less URLs add
nothing.

Fixes hivecommons#15432

Hive-Run: hivecommons#15432
Hive-Plan: agent NO_PROXY broker host
Hive-Spec: agent-env#no-proxy-broker
Signed-off-by: SACHIN NAIK <sachin.naik@ibm.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot 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.

Looks correct to me, and it is the fix #15432 specifies ("append the host of OMP_AUTH_BROKER_URL, and only that host"). Read the tree at 3313ef2:

  • Agents are launched with cmd.Env = append(os.Environ(), …) (crux/agent/manager_launch.go:444), so the OMP_AUTH_BROKER_URL the manager reads in agentNoProxy() (manager_env.go:26) is the same value the agent CLI will use β€” no divergence between the host the agent dials and the host exempted.
  • u.Hostname() strips the port and IPv6 brackets, and the strings.ContainsAny(host, ", \t") guard keeps a malformed value from smuggling extra NO_PROXY entries. Unset/unparsable/opaque URLs fall back to the loopback list unchanged, which is what the existing TestAgentEnvPairs_NonInference_NoProxyLoopback now pins by clearing the variable.

One thing worth a maintainer's eye, stated plainly rather than as a defect: NO_PROXY matches by host, not host:port, so with a broker at 172.18.0.1:18765 the agent can reach any port on the Docker bridge gateway without traversing the proxy's destination guard or its violation accounting. That is inherent to the approach #15432 chose (the alternative, HIVE_PROXY_ALLOW_PRIVATE_FORWARD, lifts the guard for the whole private estate, which is broader). @hanthor β€” since you scoped the fix, flagging only so the all-ports consequence is a conscious acceptance.

Could not run go test in this pod (blocked for agents); build-and-test was still in progress.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot 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.

Decision needed: @hanthor should decide whether agent NO_PROXY may be widened automatically from OMP_AUTH_BROKER_URL (this PR), or whether proxy exemptions must come from an operator-declared list as the open question in #15432 proposes.

The code does what #15432's reference implementation describes, and I found no defect. I am routing it because it changes which destinations agents reach around the hive proxy, which is a policy decision rather than a code one.

What I verified (v5 tree + diff):

  • src/crux/agent/manager_env.go:24-36 (agentNoProxy) reads OMP_AUTH_BROKER_URL from the crux process env, not the agent's, so an agent cannot widen its own NO_PROXY. manager_launch.go:444 builds agent env from os.Environ(), so the URL the governor parses is the same one the CLI will dial β€” the two are consistent.
  • Only u.Hostname() is added; "", unparsable and opaque URLs fall back to the existing 127.0.0.1,localhost,::1 (table test manager_env_noproxy_test.go covers IPv4+port, hostname, IPv6 literal, invalid, path-only, opaque). coverage_boost_test.go:271 pins the var empty so the loopback-only assertion stays deterministic.
  • Security posture: src/crux/proxy/plain_forward_guard.go:13-37 explains the guard protects against the proxy's uid dialing private addresses on an agent's behalf; it says nothing about the agent dialing directly, and the issue shows curl --noproxy '*' already reaches the broker from the agent uid. So this PR does not open a path the agent lacked β€” it stops the agent's CLI from being routed into a refusal. The :443 egress redirect is unaffected (NO_PROXY only changes which proxy the client uses, not iptables).

The decision is the one #15432 itself leaves open: a broker-specific exemption derived from an env var versus an operator-declared agents.no_proxy_extra-style list. The existing escape hatch HIVE_PROXY_ALLOW_PRIVATE_FORWARD (plain_forward_guard.go:46) is far broader than this, so the narrow fix is the conservative one of the two shapes available today β€” but the proxy's destination policy is an owner call, not mine.

Changelog fragment name fixed-15432-broker-no-proxy.md matches the guard's <category>-<pr-or-slug>.md rule.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @3313ef2, 58/58 checks green, DCO yes, soak 0s of 30m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed. An ordinary contributor cannot release their own PR.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @3313ef2, 58/58 checks green, DCO yes, soak 10m0s of 30m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/approve

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hivecommons-hive[bot]
Once this PR has been reviewed and has the lgtm label, please assign hanthor 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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@odttlnt this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch is behind the base and Hive cannot update it; enable "allow edits by maintainers" or rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (2 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson asked the hive to adopt this pull request now, without waiting for its author's hive. The hive opens its own PR carrying the author's commits and sign-off unchanged on the pass now running; this PR closes when that copy merges.

@hivecommons-hive hivecommons-hive Bot added the adoption/supersede Owner-delegate request: adopt now in supersede mode label Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson asked the hive to adopt this pull request now, without waiting for its author's hive. The hive opens its own PR carrying the author's commits and sign-off unchanged on the pass now running; this PR closes when that copy merges.

Maintainer: fork head is not editable by the App and the author is offline β€” hive adopts and carries this to merge.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closing: #15649 (the hive's adoption of this PR, with @odttlnt's commits) has merged. Thank you!

@hivecommons-hive hivecommons-hive Bot closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› bug: agents can't reach OMP_AUTH_BROKER_URL β€” the proxy's private-address guard refuses it, so the CLI exits on start

1 participant