Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Rules

Fundamentals of IdentityIQ Implementation


Overview
Rules
• Definition
• Implementation
• Logging and performance
• Execution

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 4


Rules

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 5


BeanShell Rules
• Small snippets of code that can control many aspects of IdentityIQ’s behavior
• Defined and stored as objects of type Rule
• Loaded from XML
• Exported from another IdentityIQ environment
• Created in developers favorite IDE*
• Created in the UI

Responsible rule development is an important skill


for the IdentityIQ Implementer!

*Integrated Development Environment

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 6


Rule Usage
Why Rules?
• Control the loading of account and group data during aggregation
• Define policy violations and how to display them
• Define values, lists of allowed values and validation logic for provisioning policies and
forms
• Control the behavior of certifications
• Control provisioning
• …and implement many other business goals

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 7


Anatomy of a Rule
• All rules include a type
• Type defines where in the UI the rule can be used
• All rules are passed two objects
• context – sailpoint.api.SailPointContext
• log – org.apache.log4j.Logger
• All rules have inputs and most expect return values
• Inputs/returns are defined in Rule Registry
• Return type specifies the actual Java Object being returned
• Object, Identity, Map, etc.
• Returns
• List of values being returned
• For Maps, this can be multiple entries
• For Object, this can be one of many types of object
• Rules can set values directly or perform other actions
• RuleRegistry documents each type of rule and its signature
• Console: get RuleRegistry “Rule Registry”
• Debug Page: select RuleRegistry object; open Rule Registry

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 8


Rule Registry Drives Rule Creation

type=AfterProvisioning ...
type=BeforeProvisioning ...
type=Correlation ...
type=IdentityCreation ...
...
Rule Registry

import sailpoint.object.Identity;
System.out.println(“In Creation Rule”); Set Password Default
identity.setPassword(“xyzzy”);

name=Set Password Default


type=IdentityCreation
Rule XML
...
import sailpoint.object.Identity;
System.out.println(“In Creation Rule”);
identity.setPassword(“xyzzy”);

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 9


Example Creation Rule - XML
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule created="1359045226692" id="ff8080813c6382d0013c6d6870c40226" language="beanshell" Rule Name
modified="1359068664579" name="Creation Rule - Set Password Default" type="IdentityCreation">
<Description>Identity creation rules are used to set attributes on new Identity objects when they are created </Description>
<Signature returnType="void">
<Inputs>
<Argument name="log">
Rule Type
<Description>
The log object associated with the SailPointContext.
</Description>
</Argument>
<Argument name="context">
<Description>
A sailpoint.api.SailPointContext object that can be used to query the database if necessary. Inputs standard to
</Description>
</Argument> all rules
<Argument name="environment" type="Map">
<Description>
Arguments passed to the aggregation task. Inputs specific to
</Description>

this rule
</Argument>
</Inputs>
</Signature>
<Source>
import sailpoint.object.Identity;
System.out.println("In Creation Rule"); Rule Script
identity.setPassword("xyzzy"); (BeanShell)
</Source>
</Rule>
Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 10
Rule Development
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule created="1359045226692" id="ff8080813c6382d0013c6d6870c40226" modified="1359068664579" language="beanshell"
name="Creation Rule - Set Password Default" type="IdentityCreation">
<Description>Identity creation rules are used to set attributes on new Identity objects when they are created … </Description>
<Signature returnType="void">
<Inputs>
<Argument name="log">
<Description>
Provided by
The log object associated with the SailPointContext. IdentityIQ
</Description>
</Argument>
<Argument name="context">
<Description>
A sailpoint.api.SailPointContext object that can be used to query the database if necessary.
</Description> Provided by
</Argument>
<Argument name="environment" type="Map"> Developer
<Description>
Arguments passed to the aggregation task.
</Description>

</Argument> Remainder –
</Inputs> Auto populated by
</Signature>
<Source> Rule Editor
import sailpoint.object.Identity; or
System.out.println("In Creation Rule");
identity.setPassword("xyzzy"); Provided by
</Source>
</Rule>
developer
Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 11
Creating Rules
IdentityIQ Deployment Accelerator (optional)
• Eclipse IDE Plug-in
• Features
• Create Rule – generates boilerplate Rule structure
• Syntax checking for BeanShell in rules/script sections
• Code-completion
• Import/Export of IdentityIQ artifacts to/from multiple deployments
• Compare local copy with deployed copy
• Remote debug viewer
• Process
• Download plugin from Compass (.jar file and workflow XML)
• Place .jar file in Eclipse directory: /dropins
• Import Workflow into each IdentityIQ system

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 12


