You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49f2d31
Browse filesBrowse the repository at this point in the historyBrowse files
feat(kubernetes): support corporate proxy CA bundle
The Kubernetes driver had no way to supply a CA bundle for the corporate
egress proxy, so an `https://` proxy with a private CA, or a TLS-intercepting
proxy, could not be used. Podman and VM already expose `proxy_ca_bundle`.
Add `proxy_ca_bundle` to `[openshell.drivers.kubernetes]` as a path the
gateway Pod reads. The gateway stages the PEM into the existing
per-generation supervisor bootstrap Secret and passes
`--upstream-proxy-ca-bundle` on the supervisor argv. That Secret is already
immutable, owner-referenced and garbage-collected, and its volume mounts
every key at /.openshell/supervisor with no items filter, so this needs no
new object kind, volume, mount, or RBAC verb, and works in shared, managed
and operator workspace modes.
The bundle is deliberately read from the gateway's filesystem rather than
referenced as an object in the sandbox namespace. It becomes a trust anchor
for every upstream the sandbox reaches, so it must stay in the gateway's
trust domain; the immutable staging Secret also keeps the anchor from
changing underneath a running sandbox.
Bound the staged bundle at 256 KiB. The shared reader's limit is exactly the
apiserver's own Secret limit and the bootstrap Secret carries four other
keys, so a bundle between the two would pass gateway startup and then fail
every sandbox create with an opaque `data: Too long`.
Delegate the URL, no_proxy, connect_by_hostname and ca_bundle rules to the
shared validate_upstream_proxy_settings, keeping the Secret-specific
credential block local: this driver accepts an explicit
`proxy_auth_allow_insecure = false` without credentials, which the shared
rules reject. This also fixes the acknowledgement being demanded for an
`https://` proxy, where the credential travels inside the verified TLS
session. Add auth_setting_label so the inline-credential diagnostic names
the Secret keys instead of proxy_auth_file, which this driver rejects as an
unknown key.
Document that the bundle should carry only the CA that signs the proxy's
certificate, or that an intercepting proxy re-signs upstream certificates
with. Public roots already reach the sandbox through the supervisor image and
its TLS stack, and the bundle is concatenated with that system store into a
single boundary control frame, so a full merged trust bundle spends the frame
budget on duplicated roots. The frame, not the apiserver Secret limit, is the
tighter of the two ceilings in practice; raising the staging bound requires
checking it.
ClosesNVIDIA#3443
Signed-off-by: Philippe Martin <[email protected]>
Copy file name to clipboardExpand all lines: architecture/sandbox.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -461,6 +461,15 @@ every intercepted upstream connection failing. The bundle is valid with either
461
461
an `http://` or `https://` proxy (an intercepting proxy can be reached over
462
462
plain HTTP) and is fail-closed: an unreadable or certificate-free file is fatal.
463
463
464
+
How the bundle reaches the supervisor is driver-specific. Drivers that run the
465
+
supervisor locally bind-mount the operator's file. The Kubernetes driver cannot:
466
+
the supervisor Pod is scheduled remotely, and a trust anchor for every upstream
467
+
the sandbox reaches must not be sourced from the workload namespace, where it
468
+
would widen to anyone holding write access there. The gateway instead reads the
469
+
PEM from its own filesystem and stages it into the per-generation supervisor
470
+
bootstrap Secret, which is immutable, so the anchor cannot change underneath a
471
+
running sandbox.
472
+
464
473
Proxy credentials are never embedded in the URL: an inline `user:pass@` is
465
474
rejected because it would be stored in `gateway.toml` and exposed in container
466
475
metadata. Operators supply credentials via `proxy_auth_file`; the driver
use openshell_core::driver_utils::{UpstreamProxyUrlError, parse_upstream_proxy_url};
381
-
382
-
ifletSome(url) = &self.https_proxy{
383
-
parse_upstream_proxy_url(url).map_err(|err| match err {
384
-
UpstreamProxyUrlError::Empty => "https_proxy must not be empty when set".to_string(),
385
-
UpstreamProxyUrlError::InlineCredentials => "https_proxy must not embed credentials in the URL; supply them through proxy_auth_secret_name and proxy_auth_secret_key".to_string(),
// Credentials are validated below, so the shared auth fields stay
437
+
// unset; this label only redirects the inline-credential
438
+
// diagnostic away from `proxy_auth_file`, which this driver
439
+
// rejects as an unknown key.
440
+
auth_setting_label:Some("proxy_auth_secret_name and proxy_auth_secret_key"),
441
+
..UpstreamProxySettings::default()
442
+
})?;
443
+
444
+
// A credential sent to an `https://` proxy travels inside the verified
445
+
// TLS session to that proxy, so the cleartext acknowledgement below is
446
+
// only meaningful for an `http://` one. The URL already parsed above.
returnErr("proxy credentials use cleartext Basic auth over the connection to the http:// proxy; set proxy_auth_allow_insecure = true to accept that exposure, or remove the credential Secret".to_string());
returnErr("proxy credentials use cleartext Basic auth over the connection to the http:// proxy; set proxy_auth_allow_insecure = true to accept that exposure, use an https:// proxy, or remove the credential Secret".to_string());
0 commit comments