Skip to content

Commit 63b6086

Browse files
committed
fix(network): harden additional CA propagation
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
1 parent 86763f8 commit 63b6086

30 files changed

Lines changed: 1784 additions & 3324 deletions

File tree

‎.rpi/tasks/network-supervisor-additional-ca/01-research-questions.md‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎.rpi/tasks/network-supervisor-additional-ca/02-research.md‎

Lines changed: 0 additions & 155 deletions
This file was deleted.

‎.rpi/tasks/network-supervisor-additional-ca/03-design-discussion.md‎

Lines changed: 0 additions & 527 deletions
This file was deleted.

‎.rpi/tasks/network-supervisor-additional-ca/04-structure-outline.md‎

Lines changed: 0 additions & 1114 deletions
This file was deleted.

‎.rpi/tasks/network-supervisor-additional-ca/05-implementation.md‎

Lines changed: 0 additions & 1244 deletions
This file was deleted.

‎.rpi/tasks/network-supervisor-additional-ca/state.json‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎.rpi/tasks/network-supervisor-additional-ca/task.md‎

Lines changed: 0 additions & 46 deletions
This file was deleted.

‎crates/openshell-core/src/network_trust.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ use std::fmt;
1212
use std::path::{Path, PathBuf};
1313
use std::sync::Arc;
1414

15+
/// Maximum number of normalized PEM bytes accepted for destination trust.
16+
///
17+
/// This bound is shared by the gateway normalization boundary and all compute
18+
/// driver consumers. Kubernetes counts the `ca.crt` key and value toward its
19+
/// 1 MiB `ConfigMap` data limit, so reserve the six key bytes here to keep every
20+
/// supported driver on the same deployable boundary.
21+
pub const MAX_NETWORK_SUPERVISOR_TRUST_BUNDLE_BYTES: usize = 1024 * 1024 - "ca.crt".len();
22+
1523
/// Normalized, gateway-owned trust material for sandbox destination TLS.
1624
///
1725
/// The PEM bytes contain only canonical X.509 certificate blocks. The type is

‎crates/openshell-driver-kubernetes/README.md‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,30 @@ pods do not need direct external ingress for SSH.
115115

116116
Additional sandbox destination roots use the global
117117
`[openshell.supervisor.network].additional_ca_cert_paths` setting rather than a
118-
Kubernetes driver key. Before sandbox creation, the in-process driver
119-
server-side-applies one normalized `ca.crt` ConfigMap named
120-
`openshell-network-additional-ca-<gateway-id>` in the selected shared, managed,
121-
or operator namespace. Combined topology mounts it only in the agent container
122-
that runs network supervision. Sidecar topology mounts it only in
123-
`openshell-network`; workload and init containers do not receive it. Both use
124-
the read-only `/etc/openshell-tls/network-additional-ca.crt` path and the
118+
Kubernetes driver key. Before sandbox creation, the in-process driver GETs one
119+
deterministically named normalized `ca.crt` ConfigMap,
120+
`openshell-network-additional-ca-<gateway-id>`, in the selected shared,
121+
managed, or operator namespace. It creates the object when absent, handles a
122+
create conflict by rereading it, and accepts an existing object only when both
123+
`openshell.ai/managed-by=openshell` and the matching
124+
`openshell.ai/gateway-id` labels are present. Only after that check does it use
125+
forced server-side apply, allowing a restarted same-owner gateway to replace a
126+
stale field manager's data while never adopting a foreign object. The normalized
127+
PEM is bounded below Kubernetes's 1 MiB ConfigMap limit.
128+
129+
Combined topology mounts it only in the agent container that runs network
130+
supervision. Sidecar topology mounts it only in `openshell-network`; workload
131+
and init containers do not receive it. Both use the read-only
132+
`/etc/openshell-tls/network-additional-ca.crt` path and the
125133
`--network-additional-ca-bundle` argument. This material augments destination
126134
trust and remains separate from callback mTLS Secrets and corporate-proxy trust.
127-
Running supervisors load it only at startup.
135+
Running supervisors load it only at startup. When the global setting is removed,
136+
newly created or recreated pods receive no ConfigMap volume or mount; existing
137+
supervisors retain their startup material until restarted. The driver
138+
intentionally has no list/delete permission, so unused managed ConfigMaps can
139+
remain. After verifying no sandbox uses it, an operator can identify the exact
140+
name plus the managed-by and gateway-id labels and delete that named ConfigMap
141+
from the relevant namespace.
128142

129143
The driver forwards the canonical main-process specification to the process
130144
supervisor and sets pod `restartPolicy: Never`. Main-process environment

0 commit comments

Comments
 (0)