The JVM running with a security policy can do this.
It's pretty rarely done though.
It's pretty rarely done though.
The Java Security Manager is an API that allows to intercept and run codes, so devs use it as a Trojan Horse to patch code instead of fixing the root of the issue.
The Java Security Manager should die.
But.. it is?
The JVM tracks where bytecode was loaded from, and then you can define a policy to limit what that code can do.
Here's an example giving read-only access to /etc
https://access.redhat.com/documentation/en-us/red_hat_jboss_...
Exactly. That is why I like the Deno solution even as a long time Java user: it is on by default and so simple that there is no reason to disable it.