[Proposal] Dynamic native modules #577
gbryant-arm
started this conversation in
Ideas
Replies: 2 comments
-
Some questions:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Another existential consideration: do we want uniformity / homogeneity between different types of sandboxes such that for example a pipeline of both wasm and native programs can be constructed? This has implications for the sandbox API surface too, especially if we add a Morello sandbox type as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
It became apparent with #568 and #571 that integrating complex software with Veracruz is tedious. One reason for this is that complex software has its own build system, which isn't necessarily compatible with ours and requires some adjustments, e.g. installing additional packages in the build image or changing our build scripts.
On another note, there hasn't been any effort yet towards separating native modules from the runtime's TCB, which is a security liability.
We propose the introduction of dynamic native modules to:
kernel; the user's TCB stays the same but they can decide which modules they trust
High-level considerations
Threat model
The crux of dynamic native modules resides in our capacity to sandbox them.
There is a tradeoff between I/O performance, usability and isolation, directly determined by our choice of sandboxing. For now, we propose to focus on applications that don't require high throughput between WASM programs and native modules, as opposed to e.g. short-lived services where a significant initialization overhead is not an option, or high I/O applications.
We propose the following threat model:
Native module packaging, provisioning and attestation
Not unlike a Linux package, a native module is a program shipped as an archive of binaries, dynamic libraries and other files required for computation that aren't provided by the participants (e.g. database). We could opt for a standard format like Debian packages or tar/zip balls.
The native module must implement a standard ABI ((de)serialization) to read the caller's (WASM program) input and write the results after computation.
The native module must specify an entry point (i.e. what binary should be run when the service is invoked).
The native module's package location (e.g. github release and version/hash) and target (executing platform) must be specified in the policy.
The package must be fetched by the Runtime Manager and attested (file hash) before computation, and should probably be cached in the runtime, possibly pushed to the (untrusted) disk to speed context initialization.
The policy must specify which programs can access the native module's interface file (e.g. /services/tflite).
Execution model
The execution is similar to a FaaS:
Technical choices
Sandbox
Hypervisor-based solutions: overkill
Docker: complex, big overhead starting/killing containers, requires a modern and full-fledged operating system
sandbox2: self contained, doesn't depend on any recent kernel features; policy mostly describes allowed/forbidden syscalls and fs access, but also supports eBPF
ABI (serialization, IPC)
Between WASM and native modules: keep using postcard on top of the fs
Between Runtime Manager and sandbox: Runtime Manager execs sandbox with optional CLI arguments (one-way communication)
Beta Was this translation helpful? Give feedback.
All reactions