I would like to write a java security policy which allows all permissions, except of a specific type.
An example might be:
- app can only read system properties called
MY_ACCESSIBLE_SYSTEM_PROP_1
andMY_ACCESSIBLE_SYSTEM_PROP_2
- app cannot read any other system properties
- app cannot write any system properties
- there are no other security restrictions on the app
A security policy for this might look like:
grant {
permission java.util.PropertyPermission "MY_ACCESSIBLE_SYSTEM_PROP_1", "read";
permission java.util.PropertyPermission "MY_ACCESSIBLE_SYSTEM_PROP_2", "read";
}
...but what can I add to allow all other permissions except for java.util.PropertyPermission
?
I've read a lot of documentation and starting to think this is not possible with the default Java Security Manager. Should I just write my own security manager which allows any Permissions outside my area of interest?