Restricting access to code

Hi All,

I am facing a problem, regarding code security on a server.
We have configured a server which contains our code (ear present in jboss/server/xyz/deploy) in it, and need to bind the code to the server itself so that no one can take the code out of the. the problem is that the password of root for some reasons has to be shared with the users of the server, and we don't want them to create a copy of our code.

Are there some ways to achieve this ???

Since the users have access to the server as root, there's little you can do. The only thing I can think of is creating an encrypted volume that is mounted only on-demand. But during that time it's just as accessible as everything else.

By the way, when the higher-ups decided to share the root password, did they think of a way how to discover the person responsible in case something bad happens? rm -rf is a quick, yet deadly command...

I would recommend moving closer to a least privilege security model. If your OS has security labels, RBAC, or sudo you should convince your higher ups to implement them immediately. Now wouldn't be a bad time to test your backups either.

My understanding is that with JBoss as it stands, you can't.

I have a crazy idea though, yet I'm not even sure whether it makes sense or not as I have not tried it before. In theory, because class loading in Java is based on ClassLoader conceptually speaking you can create a custom classloader that does not load the bytecode from physical files (say, instead load the bytecode over the network on initialization). As the classes have been loaded they will reside in the permanent generation of the JVM (in memory anyway, simply speaking) and there ought to be no physical files on the deployment server. So, no one can find the files in the filesystem. This is not difficult, but how to integrate that custom classloader into JBoss may be more tricky and is likely not as simple as changing some mbean descriptors. Therefore, if you have an earnest need you may need to investigate the class loading of JBoss and think along this direction.

Do share with us (I'm particularly interested in hearing this) if you can actually make it work. :smiley: