Saturday, April 24, 2021

Get the Request Objects & Request Object

  <?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">

<Rule language="beanshell" name="Get Request Objects">

  <Description>

  </Description>

  <Signature>

    <Inputs>

      <Argument name="log">

        <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.

        </Description>

      </Argument>

    </Inputs>

  </Signature>

  <Source>

import sailpoint.api.SailPointContext;

import sailpoint.object.Request;

// fetch all the request objects

String ruleName = "getResourceObjects";

log.error("Entering into the rule : " + ruleName);

List<Request> requests = context.getObjects(Request.class);

log.error("Exiting from the rule : "+ruleName);

return requests;

</Source>

</Rule>


------------------------------------------------##################-------------------------------------------------

------------------------------------------------##################-------------------------------------------------


 <?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">

<Rule language="beanshell" name="Get Request Object">

  <Description>

  </Description>

  <Signature>

    <Inputs>

      <Argument name="log">

        <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.

        </Description>

      </Argument>

    </Inputs>

  </Signature>

  <Source>

import sailpoint.api.SailPointContext;

import sailpoint.object.Request;

// fetch specific request object

String ruleName = "getResourceObject";

log.error("Entering into the rule : " + ruleName);

String name2 = null;

boolean flag = false;

List<Request> requests = context.getObjects(Request.class);

log.error("Request objects size is : " + requests.size());

for (Request request2 : requests) {

                    String name = request2.getName();

                    flag = name.contains("999999");

if (flag) {

name2 = name;

break;

}

}

log.error("Exiting from the rule : "+ruleName);

return name2;

</Source>

</Rule>

Sunday, April 18, 2021

Password Decryption

 <?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">

<Rule language="beanshell" name="Password Decryption">

  <Description>

  </Description>

  <Signature>

    <Inputs>

      <Argument name="log">

        <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.

        </Description>

      </Argument>

    </Inputs>

  </Signature>

  <Source>

import sailpoint.api.SailPointContext;

String password = "1:3XlHok3A4TTAIpnoglhLFg==";

return context.decrypt(password);

</Source>

</Rule>

Thursday, April 15, 2021

How to find the percentage (%) burn in client hours?

Total Hours = 850, Burns Hours = 180

Total % left = Total Hours - Burns Hours / (1 % Total Hours) = 850 - 180 / 8.5    =  78.82 %

% Burn = 100 - Total % left = 100 - 78.82 = 21.17


Friday, April 9, 2021

Customization Rule

It's initially designed for non-rule based connectors to add Privileged flag to accounts. It can be used for customization of account attributes as well.

# Build Map equivalent for non-delimited file or JDBC connectors.
# It will runs during Account Aggregations.
e.g    :   
# Manipulating information in the incoming resource object (in place of Build Map rule)
# Determining what accounts are Privileged or System accounts

e.g :    1

import sailpoint.api.*;
import sailpoint.object.*;

String status = object.getAttribute("Status");

// fetching only Active accounts
if(status != null && !status.equalIgnoreCase(false)){
object.put("IIQDisabled","Boolean.FALSE");
object.put("Status","Active");
}

// fetching Inactive accounts
else {
object.put("IIQDisabled","Boolean.TRUE");
object.put("Status","Inactive");
}

return (ResourceObject)object;

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...