Skip to content

Commit eda6cc1

Browse files
committed
chore: sync windows fixes into MXC TLS PR
Merge the current windows branch so CI includes the existing server test repairs and MXC fixes. Signed-off-by: Shailendra Singh <shailendras@nvidia.com>
2 parents d2efbe9 + cec319b commit eda6cc1

10 files changed

Lines changed: 2080 additions & 60 deletions

File tree

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

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,62 @@ command is supplied, the driver passes `mxc.command` to the supervisor rather
152152
than starting a scratch workload. An explicit generic canonical command retains
153153
precedence. Environment belongs in `--env` or `--env-from`, not gateway configuration.
154154

155+
The optional `mxc.denied_paths` lists paths the workload cannot open, including
156+
inside the policy's filesystem grants: it cannot read, write or delete a denied
157+
file, list a denied directory, or create a denied path by name. The driver
158+
passes the list to MXC as `filesystem.deniedPaths`. For example, with a policy
159+
that grants `C:\work\profile` read-write, to hide the credential files in it:
160+
161+
```powershell
162+
$config = '{"mxc":{"command":["C:\\Windows\\System32\\cmd.exe","/d","/c","agent.cmd"],"cwd":"C:\\work","denied_paths":["C:\\work\\profile\\.env","C:\\work\\profile\\auth.json"]}}'
163+
```
164+
165+
Each entry must be an absolute path that starts with a drive letter, such as
166+
`C:\work\profile\.env`; forward slashes are converted to backslashes. A denied
167+
path may be absent, but its parent directory must exist because MXC refuses to
168+
start the ProcessContainer otherwise; to cover a missing directory, deny the
169+
directory itself. An entry must not equal or contain a filesystem grant,
170+
including the generation staging directory under `cwd` and the sandbox
171+
executable: MXC drops a grant that equals a denied path and keeps access to a
172+
grant nested inside a denied directory.
173+
174+
MXC applies denied paths and grants to paths. The workload can rename a
175+
directory when the directory and its parent are both writable to it, and
176+
everything below that directory then sits at a path no denied path or read-only
177+
grant names. Preflight therefore rejects an entry below such a directory: two
178+
or more levels below a read-write grant root, inside a read-write grant nested
179+
in another read-write grant, or below a read-only grant whose root is two or
180+
more levels inside a read-write grant. The error names the directory; deny it
181+
instead, or move the entry directly into the read-write grant root. Entries
182+
directly inside a read-write grant root whose parent the workload cannot write,
183+
and entries below a read-only grant root that cannot be renamed, are accepted.
184+
185+
MXC resolves 8.3 short names, junctions and letter case, and accepts grants in
186+
the `\\.\C:\`, `\\?\C:\`, `\??\C:\`, `\\?\GLOBALROOT\Device\...` and
187+
`\\?\Volume{...}\` spellings, so preflight compares resolved drive paths
188+
(following symbolic links too). The parts of a drive path that do not exist, or
189+
that cannot be resolved, are compared as written. While `denied_paths` is not
190+
empty, preflight rejects a grant it cannot resolve to a drive path: a UNC path,
191+
which MXC grants no access through, a path without a drive letter, or a device
192+
path that does not resolve.
193+
194+
A denied path protects contents. The file's name, size, timestamps and
195+
attributes remain visible to the workload, for example when it lists the parent
196+
directory, and a hard link to the same file, created on the host before launch
197+
at a path the workload can read, still exposes the contents. MXC does not check
198+
the target of a rename against `deniedPaths`: when the parent directory is
199+
writable, the workload can rename one of its own files onto a denied name,
200+
which replaces a denied file on the host, or creates the file or directory when
201+
it is absent. The original contents stay unreadable, and an existing denied
202+
directory cannot be replaced. Denying the directory that holds such files
203+
prevents this, because nothing can be renamed into a denied directory.
204+
205+
Denied paths only remove access and are fixed at sandbox creation. They require
206+
a host whose `wxc-exec.exe --probe` reports
207+
`probes.baseContainerSupportsDenyPaths: true`. When the list is not empty, the
208+
driver sends MXC `fallback.allowDaclMutation: false`, so on a host without that
209+
support the launch fails and MXC does not change the ACLs of host files.
210+
155211
When gateway TLS is enabled, configure the gateway-owned `guest_tls_ca`.
156212
The host supervisor verifies the gateway certificate with that CA and uses
157213
main's launch authentication bundle. Gateway client certificates and keys are
@@ -168,6 +224,18 @@ not required; driver-owned guest TLS fields are rejected.
168224
| ETW/OCSF audit | Optional Windows Sandboxing ETW consumer |
169225
| Gateway restart recovery | Not yet supported; live MXC generations remain in-memory |
170226

227+
Workloads receive the proxy CA in `NODE_EXTRA_CA_CERTS` and `DENO_CERT`, and a
228+
combined bundle in `SSL_CERT_FILE`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, and
229+
`GIT_SSL_CAINFO`. The combined bundle holds the server-authentication roots of
230+
the host user's Windows certificate store followed by the proxy CA, so clients
231+
that read it also verify servers behind `tls: skip` endpoints, which the proxy
232+
does not terminate. Schannel clients such as Windows `curl.exe` ignore these
233+
variables unless the bundle is passed explicitly. Windows adds a Microsoft
234+
program root to the store the first time a Schannel client needs it, so the
235+
bundle lacks program roots that the host has not used yet. If the store roots
236+
encode to more than 896 KiB of PEM, the supervisor logs a warning and the
237+
bundle holds only the proxy CA.
238+
171239
UI controls are startup settings in the sandbox policy:
172240

173241
```yaml

0 commit comments

Comments
 (0)