public class ProfilingSecurityManager extends SecurityManager
ProfilingSecurityManageris a Java security manager that profiles what resources an application accesses, and in what manner --- e.g., read, write, etc. It does not enforce a security policy, but rather produces a starting point for crafting one.
java.lang.SecurityManager and overrides the two forms of the
For each call to
ProfilingSecurityManager first guards against the
condition that it itself induced the call to
checkPermission(), which would result in
unterminated recursion. If a call to
checkPermission() resulted from a call outside
ProfilingSecurityManager, the current context is examined and each class found therein is
profiled as needing access to the
java.security.Permission in question.
Profiling is manifested as a writing to
System.out a "grant" rule for each
on a per
The implementation here does some very simple rule caching. If a rule has been seen previously, it is not output to System.out.
The caching cannot prevent a security check, but it can reduce I/O during profiling.
|Constructor and Description|
|Modifier and Type||Method and Description|
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkExit, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, checkWrite, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoader
public void checkPermission(Permission permission)
public void checkPermission(Permission permission, Object context)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.