Package org.apache.flink.core.security
Class FlinkSecurityManager
- java.lang.Object
-
- java.lang.SecurityManager
-
- org.apache.flink.core.security.FlinkSecurityManager
-
public class FlinkSecurityManager extends SecurityManager
FlinkSecurityManagerto control certain behaviors that can be captured by Java system security manager. It can be used to control unexpected user behaviors that potentially impact cluster availability, for example, it can warn or prevent user code from terminating JVM by System.exit or halt by logging or throwing an exception. This does not necessarily prevent malicious users who try to tweak security manager on their own, but more for being dependable against user mistakes by gracefully handling them informing users rather than causing silent unavailability.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckExit(int status)voidcheckPermission(Permission perm)voidcheckPermission(Permission perm, Object context)static voidforceProcessExit(int exitCode)Use this method to circumvent the configuredFlinkSecurityManagerbehavior, ensuring that the current JVM process will always stop via System.exit() or Runtime.getRuntime().halt().static voidmonitorUserSystemExitForCurrentThread()static voidsetFromConfiguration(Configuration configuration)static voidunmonitorUserSystemExitForCurrentThread()-
Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkWrite, checkWrite, getClassContext, getSecurityContext, getThreadGroup
-
-
-
-
Method Detail
-
setFromConfiguration
public static void setFromConfiguration(Configuration configuration)
-
monitorUserSystemExitForCurrentThread
public static void monitorUserSystemExitForCurrentThread()
-
unmonitorUserSystemExitForCurrentThread
public static void unmonitorUserSystemExitForCurrentThread()
-
checkPermission
public void checkPermission(Permission perm)
- Overrides:
checkPermissionin classSecurityManager
-
checkPermission
public void checkPermission(Permission perm, Object context)
- Overrides:
checkPermissionin classSecurityManager
-
checkExit
public void checkExit(int status)
- Overrides:
checkExitin classSecurityManager
-
forceProcessExit
public static void forceProcessExit(int exitCode)
Use this method to circumvent the configuredFlinkSecurityManagerbehavior, ensuring that the current JVM process will always stop via System.exit() or Runtime.getRuntime().halt().
-
-