Repository navigation
π fix: bypass the proxy for the OMP_AUTH_BROKER_URL host in agent NO_PROXY - #15649
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 #15432 Hive-Run: #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
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether agents may bypass the hive proxy for the OMP_AUTH_BROKER_URL host (one operator-chosen private address, outside the plain-forward destination guard and its violation accounting).
Code looks correct to me; this is a proxy-policy decision, so I am routing rather than judging it.
What I verified at this head (patch is byte-identical to fork #15433, rebased onto v5):
src/crux/agent/manager_env.go:24-36βagentNoProxy()parsesOMP_AUTH_BROKER_URL, appends onlyu.Hostname()(port stripped, IPv6 brackets removed), and returns loopback-only for unset, unparsable, host-less or opaque URLs. A hostname containing,/whitespace is also rejected, so the value cannot smuggle extra NO_PROXY entries.manager_env.go:277β the only call site; replaces the fixed"127.0.0.1,localhost,::1"from #14076.manager_env_noproxy_test.gocovers each branch;coverage_boost_test.gonow pins the env empty so the existing loopback assertion stays deterministic.- Go's
httpproxyand Node'sproxy-from-envboth match NO_PROXY entries on host without port, so172.18.0.1:18765from the issue is matched by the172.18.0.1entry.
What a human needs to decide: #15432 asks that agents talk to the credential broker directly. That host is chosen by the hive's own environment (not by the agent), which bounds the exposure to one address β but traffic to it leaves the proxy's destination guard, audit log and violation counters. The question above is the whole decision; everything else in the diff follows the reference fix in #15432 verbatim.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @097a861, 65/66 checks green, 1 pending, DCO yes, soak 0s of 30m0s. What to do: approve this head ( 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]: you cannot LGTM your own PR. 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. |
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 β the question already posted on #15433 β since this adoption carries that PR's commit unchanged and one answer settles both.
This is the hive's adoption of #15433. I diffed the two heads: the only commits here beyond 3313ef2 are merges of v5, and git diff 3313ef2 0a2d57e -- src/crux/agent changelog.d is empty. The code review on #15433 therefore applies verbatim β agentNoProxy (src/crux/agent/manager_env.go:24-36) reads the broker URL from the crux process env, adds only u.Hostname(), and falls back to loopback-only on anything unparsable; I re-read it at this head and found no defect.
What is pending is not a code fix but the proxy-policy call raised on #15433 (env-derived exemption vs. an operator-declared list, per the open question in #15432). Whichever of the two PRs lands, the other should close; I have not closed anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Looks correct to me. This adoption carries #15433's patch byte-for-byte (+50/-1 across manager_env.go, manager_env_noproxy_test.go, coverage_boost_test.go, changelog.d/fixed-15432-broker-no-proxy.md) merged onto current v5; the merge introduced no changes of its own.
Re-verified against the v5 tree at this head:
src/crux/agent/manager_env.go:24-36βagentNoProxy()readsOMP_AUTH_BROKER_URLfrom the crux process env and appends onlyu.Hostname(); empty, unparsable, host-less and opaque URLs return the unchanged loopback list, and theContainsAny(host, ", \t")guard prevents a malformed value from injecting extraNO_PROXYentries.src/crux/agent/manager_launch.go:444still builds the agent env fromos.Environ(), so the broker host the governor exempts is the same one the agent CLI dials.v5has not touched theNO_PROXYpair since #15433 was reviewed (manager_env.go:256is still the literal loopback string), so the rebase is clean.
The policy question raised on #15433 (@hanthor: broker-derived exemption vs an operator-declared list) was answered when @clubanderson /approved head 3313ef2 and requested this adoption, so I am not re-asking it. The one consequence worth stating once more for the record: NO_PROXY matches by host, so the agent reaches every port on the broker host without the proxy's destination guard β inherent to the approach #15432 chose.
Could not run go test in this pod (blocked for agents); CI is the verdict.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read agentNoProxy and the env block in src/crux/agent/manager_env.go at 72246f9, plus the only other consumer of the old literal. The change looks correct to me: url.Parse + Hostname() strips port and IPv6 brackets, the ContainsAny(host, ", \t") guard keeps a malformed value from smuggling extra NO_PROXY entries, and every failure path falls back to the unchanged loopback list. coverage_boost_test.go:271 now pins the env so the loopback assertion stays deterministic.
One operator-facing gap:
- low β docs out of date.
src/docs/env-vars.md:348still saysNO_PROXYis127.0.0.1,localhost,::1 β loopback never traverses the hive proxy. After this PR it is loopback plus the host ofOMP_AUTH_BROKER_URLwhen that is set; an operator debugging why a broker on the Docker bridge is reachable directly will not find the answer in the reference. A one-line edit to that row (and the matching changelog wording already describes it well) would close it.
Nothing else from me; this supersedes #15433 as the body states, with the original commits preserved.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: you cannot LGTM your own PR. 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 |
There was a problem hiding this comment.
Looks correct to me, and the policy question that parked it has already been answered β this is ready for the merge gate, not for another decision round.
What I verified (diff + v5 tree):
gh pr diff 15649is byte-identical togh pr diff 15433. The PR's only non-merge commit is still @odttlnt's3313ef2; every commit since097a861is aMerge branch 'v5' into hive/adopt-15433(29 of them in ~9h).compare/097a861...38f552ftouches only files that arrived from v5, none from this change.src/crux/agent/manager_env.go:24-36(agentNoProxy) readsOMP_AUTH_BROKER_URLfrom the crux process env and appends onlyu.Hostname(); unset/unparsable/host-less/opaque URLs fall back to the existing127.0.0.1,localhost,::1.manager_env_noproxy_test.gocovers IPv4+port, hostname, IPv6 literal, invalid, path-only and opaque;coverage_boost_test.go:271pins the var empty so the loopback-only assertion stays deterministic.- The
requires_humanrecorded on this PR and on #15433 asked whether agentNO_PROXYmay be widened automatically fromOMP_AUTH_BROKER_URL. @clubanderson answered it with/lgtm+/approveat head097a861. The content approved there is exactly the content at38f552f.
For a maintainer:
- The approval keeps falling out of date only because the adopt branch is re-merged from v5 every ~15 minutes, which moves the head and regresses the stage to
050-review-pending(see thehive:stage-regressedcomment). Nothing in the code changed; re-confirming at the current head is safe. - Once this lands, #15433 (same diff, fork branch that cannot be pushed) can be closed as superseded, as this PR's body already declares. I have not closed anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read the diff against v5 at 003726527 and the callers. This looks correct to me, and the decision that parked #15433 has already been made.
Content. The only non-merge commit here is 3313ef2, byte-identical to #15433's diff (I diffed gh pr diff 15433 against gh pr diff 15649: no difference). Every later commit is a Merge branch 'v5'.
Correctness. agentNoProxy() (src/crux/agent/manager_env.go:24-36) reads OMP_AUTH_BROKER_URL from the hive process, and the agent's own env is built from os.Environ() (src/crux/agent/manager_launch.go:444), so the broker URL the CLI will dial and the host added to NO_PROXY come from the same variable. u.Hostname() strips brackets from IPv6 literals, which is the form Go's httpproxy matcher expects; the ContainsAny(host, ", \t") guard keeps a malformed value from smuggling extra NO_PROXY entries. The table test covers the unset/invalid/host-less cases, and the one existing NO_PROXY test now pins the env to "" so it stays deterministic.
Security. This widens the proxy bypass by exactly one host, taken from an env var on the hive host that agents cannot set. All other private addresses remain behind the plain-forward guard.
Decision status. #15433 was routed to @hanthor on whether NO_PROXY may be widened automatically from OMP_AUTH_BROKER_URL versus an operator-declared list. @clubanderson approved this PR from the dashboard at head 72246f9 (<!-- hive:pr-approval head=72246f9β¦ by=clubanderson -->); the only change since is further v5 merges. I am treating that as the answer and not re-raising the question. The generic agents.no_proxy_extra idea in #15432 stays a follow-up, as the body says.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15433 (adopted after CI went red and the contributor was unavailable; original commits by @odttlnt preserved).
Fixes #15432
This branch is #15433's head
3313ef2503afas pushed by @odttlnt (forkodttlnt/hive), unchanged. Last lane reason on the original:fork-not-editable.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.