Repository navigation
Conversation
This was referenced Oct 31, 2026
6 tasks done
daemon.yaml paths under binding.tls and a daemon-kind workspace's tls were read as written, so ~/.infer/daemon/workstation-ca.crt, the form docs/daemon.md shows, failed with a missing file. They now go through utils.ExpandHome like projects_root.
…ver NetBird A session teleports from infer-local, a daemon in Docker beside a k3d cluster, to infer-k8s, a daemon in the cluster whose agent calls an Inference Gateway. Every hop is a peer on a self-hosted NetBird 0.82 network (the combined server and the dashboard), and each hop has its own one-way policy: TCP 52789 into infer-k8s and TCP 8080 into the gateway. The NetBird Kubernetes operator 0.9.0 joins the pods with setup keys, groups and sidecar profiles. The infer-k8s binding listens only on its NetBird address with files TLS from a cert-manager ECDSA certificate and a token. A NetworkPolicy admits only WireGuard to the gateway's pod address, and tokenless behind it answers without an API key. A sniffer in front of the infer-k8s node sees only WireGuard, never the token, the forwarded secret or the model's reply, while a plaintext canary proves it reads plaintext. An attacker peer outside the policies can neither resolve nor reach infer-k8s or the gateway, and infer-local cannot skip a hop to the gateway. The dashboard's Control Center draws the chain. docs/daemon.md gains the NetBird setup for daemons on other machines and no longer claims ca mode keeps forward_env between two daemons. Refs #1664
…teway The gateway hop now comes from the Inference Gateway operator v0.29.0: a Gateway resource named gateway in place of a bare pod, in a namespace labelled for the operator. Its pods carry app: gateway, which the NetBird SidecarProfile and the WireGuard-only NetworkPolicy already select. The Gateway resource sets no pod labels or node placement of its own (inference-gateway/operator#308), so the peer keeps its pod's name and the extra DNS label keeps gateway.netbird.internal stable.
….0 spec.pod The Inference Gateway operator v0.30.0 adds spec.pod to Gateway, Agent and MCP (inference-gateway/operator#308). The example installs it and pins the gateway to agent-0 with spec.pod.nodeSelector, away from infer-k8s, so the sniffer in front of infer-k8s sees the gateway hop cross nodes. The README also covers the old gateway peer that keeps the gateway DNS label for a few minutes after a gateway pod is replaced on a running cluster.
Checked in the dashboard: the Control Center draws one hop at a time, the policies that let the focused peer reach others. infer-local shows the hop to infer-k8s, infer-k8s the hop to the gateway, and attacker none. The README said one view showed the whole chain.
The Control Center Group view draws the policies a group is the source of on its right and the ones it is the destination of on its left. Selecting the infer-k8s group therefore shows infer-local, infer-k8s and the gateway with both policies in one view, so the README leads with that and keeps the Peer view as the per-peer detail.
…rd example's first hop cert-manager's peers-ca now issues infer-k8s a server certificate and infer-local a client auth certificate. The infer-k8s binding runs files TLS with client_auth, so the verified certificate replaces the binding token and the token Secret is gone. task attack adds a client inside infer-local's own NetBird network that has no certificate and gets "certificate required". The README gains a table of the hops still on plain HTTP inside WireGuard and the issues that track TLS for them, and docs/daemon.md shows the mTLS setup for NetBird. Refs #1664
…kenless or a real model tokenless v0.11.0 is now the gateway itself, with --tls-client-ca, instead of a mock provider behind an operator Gateway. infer-k8s reaches it on gateway.netbird.internal:8443 with gateway.tls, presenting the infer-k8s certificate, which gains client usage. task attack adds infer on infer-k8s without its client certificate, which the gateway rejects. task gateway:real swaps tokenless for the Inference Gateway 0.61.0, run by operator v0.31.0, in front of a real provider. It reads <PROVIDER>_API_KEY from the environment into a Secret, keeps the gateway peer, port and certificate, and points infer-k8s at MODEL. The Gateway requires client certificates through spec.server.tls.clientCARef. Its provider calls loop through its own listener on 0.0.0.0:8443, so the gateway certificate also names 0.0.0.0 and spec.client.tls presents it back. The README replaces the gap table with how each hop runs TLS, and adds how to use a real model. Refs #1664
edenreich
force-pushed
the
docs/kubernetes-session-teleport-netbird
branch
from
November 1, 2026 17:11
da0d935 to
646e3d1
Compare
4 of 5 tasks
…d example Gateway 0.61.1 reaches its own /proxy route in process, so its server TLS no longer applies to its provider calls. The gateway certificate loses the 0.0.0.0 address and client usage, and the real Gateway loses spec.client.tls. task gateway:real now waits only for the tokenless pods to go, so it can run again to switch provider or model. Refs #1664
edenreich
added a commit
that referenced
this pull request
Nov 1, 2026
… the gateway (#1673) ## Summary infer can now reach a gateway behind a private CA or one that requires mutual TLS. mTLS is optional: `ca_file` alone gives plain TLS against a private CA, and the client certificate is presented only when the gateway asks for one. `gateway` gains a `tls` block: ```yaml gateway: url: https://gateway.example.internal:8443 tls: ca_file: ~/.infer/gateway-ca.crt cert_file: ~/.infer/gateway-client.crt key_file: ~/.infer/gateway-client.key ``` Each key also has an `INFER_GATEWAY_TLS_*` environment variable. - `ca_file` is added to the system roots for gateway calls only. Before, a private CA meant `SSL_CERT_FILE`, which replaces the roots for everything the agent does. - `cert_file` and `key_file` are presented when the gateway asks for a client certificate. Set both or neither. - Paths may start with `~`. ## Changes - `internal/gateway/tls.go`: `Transport(config.PeerTLSConfig)` is the one transport for the gateway. Without settings it is `http.DefaultTransport`. With them it is a clone that carries the CA and the key pair. Unusable material, such as a missing file, a PEM holding no certificate, or half a key pair, fails each gateway call with the cause and names the setting. Startup is not broken, and no constructor signature changes. - Every gateway call uses it: - the container's SDK clients: agent loop, model listing for chat, headless and status, titles, summaries, media, insights - the supervisor's health, audio and version probes. `Version()` asks external gateways too, so `infer status` reports an mTLS gateway's version again - A2A requests to the gateway origin. `UseGatewayCredential` takes the transport, and other A2A agents keep the default, so they never get the gateway's client certificate - `config.GatewayConfig.TLS` reuses `PeerTLSConfig`, the `ca_file`, `cert_file` and `key_file` a daemon-kind workspace already has. The env overrides and `infer config get/set` find the new keys through the existing reflection, and an empty block stays out of `infer init`'s output. - `docs/configuration-reference.md`: the settings, the example and the env vars. ## Scope - Daemon workers read the same config and environment, so a daemon on another machine or in a pod reaches its gateway the same way. #1671 uses this for its `infer-k8s` pod. - Not covered: - `judge.gateway_url`, a separate gateway that may have its own CA. Add a `judge.tls` once someone runs it behind mTLS. - `kind: kubernetes` workspaces, which reach the in-cluster Gateway that infer deploys over plain HTTP. TLS there belongs to the operator's `Gateway` spec. ## Test plan - [x] `internal/gateway/tls_test.go`, against an `httptest` TLS gateway whose certificates come from the daemon PKI: - without `ca_file` the private CA is unknown - with `~/ca.crt` it is trusted - an mTLS gateway accepts the client certificate and rejects a request without it (`certificate required`) - a missing `ca_file` and a `cert_file` without its `key_file` fail and name the setting - [x] The same tests fail when `Transport` ignores the settings - [x] `Version()` reads an mTLS gateway's `/version` with the client certificate - [x] A2A reaches the gateway over its transport without an API key, and another agent stays on the default transport - [x] `INFER_GATEWAY_TLS_CA_FILE`, `_CERT_FILE` and `_KEY_FILE` reach `cfg.Gateway.TLS` - [x] `task test` and `task precommit:run` pass ## Notes - Impacted repos: `inference-gateway/docs`. The CLI configuration page gets the new keys in inference-gateway/docs#1072. - Server-side mTLS shipped in inference-gateway/inference-gateway#818 (v0.61.0), and the operator's `spec.server.tls.clientCARef` shipped in operator v0.31.0. Closes #1672
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
examples/kubernetes-session-teleport-netbird, a runnable example where a session teleports along a chain of NetBird peers. Every hop is admitted by its own NetBird policy and runs mutual TLS:Stacked on #1673 (
gateway.tlsin infer), whichinfer-k8sneeds for the second hop. The example builds infer from the checkout, so it needs no release.Everything is self-hosted on a local k3d cluster:
netbird-server(management, signal, relay, STUN, embedded IdP) and the dashboard v2.96.0, as plain manifestsGroup,SetupKeyandSidecarProfileresourcespeers-ca, which issues theinfer-k8s,gatewayandinfer-localcertificates (ECDSA P-256)--tls-client-catask gateway:realswaps in the Inference Gateway 0.61.1, run by operator v0.31.0 withspec.server.tls.clientCARef, in front of a real provider. It reads<PROVIDER>_API_KEYfrom the environment into a Secret, andPROVIDERandMODELpick the provider and model, and rerunning it switches themPOST /api/setup, set thenetbird.internalDNS domain, delete the allow-allDefaultpolicy and create the two policiesThe demo then shows what an attacker gets:
infer-k8snode sees only WireGuard. The sealedforward_envvalue and the model's reply never appear in the capture, while a plaintext canary does, so the capture provably reads plaintextinfer-k8sor the gateway, andinfer-localcannot skip a hop to the gatewaytlsv13 alert certificate requiredfrom the binding,remote error: tls: certificate requiredfrom the gatewayChanges
fix(daemon): expand~in the binding and daemon-workspace TLS certificate, key and CA paths. The formdocs/daemon.mdshows (ca_file: ~/.infer/daemon/workstation-ca.crt) used to fail with a missing file. Table tests cover both the client and the server side.docs(examples):docs/examples.mddocs/daemon.md. It covers mTLS on the binding andgateway.tlsfor the workers, and stops claiming thatcamode keepsforward_envbetween two daemons. Its certificate names only the workspace, the hostname andlocalhost, and it requires client certificates nothing issues to a second daemon, so the example usesfilesTLSAcceptance criteria, as adapted
The issue asked for compose files under
examples/netbird-peers/with NetBird Cloud as an alternative. On request, the example:examples/kubernetes-session-teleport-netbird/, named aftersession-teleportinfer-localstill runs from a compose file beside the cluster. The binding token becameinfer-local's client certificate.filesTLS withclient_auth: trueadmits a verified certificate in place of the token, so the example has no token. Every other criterion holds:kind: daemonby NetBird name with the daemon's own TLSworkspaces,teleport,runand teleport back in the READMEforward_envtask cleanupdocs/daemon.mdlinkPer-connection traffic events are a NetBird Enterprise feature, so the README points at the Control Center,
netbird status -dand the capture instead.Test plan
go test ./internal/agent/infrastructure -run 'TestClientForDaemon|TestServerLoads'passes, and the new cases fail without the fixtask precommit:runpassestask cleanup,task up, thenworkspaces,sniff:start,demo,secret:check,sniff:report,attack,netbird:statusandteleport:backall pass. The tokenless reply arrives over mTLS, the capture holds 0 packets on 52789 and 8443 and the canary, and both hops reject a missing client certificateOPENAI_API_KEY:task gateway:realtwice,attack. The Gateway serves mTLS withtcpSocketprobes.infer statusoninfer-k8sreaches it with its certificate and is rejected without it. The gateway's call to OpenAI comes back401for the dummy key, and the key never appears in the task output. A real model reply needs a real key and was not runNotes
spec.pod, v0.30.0), [BUG] Gateway with spec.server.tls never becomes Ready: probes stay HTTP on the TLS port operator#310 (TLS probes, v0.31.0), [FEATURE] Mutual TLS for the gateway server and its provider clients inference-gateway#817 (mTLS, v0.61.0), [FEATURE] TLS and mTLS for the tokenless server tokenless#90 (TLS, v0.11.0). [FEATURE] Gateway client TLS settings: a private CA and a client certificate #1672 is feat(gateway): trust a private CA and present a client certificate to the gateway #1673.0.0.0.0and a client certificate presented back to itself. Filed as [BUG] Provider calls loop through the gateway's own TLS listener, so server TLS needs an IP SAN for 0.0.0.0 and a client certificate for itself inference-gateway#822 and fixed in fix(providers): reach the gateway's own /proxy route in process inference-gateway#823 (v0.61.1), so the example pins 0.61.1 and needs neither.examples/kubernetes'smockgateway:imagetask still builds fromtests/mockgateway, which moved toinference-gateway/tokenless.Closes #1664