3 ms·
Our programs are growing so big by having so many (indirect) dependencies that we need a way to sandbox the libraries that we include from our main programs. Th
by amelius 3y ago
Our programs are growing so big by having so many (indirect) dependencies that we need a way to sandbox the libraries that we include from our main programs. This is the type of safety that I'm looking for, really.
- zozbot234 3y agoJava can use SecurityManager to do this.
- prosody 3y agoIt's deprecated for removal.[0] [0] https://openjdk.org/jeps/411 https://openjdk.org/jeps/411
- kaba0 3y agoGraalVM has Isolates that can do this on a much more fine-grained level and with multiple languages (it can also run LLVM-languages now).
- mlinksva 3y agoI'd seen that https://www.graalvm.org/latest/security-guide/polyglot-sandbox/ https://www.graalvm.org/latest/security-guide/polyglot-sandb... is JavaScript-only at this point, I guess it must build on https://www.graalvm.org/latest/reference-manual/embed-languages/#polyglot-isolates https://www.graalvm.org/latest/reference-manual/embed-langua... and one could roll their own for any language? Is there a good example, doc, or is it even a thing, to use GraalVM Isolates to defend against Java supply chain attacks, nevermind other languages? I guess it might be possible, going by a comment on another thread https://news.ycombinator.com/item?id=38278131 https://news.ycombinator.com/item?id=38278131 but require careful construction of anything you'd want to have only the capabilities you pass to it? (Naive questions, apologies, I should really learn by trying it out instead!)
- kaba0 3y agoI believe it should work with any other Graal language (currently, JS, Python are the bigger ones and Sulong can run LLVM bytecode. There is also Espresso, which runs “java on top of java”, making it also eligible for these security boundaries). I don’t think it is too commonly used yet, but yeah, it can even do stuff like limit CPU usage within an isolate, so it should be more than possible to limit the scope of such an attack.
- mlinksva 3y agoI've been idly wondering, what is the relationship between memory unsafety, or more generally, undefined behavior, and ambient authority? For security purposes, is the former a special, unintended (for the most part, it's a bug) form of the latter?
- saagarjha 3y agoAddress spaces are typically difficult to mix things in, unfortunately. If you sandbox harder then it’s not actually very useful to have them in your process anymore.
- justincormack 3y agoSome people are looking at Wasm as a cross language way of doing this. Some work in language specific ways is also going on. Definitely an interesting area.
- EdSchouten 3y agoObject-capability models really shine there: https://en.m.wikipedia.org/wiki/Object-capability_model https://en.m.wikipedia.org/wiki/Object-capability_model What if the only way to access the file system was to call methods on an object that was provided to main()? Then libraries would only be able to access the file system if they got a reference to that object.
- mlinksva 3y agoThe OP does mention Austal as one of a few languages putting their own twist on Rust learnings, though the most interesting thing to me about Austral is indeed https://borretti.me/article/how-capabilities-work-austral https://borretti.me/article/how-capabilities-work-austral rather than simply memory safety (though that's essential too).