Results 1 to 6 of 6
- 07-03-2011, 01:23 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
Security Manager equivalent of the "setuid" bit
Hi,
I am working on an application where users can upload custom Javscript code, and my server runs this code (using the Rhino Script Engine). Of course I run the custom code under a very strict SecurityManager, to prevent the users from damaging my server. I don't allow any access to sockets, files, etc.
However, I do want to allow them to run some privileged actions in a limited way, for example, an action such as "readFactFromDatabase(a,b,c)" should go to a specific table in the database and read a specific row. This action cannot run under the strict SecurityManager because it uses sockets and files.
I need a mechanism that is similar to the "setuid" bit in Linux - something that allows a thread under some SecurityManager to run specific actions as if it had no SecurityManager.
I hope I explained myself correctly...
- 07-03-2011, 01:59 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
Make your SecurityManager switchable; i.e. when switched to false it allows everything, while being switched to true it does the checks it normally does. Ordinary code doesn't know about your switchable SecurityManager, only your code does and it switches it to false when it needs to.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 07-03-2011, 02:34 PM #3
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
Great idea, thanks!
But what if my system is open source? In this case, everyone will know the name of the switch field, and will be able to change it!
- 07-03-2011, 02:57 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
- 07-03-2011, 03:55 PM #5
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
I don't care if someones download the code, install it on their own servers, and change the security manager.
I only care about the code that I installed on my own server - I don't want that users who submit code will be able to disable the security manager.
Ah, but now I have an idea - use a custom configuration file with a "password" for disabling the security manager, such that every sysadmin that installs the code will set his/her own password. I have to try this.
- 07-12-2011, 09:52 AM #6
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Equivalent of " void* " in JAVA
By ABHIJEEEEEEET in forum New To JavaReplies: 7Last Post: 08-16-2010, 06:55 AM -
Equivalent of "char *" in JAVA
By ABHIJEEEEEEET in forum New To JavaReplies: 3Last Post: 08-11-2010, 11:37 AM -
Equivalent of "strtoul" in JAVA
By ABHIJEEEEEEET in forum New To JavaReplies: 5Last Post: 08-11-2010, 09:49 AM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks