EEM FILTERS
EEM Filters: Filters in EEM help us to have fine grained control over the policies that we write. Using filters we can impose higher control over the authorizations using user details, groups details, session attributes, named attributes and request attributes.
This document assumes that you understand the EEM basics and know the usage of EEM UI in performing administrative tasks.
In this document, we will understand filters with the help of various examples.
<Please see attached file for image>
<Please see attached file for image>
<Please see attached file for image>
<Please see attached file for image>
<Please see attached file for image>
The following example checks for the action being equal to either of write or execute.
<Please see attached file for image>
<Please see attached file for image>
<Please see attached file for image>
The above six operators imply the natural meaning of a number being equal, not equal to, less than, greater than, less than or equal to, greater than or equal to the number being compared.
The below example applies a specific policy if the incorrect login count is lesser than or equal to three.
<Please see attached file for image>
<Please see attached file for image>
The above example tells us that the specified set of identities can "execute" all resources if the named attribute "release" is equal to 8 or 12 or contained within the range of 15-18 inclusive. So the release numbers allowed are 8, 12, 15, 16, 17, 18.
If the operator data type is selected as "BOOLEAN", the following operations can be performed.
The Boolean variable whose value is true can be specified in either of these ways: y, t, yes, true. They are case insensitive, remaining strings are treated as false. The following example gives the specified identities to access the change password page if the "ChangepasswordNextLogin" is set to true.
<Please see attached file for image>
If the operator data type is selected as "REGEX", the following operations can be performed:
They are similar to the match and not match definition of "STRING" data type.
Selecting the operator data type as "XPATH", has no real significance. If the operator data type has been selected as XPATH, the operations LIKE, NOTLIKE, MATCH, NOTMATCH, WITHINSET, NOTINSET, STARTSWITH, ENDSWITH, CONTAINS will be performed on the operands assuming them to be strings.
We have understood the operator data types and the operations. We will now have a closer look at the operands that can be used. We have already used some operands in our previous examples.
<Please see attached file for image>
Example:
The following filter illustrates that, the authorizing identity's either of the global groups must contain the name of the resource being protected.
The following example specifies that an identity can modify a specific resource if the user account is not suspended.
<Please see attached file for image>
<Please see attached file for image>
The following example illustrates submitting of an authorization event only if it was denied permission.
A safe context object can specify an environment. It is a set of name-value pairs. The following code snippet sets an environment attribute by key "os" and the value as the name of the operating system.
SafeContext safeContextObject = new SafeContext();
//set backend
// attach to the application
safeContextObject.insertEnvAttr("os", System.getProperty("os.name"));
The following filter tells to apply the policy only if the environement "os" attribute starts with "win" ( policy can only be applied if the EEM client environment is on windows).
<Please see attached file for image>
The below example specifies a policy which requires the resource to be compared of the form <global group name> + "-"+ <global user department>
<Please see attached file for image>
Below is the example of a nested calculation filter. It compares the resource being equal to
<user name> + ( <group name> - "d")
Please note that the "MINUS" operator for the string can only be used to subtract the trailing strings. For example if the group name is "abcdefd", the operation: <group name> - "d" on the group makes it to be "abcdef".
<Please see attached file for image>
REGEX, XPATH are not supported in calculations.
The operations supported under STRING for a calculation filter are:
<Please see attached file for image>
The string "motor " will be changed to "motor"
<Please see attached file for image>
The above filter returns the value of "tractor"
<Please see attached file for image>
The operations supported under INT32, UNIT32 for a calculation filter are:
The operations supported under REAL32, REAL64 for a calculation filter are:
The operations supported under TIMESTAMP are:
The filters are written sequentially, where the logic and the parenthesis fall in order.
<Please see attached file for image>
<Please see attached file for image>
<Please see attached file for image>
As the resource operations are performed case sensitively, group1-security != Group1-security
If the LHS had contained, say a dynamic group instead of resource, the comparison would have been successful.