Re:Rustaceans at the border
by cillian64 on Friday April 15, 2022 @07:02AM
(#31038773)
This is more plausible for a language with a runtime like Python. But Rust is fundamentally designed to be a systems language where you have full access to everything (and, if you use unsafe, raw access to memory and arbitrary code execution). It’s hard to imagine how you’d add a sandboxing layer to the language, it seems more like something the OS would have to do for you.
[ Parent
| on HN ]
Re:Rustaceans at the border
by throwaway15908 on Friday April 15, 2022 @07:19AM
(#31038882)
On a broad scope, you could solve this at compile time. The source simply does not compile when filesystem or networking crates/builtins are not defined.
If you want to have more fine grained white listing, like only grant access to a certain directory, this could get really messy quick, trying to solve this at compile time.
Re:Rustaceans at the border
by oconnor663 on Friday April 15, 2022 @11:58AM
(#31041704)
You'd probably have to start by banning unsafe code in general, but then whitelisting/allowlisting specific versions of specific crates that are allowed to use it, so that at least the most popular dependencies don't break.