Implementing Rules
• Check the signature
• Learn the inputs
• Learn the expected return values
• Read the description of the rule
• Look at examples
• Compass
• Documentation
• Rule Example file (/WEB-INF/config/examplerules.xml)
• General strategy
• Figure out what you have to work with (input variables) - A
• Can use println statements to see values being passed in
• Figure out what you need to return (from signature) - B
• Use API calls to get from A to B

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 13


Implementing Rules
toXml Method
• Output SailPoint objects
• Useful for:
• Determining what’s available when writing rules
• Showing the makeup of an Identity
• Showing contents of Provisioning Plans/Projects
• Supported by all objects in the sailpoint.object package

• Example code

Identity foo = context.getObjectByName(Identity.class,”spadmin”);


System.out.println(“Identity XML = “ + foo.toXml());

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 14


Rules – Logging
• Use built in log object (log4j) for logging
• Control logging via config file
• No need to comment/uncomment System.out.println() messages.

• Perform custom logging per rule


• Code
Logger mylogger =
Logger.getLogger("com.xxxx.yyyy.FinanceCorrelationRule ");
mylogger.debug(“This is a debug message.”);

• Log4j.properties file (turn it on or off)


log4j.logger.com.xxxx.yyyy.FinanceCorrelationRule =<loglevel>

• Include log4j Trace statement every 5 lines (best practice)


• Code
mylogger.trace(“Entering com.xxxx.yyyy.FinanceCorrelationRule.”);

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 15


Rules – Performance
• Be aware of Iterative Rules
• Rules that run many times
• Data Loading and Correlation
• BuildMap, MergeMaps, Transformation, ResourceObjectCustomization, Correlation
• Certification Generation
• Exclusion, Pre-Delegation
• Performance of these rules can have serious impacts
• BuildMap rule runs for every row in a 30,000 line file
• .02 seconds * 30,000 rows = 600 seconds or 10 minutes
• Small improvements in performance have major impact
• Pull non-iterative functions out of iterative rules
• Connections
• Lookups for correlations
• Use state object or CustomGlobal to store pre-calculated information for use during iterative
rules

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 16


Measuring Rule Performance
Meter Method
• Track number of calls • Example code
• Calculate min/max/avg execution time import sailpoint.api.Meter;
//Begin your code
• Debug Page  “wrench”  Call Meter.enterByName("MyMeter");
Timings //Do work
Meter.exitByName("MyMeter");
//End of code

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 17


Rules – Rule Libraries
• Create a rule containing convenience functions, etc.

<Rule name='My Library'>


