Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Security > Creating a Sand...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1743 of 1781
Post > Topic >>

Creating a Sandbox

by David 'Bombe' Roden <bombe@[EMAIL PROTECTED] > Nov 24, 2007 at 07:09 PM

Hi, everyone.

I'm trying to create a sandbox that executes code loaded from a JAR file
with reduced privileges. Unfortunately I'm a bit stuck. Here is what I
tried so far.

a) Created my own CodeSource and ProtectionDomain, used a custom
ClassLoader
(extending SecureClassLoader) and gave the ProtectionDomain to the
defineClass class. Then I created an AccessControlContext with the
ProtectionDomain, used the ClassLoader to load a class from a JAR file and
tried to execute a method on the JAR file with the created
AccessControlContext.

b) Installed a Policy that would return special Permission object when a
CodeSource from a JAR file is handed to getPermissions(). Then I create
two
classes from two different JAR files, create AccessControlContexts for
each
of them (using their getClass().getProtectionDomain()) and try to execute
the method: when the method on the first class is called,
getPermissions(CodeSource) on my custom policy is called but when I
execute
the method of the second class the policy is not asked, even with its
different ProtectionDomain.

So far I have not been successful using these (and other, more desperate)
methods. Is it really so hard to create a sandbox or am I missing some
im****tant point? Also, it's hard to find examples or other documentation
on
how to execute code with _less_ privileges, most of the code using
AccessController.doPrivileged() is aimed at executing code with _more_
privileges.


Grateful for any hints,

        David
 




 2 Posts in Topic:
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 

Post A Reply:
  Go here to Signup
Creating a Sandbox - Java Security
Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Security > Creating a Sand...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1743 of 1781
Post > Topic >>
<< Topic < Post Post 4 of 2 Topic 1743 of 1781
Post > Topic >>

Creating a Sandbox

by David 'Bombe' Roden <bombe@[EMAIL PROTECTED] > Nov 24, 2007 at 07:09 PM

Hi, everyone.

I'm trying to create a sandbox that executes code loaded from a JAR file
with reduced privileges. Unfortunately I'm a bit stuck. Here is what I
tried so far.

a) Created my own CodeSource and ProtectionDomain, used a custom
ClassLoader
(extending SecureClassLoader) and gave the ProtectionDomain to the
defineClass class. Then I created an AccessControlContext with the
ProtectionDomain, used the ClassLoader to load a class from a JAR file and
tried to execute a method on the JAR file with the created
AccessControlContext.

b) Installed a Policy that would return special Permission object when a
CodeSource from a JAR file is handed to getPermissions(). Then I create
two
classes from two different JAR files, create AccessControlContexts for
each
of them (using their getClass().getProtectionDomain()) and try to execute
the method: when the method on the first class is called,
getPermissions(CodeSource) on my custom policy is called but when I
execute
the method of the second class the policy is not asked, even with its
different ProtectionDomain.

So far I have not been successful using these (and other, more desperate)
methods. Is it really so hard to create a sandbox or am I missing some
im****tant point? Also, it's hard to find examples or other documentation
on
how to execute code with _less_ privileges, most of the code using
AccessController.doPrivileged() is aimed at executing code with _more_
privileges.


Grateful for any hints,

        David
 




 2 Posts in Topic:
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 

Post A Reply:
  Go here to Signup
Creating a Sandbox - Java Security
Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Security > Creating a Sand...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1743 of 1781
Post > Topic >>
<< Topic < Post Post 4 of 2 Topic 1743 of 1781
Post > Topic >>
<< Topic < Post Post 6 of 2 Topic 1743 of 1781
Post > Topic >>

Creating a Sandbox

by David 'Bombe' Roden <bombe@[EMAIL PROTECTED] > Nov 24, 2007 at 07:09 PM

Hi, everyone.

I'm trying to create a sandbox that executes code loaded from a JAR file
with reduced privileges. Unfortunately I'm a bit stuck. Here is what I
tried so far.

a) Created my own CodeSource and ProtectionDomain, used a custom
ClassLoader
(extending SecureClassLoader) and gave the ProtectionDomain to the
defineClass class. Then I created an AccessControlContext with the
ProtectionDomain, used the ClassLoader to load a class from a JAR file and
tried to execute a method on the JAR file with the created
AccessControlContext.

b) Installed a Policy that would return special Permission object when a
CodeSource from a JAR file is handed to getPermissions(). Then I create
two
classes from two different JAR files, create AccessControlContexts for
each
of them (using their getClass().getProtectionDomain()) and try to execute
the method: when the method on the first class is called,
getPermissions(CodeSource) on my custom policy is called but when I
execute
the method of the second class the policy is not asked, even with its
different ProtectionDomain.

So far I have not been successful using these (and other, more desperate)
methods. Is it really so hard to create a sandbox or am I missing some
im****tant point? Also, it's hard to find examples or other documentation
on
how to execute code with _less_ privileges, most of the code using
AccessController.doPrivileged() is aimed at executing code with _more_
privileges.


Grateful for any hints,

        David
 




 2 Posts in Topic:
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 

Post A Reply:
  Go here to Signup
Creating a Sandbox - Java Security
Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Security > Creating a Sand...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1743 of 1781
Post > Topic >>
<< Topic < Post Post 4 of 2 Topic 1743 of 1781
Post > Topic >>
<< Topic < Post Post 6 of 2 Topic 1743 of 1781
Post > Topic >>
<< Topic < Post Post 8 of 2 Topic 1743 of 1781
Post > Topic >>

Creating a Sandbox

by David 'Bombe' Roden <bombe@[EMAIL PROTECTED] > Nov 24, 2007 at 07:09 PM

Hi, everyone.

I'm trying to create a sandbox that executes code loaded from a JAR file
with reduced privileges. Unfortunately I'm a bit stuck. Here is what I
tried so far.

a) Created my own CodeSource and ProtectionDomain, used a custom
ClassLoader
(extending SecureClassLoader) and gave the ProtectionDomain to the
defineClass class. Then I created an AccessControlContext with the
ProtectionDomain, used the ClassLoader to load a class from a JAR file and
tried to execute a method on the JAR file with the created
AccessControlContext.

b) Installed a Policy that would return special Permission object when a
CodeSource from a JAR file is handed to getPermissions(). Then I create
two
classes from two different JAR files, create AccessControlContexts for
each
of them (using their getClass().getProtectionDomain()) and try to execute
the method: when the method on the first class is called,
getPermissions(CodeSource) on my custom policy is called but when I
execute
the method of the second class the policy is not asked, even with its
different ProtectionDomain.

So far I have not been successful using these (and other, more desperate)
methods. Is it really so hard to create a sandbox or am I missing some
im****tant point? Also, it's hard to find examples or other documentation
on
how to execute code with _less_ privileges, most of the code using
AccessController.doPrivileged() is aimed at executing code with _more_
privileges.


Grateful for any hints,

        David
 




 2 Posts in Topic:
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 
Creating a Sandbox
David 'Bombe' Roden <b  2007-11-24 19:09:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 5 19:19:32 CDT 2008.