-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore sandboxed build scripts #108
Comments
This issue is intended for status updates only. For general questions or comments, please contact the owner(s) directly. |
Key developments:Have been looking into different sandbox runtime choices. Here is a simple version of the comparison of three potential choices:
There are prior research on cross-over between each of these options. I've been busy these two weeks. Will update a more detail post for prior arts afterward. The biggest challenge I am seeing now is spawning external processes. Most build script usages invoke some external binaries, like The other huge headache is setting library search paths. We cannot know every possible path of system libraries ahead of time, but we need to grant access to the runtime. Blockers:None. Help wanted:None. |
Having a family urgency. I will be back after RustConf. |
Key developments:Building a workable version of wasm-based build script (not yet done). There are some technical difficulties. Not blocking but need to be addressed.
In order to make the development independent of Cargo,
Some compatibility issues came up when integrating with Cargo:
Blockers:None. Help wanted:None. |
Have a working-in-process pull request in weihanglo/cargo#66. Let me copy some texts from there :) What did we achieve in this experiment?As you can see, we can easily swap to any sandbox runner with a custom target. We use
According to the design axioms, Restrcting process spawning is the top one axiom. As a result, it is unlikely to use Other possibilitiesHave talked to some other folks, there are some potential route we could take if we chose wasi as a default sandbox environment. The offical
|
Key DevelopmentsUnfortunately, no significant progress has been made. However, we received feedback on the previous experiment: weihanglo/cargo#66. Alex, who has been working on WebAssembly and is also an honorable Rust project contributor, expressed interest in adding POSIX process support to WASI. However, according to their comments, this seems unlikely in the near future. While the experiment with a Cargo-flavored WASI standard library remains incomplete, it is still on my to-do list. At the very least, I want to give it a try and see how gnarly it would be. In this comment, Ralf pointed out that supporting process spawning may be somewhat pointless, as one of WASI's key selling points is avoiding the execution of external processes altogether. To me, this feels more like a UX design issue. For example, VS Code prompts users to "trust" a project when it is opened, although most users simply click "trust." With better UX design—such as interactive shell sessions for crate approvals or pre-approval lists from a company (similar to how cargo-vet operates)—an opt-in mechanism would be a better default than allowing everything by default. Samuel shared a project called build-wrap, which leverages Bubblewrap. While not cross-platform, the configuration interface of Bubblewrap is inspiring and worth exploring, particularly for how it sandboxes system libraries and binaries. Jeff suggested using the WebAssembly Component Model to allow interaction with a set of well-known programs (e.g., Not Rolling Over to 2025H1Despite the valuable feedback and interest, after discussions with the Cargo team, this initiative will not continue as a project goal for 2025H1. Instead, there are alternative approaches worth exploring that may require less effort or depend less on parallel developments in other technologies:
We want to explore various possibilities beyond the Wasm sandbox environment. That said, as mentioned earlier, personally I am still interested in experimenting further with Wasm. Sorry for not making more progress for the past month. |
Just found https://github.com/AsahiLinux/muvm. Also an interesting runtime choice. |
Summary
Explore different strategies for sandboxing build script executions in Cargo.
Tasks and status
The text was updated successfully, but these errors were encountered: