Class RestrictedMethodAuthorizer
- All Implemented Interfaces:
MethodInvocationAuthorizer
MethodInvocationAuthorizer used by Geode to
determine whether a Method is allowed to be executed on a specific
Object instance.
This authorizer addresses the four known security risks: Java Reflection,
Cache Modification, Region Modification and Region Entry Modification.
Custom applications can delegate to this class and use it as the starting point for providing use case specific authorizers.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestrictedMethodAuthorizer(Cache cache) Creates aRestrictedMethodAuthorizerobject and initializes it so it can be safely used in a multi-threaded environment. -
Method Summary
Modifier and TypeMethodDescriptionbooleanExecutes the authorization logic to determine whether themethodis allowed to be executed on thetargetobject instance.booleanisAllowedGeodeMethod(Method method, Object target) Executes the verification logic to determine whether thetargetobject instance belongs to Geode and whether themethodon thetargetobject instance is considered to be safe according to Geode security rules.booleanisPermanentlyForbiddenMethod(Method method, Object target) Executes the verification logic to determine whether themethodon thetargetobject instance is considered to be non safe according to Geode security rules.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.geode.cache.query.security.MethodInvocationAuthorizer
initialize
-
Field Details
-
UNAUTHORIZED_STRING
- See Also:
-
-
Constructor Details
-
RestrictedMethodAuthorizer
Creates aRestrictedMethodAuthorizerobject and initializes it so it can be safely used in a multi-threaded environment.If the
Cacheinstance passed as parameter was previously created by Geode, the authorizer will use the security service already configured in order to determine whether a specific user has read privileges upon a particular region. If theCacheinstance passed as parameter is a wrapper created by external frameworks, the authorizer will create a new instance of the security service using the configuration properties used to initialize the cache.Applications can also use this constructor as part of the initialization for custom authorizers (see
Declarable.initialize(Cache, Properties)), when using a declarative approach.- Parameters:
cache- theCacheinstance that owns this authorizer, required in order to configure the security rules used.
-
-
Method Details
-
isAllowedGeodeMethod
Executes the verification logic to determine whether thetargetobject instance belongs to Geode and whether themethodon thetargetobject instance is considered to be safe according to Geode security rules. If thetargetobject is an instance ofRegion, this methods also ensures that the user has theDATA:READpermission granted for the targetRegion.- Parameters:
method- theMethodthat should be verified.target- theObjecton which theMethodwill be executed.- Returns:
trueif and only if thetargetobject instance belongs to Geode and themethodis considered safe to be executed on thetargetobject instance according to the Geode security rules,falseotherwise.
-
isPermanentlyForbiddenMethod
Executes the verification logic to determine whether themethodon thetargetobject instance is considered to be non safe according to Geode security rules.The following methods are currently considered non safe, no matter what the
targetobject is:getClassreadObjectreadResolvereadObjectNoDatawriteObjectwriteReplace
-
authorize
Executes the authorization logic to determine whether themethodis allowed to be executed on thetargetobject instance. If thetargetobject is an instance ofRegion, this methods also ensures that the user has theDATA:READpermission granted for the targetRegion.- Specified by:
authorizein interfaceMethodInvocationAuthorizer- Parameters:
method- theMethodthat should be authorized.target- theObjecton which theMethodwill be executed.- Returns:
trueif themethodcan be executed on on thetargetinstance,falseotherwise.- See Also:
-