When using Java Security Manager for Jruby scripts, Is it possible give a particular script alone full permissions?
If you mean using the same security manager for different scripts that applies different permissions, then the answer is no, unless you write the security manager yourself to somehow be script-aware. There's no way to specify a script in a security policy file (like you would for classes). I see two options at the moment:
- Write a custom security manager that can be made aware of what script is running,
- Compile JRuby scripts to Java classes (using jrubyc --java) and apply the permissions to the different Java classes.
For help with 2, I suggest taking a look at Charlie's recent post.
There is potentially another answer: if you have separate security managers you want to apply to separate scripts, then you can always spin up separate JRuby instances in separate classloaders. They won't share anything and should remain pretty isolated. But Nick is right, there's nothing built into JRuby to sandbox individual scripts at the moment, and we don't have any plans to do so...