Repository navigation
Conversation
β¦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>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
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 theOMP_AUTH_BROKER_URLthe manager reads inagentNoProxy()(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 thestrings.ContainsAny(host, ", \t")guard keeps a malformed value from smuggling extraNO_PROXYentries. Unset/unparsable/opaque URLs fall back to the loopback list unchanged, which is what the existingTestAgentEnvPairs_NonInference_NoProxyLoopbacknow 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
There was a problem hiding this comment.
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) readsOMP_AUTH_BROKER_URLfrom the crux process env, not the agent's, so an agent cannot widen its ownNO_PROXY.manager_launch.go:444builds agent env fromos.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 existing127.0.0.1,localhost,::1(table testmanager_env_noproxy_test.gocovers IPv4+port, hostname, IPv6 literal, invalid, path-only, opaque).coverage_boost_test.go:271pins the var empty so the loopback-only assertion stays deterministic. - Security posture:
src/crux/proxy/plain_forward_guard.go:13-37explains 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 showscurl --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_PROXYonly 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
|
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:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
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:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: changing LGTM is restricted to collaborators DetailsIn response to this:
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. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hivecommons-hive[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@odttlnt this PR is back in your court ( Review asks:
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. |
|
@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. |
|
@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.
|
Fixes #15432
Agents are launched with
NO_PROXY=127.0.0.1,localhost,::1, soOMP_AUTH_BROKER_URLrequests 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()incrux/agent/manager_env.gonow appends the host ofOMP_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 genericagents.no_proxy_extrais left for a follow-up.Tests were not run locally per AGENTS.md; CI is the verdict.
β hive: backend=bob model=premium