SecurityManager replacement

Jump to navigation Jump to search
Revision as of 7 July 2022 at 15:44.
The highlighted comment was created in this revision.

SecurityManager replacement

As per JEP411, SecurityManager is deprecated for removal as of Java 17. However, robocode (before Tank Royale) is fully dependent on SecurityManager in order to ensure fairness. Unfortunately, there are no official alternative to SecurityManager, which left us only three options:

  1. Stick to Java <=17, which may be the last LTS version with SecurityManager support.
  2. Switch to Tank Royale, and develop some container based security (which is platform dependent, unfortunately).
  3. Find alternatives to SecurityManager, which can be used in both original robocode and robocode Tank Royale. SecurityManager alternatives can be used as pure Java sandbox solution for Tank Royale, which is cross-platform.
    Xor (talk)11:19, 7 July 2022

    Good news: Java 9 Modules have complete support for encapsulation, which can be used as a shallow sandbox mechanism. Direct and reflective access to public members of non-exported packages are forbidden by the language, making robocode engine potentially safe from attacks. Custom ClassLoaders can be used to forbid or replace certain risky java APIs. File & network access can be further restricted by creating dedicated user, and Linux systems can take advantage of chroot & cgroup for enhanced control over resources.

    By taking advantage of multiple layers of security countermeasures, we can achieve even safer & fairer environments for robocode competitions.

      Xor (talk)16:44, 7 July 2022