Editing Java security manager policy

41 views
Skip to first unread message

Matthew Gerber

unread,
Mar 1, 2021, 11:55:53 PM3/1/21
to robocode-developers
Hello - 

It appears that the default Java security manager policy that comes with Robocode is very restrictive (a good thing). I know that we can completely disable the security manager as described here (e.g., to let robots use third-party libraries or make network connections); however, disabling the security manager isn't ideal. I would rather add a few specific "grant" rules to the security policy that permit just the actions I'm interested in. Is there a way to edit the security policy that comes with Robocode? I looked through the source but didn't find anything obvious.

Thanks!

Matt Gerber

Pavel Šavara

unread,
Mar 2, 2021, 8:41:43 AM3/2/21
to robocode-...@googlegroups.com
Hi Matt,

for security, have a look at RobocodeSecurityPolicy. 
There is system property OVERRIDEFILEREADSECURITY. You could take inspiration and implement something similar for networking. I don't know much about the topic, but it seems to me that URLPermission or SocketPermission would be the way to go.

We are open to PR contributions. Note, that such settings would not be enabled on any Rumble server, so such robot would only work in your own environment.

About reinforcement learning, please share your journey with us. I'm definitely very interested.

Cheers
Pavel


--

---
You received this message because you are subscribed to the Google Groups "robocode-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robocode-developers/3f67d627-3017-48b0-aae4-2e1a666149c7n%40googlegroups.com.

Matthew Gerber

unread,
Mar 3, 2021, 12:04:57 AM3/3/21
to robocode-...@googlegroups.com
Hi Pavel - 

Thanks for the tip! I was able to get it working as you suggested. The commit is here for reference. I like this much better than disabling the security manager altogether.

Perhaps once the work matures a bit I'll create a PR for general consumption. Until then I'm building and distributing my own custom Robocode installer with the modifications I need.

General information about my RL package is here, and stuff specific to Robocode is here (work in progress).

I think Robocode is a good environment in which to play around with RL. It's definitely a challenge (continuous state and action spaces, multiple agents, etc.). Feel free to ask questions.

Matt


Reply all
Reply to author
Forward
0 new messages