<Source>
public void doSomething() { // do stuff }
</Source>
</Rule>

• Include this rule library in other rules, using:

<Rule…>
<ReferencedRules>
<Reference class='Rule' name='My Library'/>
</ReferencedRules>
<Source>
doSomething();
</Source>
</Rule>

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 18


Rules – Executing in Debug or Console
• Debug Page
• SailPoint context and logging objects auto-provided
• Additional arguments must be hard coded
• System.out sent to App Server Standard Out

• Console
• SailPoint context and logging objects auto-provided
• Arguments can be hard coded or provided in an XML file attributes map
• System.out will go to Console

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 19


Rules – Executing through Task
Run Rule Task

Note: Rule must include code to return status


return “Success”;
return “Failure”;

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 20


Rules – Reference
Compass Whitepapers
• BeanShell Developers Guide for IdentityIQ (BSDG)
• Contains examples, illustration and explanations for creating excellent code
• Rules in IdentityIQ
• Includes descriptions, usage, and examples of all IdentityIQ rule types

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 21


Knowledge Check

Copyright ©© SailPoint
Copyright SailPoint Technologies,
Technologies, Inc.
Inc. 2017.
2017. All
All rights
rights reserved.
reserved. 23
Tasks
Fundamentals of IdentityIQ Implementation
Overview
Tasks
• Defining and using
• Common tasks performance strategies
• Aggregation
• Refresh
• Anatomy
• Writing a custom task

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 26


Tasks
• Tasks perform periodic operations such as
• Aggregation
• Identity Refresh
• Running Rules
• System Maintenance
• Moving Certifications along and finishing them
• Checking for remediations
• Pruning or archiving old objects
• Running ordered set of tasks (Sequential Task Launcher)
• Performance of regularly scheduled tasks is critical to health of installation
• Aggregation
• Refresh
• Others dependent upon environment

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 28


Aggregation Performance Strategies
IdentityIQ Application
_________ _________
Process All _________ _________
_________ _________
• Every account read and processed _________ _________
_________ _________
• Task option Disable optimization of unchanged accounts = true _________ _________
_________ _________
_________ _________
_ _

IdentityIQ-based Optimization (default) _________


_________
_________
_________
• Every account read _________
_________
_________
_________
• Only those with changes are processed _________
_________
_________
_________
• Task option Disable optimization of unchanged accounts = false _________
_________
_________
_________
_ _

Custom Delta Processing _________


_________
_________
_________
• Manage own change (i.e. write changed accounts to a flat file and _________
_________
_________
_________
process flat file) _________ _________

• Task option Detect deleted accounts = false

Connector-based Delta Aggregation* _________


_________
_________
_________
• Read and process only accounts with changes that have taken place _________
_________
_________
_________
_______
_________
_________
_______
_________
after benchmark _________
_________
_________
_______
_________
_________
• lastModData, DirSync, usnChanged, etc. _______
_________
_________
_______
_________
_________
• Task option Enable Delta Aggregation = true _________
_

*Not supported by all connectors


Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 29
Aggregation Performance Strategies
Partitioning
• Connector level
• Supported connectors
• LDAP, AD, JDBC, Delimited File, PeopleSoft, SAP, etc.
• Limit partitions to less than 250
• All at aggregation level

• More information
• CompassIdentityIQ WhitepapersPartitioning Best Practices

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 30


Identity Refresh Performance Strategies
• Split Refresh into different tasks
• Attribute Refresh/Role/Entitlement Processing/Provisioning multiple times a day
• Policy Checking/Risk Scoring at less frequent intervals
• Refresh only Identities that have changed
• Delta refresh – aggregation marks cubes with changes for refresh processing
• Controllable with task options
• Filters, time stamp
• Divide and Conquer
• Multi-threading
• Runs on multiple threads on a single server
• Partitioning (mutually exclusive to multi-threading)
• Runs on multiple threads on multiple servers

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 31


Tasks – Anatomy of a Task
• Singleton tasks
• Specialized purpose
• One instance of the task can be defined per installation
Example: Check Expired Work Items
• Template tasks
• Support parameterization and creation of multiple instances of the same type of Task
Example: Account Aggregation

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 32


Tasks – Anatomy of a Task (Continued)
Task object (XML) <?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition created="1488766071434" executor="sailpoint.task.SequentialTaskExecutor"
Java class to formPath="/monitor/tasks/sequentialTask.xhtml" id="ff8080815aa15f43015aa15f728a01a5"
execute the task name="Sequential Task Launcher" progressInterval="5000" progressMode="String"
subType="task_item_type_generic" template="true" type="Generic">
<Description>
Task Name
Template for creating a task that runs multiple other tasks.
</Description>
<Signature>
Is it a template? <Inputs>
<Argument multi="true" name="taskList" type="TaskDefinition">
<Prompt>task_sequential_task_list</Prompt>
</Argument>

Task Signature </Inputs>
• Inputs to the task <Returns>
• Returns from the task <Argument name="tasksRun" type="string">
<Prompt>task_sequential_tasks_executed</Prompt>
</Argument>
</Returns>
</Signature>
Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 33
</TaskDefinition>
Tasks – Process and Objects

Task Definition Task Definition


Task Schedule
(Template) (Configured)

Configure
Choose Task Task Save Schedule
Parameters

Execute

Task Result

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 34


Tasks – Creating your own
• Extend a Java class off of sailpoint.task.AbstractTaskExecutor

• Implement the following methods:

public void execute(SailPointContext ctx, TaskSchedule sched, TaskResult


result, Attributes<String, Object> args) throws GeneralException

public boolean terminate()

• Compile your java class and put in the classpath of your Application Server

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 35


Tasks – Creating your own (continued)
• Create a TaskDefinition XML file that sets your Java class as the executor of the task.
• Load the TaskDefinition XML file
• Your task will be available to execute
• When it runs, the execute() method of your TaskExecutor is called
• When the task completes,
• Results are copied into a result variable and returned
• Results are available in the UI
• There is an example task and build/deploy environment in the training VM
• Search Task
• Searches through objects of a given class for a specified string

Copyright © SailPoint Technologies, Inc. 2017. All rights reserved. 36


Knowledge Check

Copyright ©© SailPoint
Copyright SailPoint Technologies,
Technologies, Inc.
Inc. 2017.
2017. All
All rights
rights reserved.
reserved. 37

You might also like