Class ScriptSandboxRuntime
java.lang.Object
com.xebialabs.xlrelease.script.security.ScriptSandboxRuntime
Central gate for Security-Manager-based script sandbox code paths.
The JVM version is determined automatically from the actual running JVM via
Runtime.version().feature().
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFirst JDK feature version where the Security Manager can no longer be enabled (JEP 486). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanSM APIs are only used when the actual running JVM is older than 24.static booleanshouldSandboxScript(boolean checkPolicyPermissions, boolean sandboxEnabled) Determines whether sandbox restrictions should apply to a script execution.
-
Field Details
-
SECURITY_MANAGER_UNAVAILABLE_FROM
public static final int SECURITY_MANAGER_UNAVAILABLE_FROMFirst JDK feature version where the Security Manager can no longer be enabled (JEP 486).- See Also:
-
-
Method Details
-
isSecurityManagerAvailable
public static boolean isSecurityManagerAvailable()SM APIs are only used when the actual running JVM is older than 24. -
isSandboxActive
public static boolean isSandboxActive() -
shouldSandboxScript
public static boolean shouldSandboxScript(boolean checkPolicyPermissions, boolean sandboxEnabled) Determines whether sandbox restrictions should apply to a script execution.On JVMs that still support Security Manager, sandboxing requires both sandbox config and an active Security Manager. On JDK 24+, Security Manager is not available, so sandbox config alone enables non-SM restrictions.
-