Labels
- AD (8)
- Aggregation (8)
- Audit Management (1)
- AWS (1)
- Certification (7)
- Compass_Useful_Links (1)
- Courses (1)
- Custom Reports (3)
- Custom Tasks (5)
- Database (OIM) (3)
- Database (Sailpoint) (2)
- E-Fix (3)
- Eclipse (2)
- EmailTemplate (1)
- Excel (7)
- Forgerock (1)
- Forms (4)
- GitHub (6)
- Group Management (3)
- IIQ Console Commands (1)
- IQ Service (1)
- ISC (22)
- ISC Application Management (2)
- ISC-LifeCycleState (1)
- ISC-Transforms (1)
- ISC-VSCode (1)
- Java (13)
- JML (1)
- Kanada (1)
- LCM (4)
- Linux (3)
- Loggers (3)
- MS Office (1)
- MySQL (8)
- Notifications (1)
- OIM (19)
- Password Management (2)
- Policy Violation (2)
- Provisioning (1)
- ProvisioningPlan (1)
- Quicklink (1)
- RBAC (4)
- References (1)
- Role Management (3)
- Rules_Scripts_APIs (33)
- Sailpoint (34)
- SailPoint - Certification (1)
- SailPoint - Glossary (2)
- Sailpoint API's (7)
- SailPoint Best Practices (1)
- Scripts (1)
- SHF - Application Management (1)
- SHF - VA (1)
- Softwares (1)
- SSB (2)
- UAT (1)
- UI (2)
- UI/Task Server Configuration (1)
- Upgradation (1)
- VM Ware (1)
- Web Service (9)
- Workflow (8)
- Workgroup (2)
- XML (1)
Monday, August 21, 2023
Set TaskStatus
import org.apache.commons.logging.Log;
import sailpoint.api.SailPointContext;
import sailpoint.object.TaskResult;
import sailpoint.tools.GeneralException;
public class SetTaskStatus {
static Log log = null;
static SailPointContext context = null;
public static void main(String[] args) {
int count = 316;
TaskResult taskResult = null;
try {
taskResult = context.getObjectByName(TaskResult.class, "Mighty Task");
if (taskResult != null) {
taskResult.addAttribute("count", count);
taskResult.setCompletionStatus(taskResult.getCompletionStatus().Success);
}
} catch (GeneralException e) {
log.error("GeneralException: " + e.getMessage());
taskResult.setCompletionStatus(taskResult.getCompletionStatus().Error);
}
}
}
GroupAggregation Rule for Description
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.apache.commons.logging.Log;
import sailpoint.api.SailPointContext;
import sailpoint.object.Application;
import sailpoint.object.Identity;
import sailpoint.object.ManagedAttribute;
import sailpoint.object.ResourceObject;
import sailpoint.tools.GeneralException;
public class GroupAggrgationRuleForDesc {
static Log log = null;
static SailPointContext context = null;
static Map environment = null;
static ResourceObject obj = null;
static Application groupApplication = null;
static ManagedAttribute accountGroup = null;
public static void main(String[] args) {
Identity workGroup = null;
Map map = new HashMap();
try {
workGroup = context.getObjectByName(Identity.class, accountGroup.getValue());
accountGroup.setOwner(workGroup.getOwner());
accountGroup.setRequestable(false);
map.put(Locale.US.toString(), workGroup.getDescription());
accountGroup.setDescriptions(map);
} catch (GeneralException e) {
log.error("GeneralException: " + e.getMessage());
}
}
}
Exclusion Rule for Entitlement1
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import sailpoint.api.SailPointContext;
import sailpoint.object.Attributes;
import sailpoint.object.Certifiable;
import sailpoint.object.EntitlementGroup;
import sailpoint.object.Filter;
import sailpoint.object.ManagedAttribute;
import sailpoint.tools.GeneralException;
public class WorkgroupECertExclusionRule {
static SailPointContext context = null;
static Log log = null;
static List items = null;
static List itemsToExclude = null;
static String explanation = null;
static String excludeEntitlement() {
log.debug("Entering into Exclusion Rule");
ManagedAttribute access = null;
// ManagedAttribute access = null;
String accessCert = null;
Attributes attrs = null;
String appName = null;
String entAttrName = null;
String entAttrVal = null;
Filter masterFilter = null;
List entitlementList = new ArrayList();
for (Iterator iterator = items.iterator(); iterator.hasNext();) {
try {
Certifiable certifiable = (Certifiable) iterator.next();
if (certifiable instanceof EntitlementGroup) {
EntitlementGroup entitlementGroup = (EntitlementGroup) certifiable;
appName = entitlementGroup.getApplicationName();
attrs = entitlementGroup.getAttributes();
entAttrName = attrs.getKeys().get(0).toString();
entAttrVal = attrs.getString(entAttrName);
masterFilter = Filter.and(new Filter[] { Filter.eq("value", entAttrVal),
Filter.eq("attribute", entAttrName), Filter.eq("application.name", appName) });
access = context.getUniqueObject(ManagedAttribute.class, masterFilter);
accessCert = access.getAttribute("certifiable").toString();
if (!accessCert.equalsIgnoreCase("True")) {
itemsToExclude.add(certifiable);
iterator.remove();
explanation = "No need to certify these items";
}
}
} catch (GeneralException e) {
log.error("GeneralException in exclusion: " + e.getMessage());
}
}
items.addAll(entitlementList);
log.debug("Exiting from Exclusion Rule");
return explanation;
}
public static void main(String[] args) {
String message = excludeEntitlement();
}
}
Friday, August 18, 2023
Password Generation2
import java.util.Random;
public class PasswordGeneration2 {
static String passwordGenerator2() {
int length = 15;
String password = "";
String numbers = "1234567890";
String speacialCharacters = "!@#$%";
// String speacialCharacters = "";
String upperCaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
String lowerCaseLetters = "abcdefghijklmnopqrstuvwxyz";
String passowrConcat = upperCaseLetters + lowerCaseLetters + speacialCharacters + numbers;
Random random = new Random();
for (int i = 0; i < length; i++) {
int index = random.nextInt(passowrConcat.length());
password += passowrConcat.charAt(index);
}
return password;
}
public static void main(String[] args) {
String retValue = passwordGenerator2();
}
}
Password Generation1
Tuesday, August 15, 2023
Account Expiration Notification Rule
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import sailpoint.api.IdentityService;
import sailpoint.api.SailPointContext;
import sailpoint.object.Application;
import sailpoint.object.EmailOptions;
import sailpoint.object.EmailTemplate;
import sailpoint.object.Filter;
import sailpoint.object.Identity;
import sailpoint.object.Link;
import sailpoint.object.QueryOptions;
import sailpoint.tools.GeneralException;
public class AccountExpirationRule {
static SailPointContext context = null;
static Logger log = null;
static void sendEmail(String identityName, String emailTemplate, String daysRemaining, Date endDate) {
String company = null;
String mgrFirstName = null;
String mgrLastName = null;
String EMAIL_ADMIN = "reddy@mightypedia.com";
String recipient = null;
String ccRecipient = null;
Map args = null;
EmailOptions options = null;
EmailTemplate eTemp = null;
Identity mgr = null;
Identity identity = null;
try {
identity = context.getObjectByName(Identity.class, identityName);
if (identity.getAttribute("company") != null) {
company = identity.getAttribute("company").toString();
}
if (identity.getManager() != null) {
mgr = identity.getManager();
if (mgr.getFirstname() != null) {
mgrFirstName = mgr.getFirstname().toString();
}
if (mgr.getLastname() != null) {
mgrLastName = mgr.getLastname().toString();
}
if (mgr.getEmail() != null) {
recipient = mgr.getEmail().trim().toString();
} else {
log.debug("Manager email is null and setting recipient to admin");
recipient = EMAIL_ADMIN;
}
} else {
log.debug("Identity Manager is null and setting recipient to admin");
recipient = EMAIL_ADMIN;
}
SimpleDateFormat formatDate = new SimpleDateFormat("MM/dd/yyyy");
String startDateFor = "";
String endDateFor = null;
if (identity.getAttribute("startDate").toString() != null) {
startDateFor = formatDate.format(identity.getAttribute("startDate").toString());
}
endDateFor = formatDate.format(endDate);
if (identity.getFirstname() != null && identity.getLastname() != null && identity.getEmail() != null
&& startDateFor != null) {
args = new HashMap();
args.put("identity", identity);
args.put("daysRemaining", daysRemaining);
args.put("firstName", identity.getFirstname());
args.put("lastName", identity.getLastname());
args.put("email", identity.getEmail());
args.put("startDate", startDateFor);
args.put("endDate", endDateFor);
args.put("managerFirstName", mgrFirstName);
args.put("managerLastName", mgrLastName);
args.put("company", company);
}
options = new EmailOptions();
options.setVariables(args);
options.setTo(recipient);
options.setCc(ccRecipient);
eTemp = context.getObject(EmailTemplate.class, emailTemplate);
if (eTemp != null) {
context.sendEmailNotification(eTemp, options);
}
} catch (GeneralException e) {
log.error("GeneralException: " + e.getMessage());
} finally {
try {
context.decache(identity);
context.decache(mgr);
context.decache(eTemp);
} catch (GeneralException e) {
log.error("GeneralException: " + e.getMessage());
}
}
}
public static void main(String[] args) {
Date today = null;
Date todayPlus15 = null;
Date todayPlus30 = null;
Date accuntExpDate = null;
Calendar cal = null;
SimpleDateFormat format = null;
String identityName = null;
String accountExpires = null;
String todayPlus15Conversion = null;
String todayPlus30Conversion = null;
String accuntExpDateConversion = null;
String filter = "(inactive == false && (type == \"consultant\"))";
List<Link> identityLinks = null;
List<Identity> identities = null;
Application application = null;
IdentityService iDS = new IdentityService(context);
QueryOptions ops = null;
try {
application = context.getObjectByName(Application.class, "AD");
ops = new QueryOptions();
Filter identityFilter = Filter.compile(filter);
ops.addFilter(identityFilter);
identities = context.getObjects(Identity.class, ops);
if (identities != null) {
for (Identity identity : identities) {
identityName = identity.getName();
identityLinks = iDS.getLinks(identity, application);
for (Link identityLink : identityLinks) {
Boolean isDisabled = identityLink.isDisabled();
if (!isDisabled) {
if (identityLink.getAttribute("accountExpires") != null
&& !identityLink.getAttribute("accountExpires").equals("") && !identityLink
.getAttribute("accountExpires").toString().equalsIgnoreCase("never")) {
accountExpires = identityLink.getAttribute("accountExpires").toString();
format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss aa ZZZ");
try {
accuntExpDate = format.parse(accountExpires);
} catch (ParseException e) {
log.error("ParseException: " + e.getMessage());
}
today = new Date();
cal = Calendar.getInstance();
cal.setTime(today);
cal.set(Calendar.HOUR_OF_DAY, 12);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
cal.add(Calendar.DATE, 15);
todayPlus15 = cal.getTime();
cal.add(Calendar.DATE, 15);
todayPlus30 = cal.getTime();
if (accuntExpDate != null) {
todayPlus15Conversion = new SimpleDateFormat("MM/dd/yyyy").format(todayPlus15);
todayPlus30Conversion = new SimpleDateFormat("MM/dd/yyyy").format(todayPlus30);
accuntExpDateConversion = new SimpleDateFormat("MM/dd/yyyy").format(accuntExpDate);
if (todayPlus15Conversion.equals(accuntExpDateConversion)) {
sendEmail(identity.getName(), "Account Expiry", "15", todayPlus15);
} else if (todayPlus30Conversion.equals(accuntExpDateConversion)) {
sendEmail(identity.getName(), "Account Expiry", "30", todayPlus30);
} else {
log.debug("Criteria is not matched...");
}
}
}
}
}
}
} else {
log.debug("No Identities found...");
}
} catch (GeneralException e) {
log.error("GeneralException: " + e.getMessage());
}
finally {
try {
context.decache(application);
} catch (GeneralException e) {
log.error("GeneralException: " + e.getMessage());
}
}
}
}
Wednesday, August 9, 2023
Username Generation
Logs
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Log log = LogFactory.getLog("mighty.rule.TestLoggers");
log.info("Hi");
log.debug("Hello");
log.trace("Dear");
log.error("Something serious");
Note: Log naming convention is project.objectType.Unique Identifier
Sunday, August 6, 2023
Workflow Libraries
What is a workflow library?
- Workflow Libraries are sets of compiled Java methods accessible to workflows.
- Identity
- Role
- PolicyViolation
- LCM libraries
- getManager()
- activate, de-activate role assignment
- Refresh Identities
- Compiling Provisioning plan
- Build, Assimilate Provisioning Forms
- Auditing etc.,
- Create Identity Request, update Identity Request state
- Refresh Identity Request afterApproval and Provisioning etc.,
- Get Object(Approval) owner and name
- Get NewObject(Approval) owner and name
- Checks whether it's a self-Approval or not etc.,
- Get the remediateViolation: Remediate SOD violations by removing roles named in the remediations argument.
- Delete the current approval object associated with this workflow.
- Enable the role
- Disable the role
- buildOwnerApproval
- audit
- addLaunchMessage
- Commit
VA Installation & Configuration
Definition : A VA is a Linux-based virtual machine that connects to your sources and apps using SailPoint APIs, connectors, and integrations...
Featured Articles
-
public static String extractSessionIDFromGetSessionId(String jsonObject) throws ParseException { String methodName = "extractSession...
-
Connector Rules # Pre-Iterate # BuildMap # JDBCBuildMap # SAPBuildMap # SAPHRManagerRule # PeopleSoftHRMSBuildMap # FilePar...
-
public ProvisioningPlan buildMoveADAccountsPlan(WorkflowContext wfc) throws GeneralException { Logger ruleLog = Logger.getL...
-
IIQ Installation Matrix : IdentityIQ Supported Platforms Matrix - Compass https://community.sailpoint.com/t5/IdentityIQ-Articles/IdentityIQ-...
-
// Fetch current date : Calender calender = Calender.getInstance(); Date currentDate = calender.getTime(); // Printing current date in ter...
-
Configuration steps for Log4j :- 1. Navigate to the below path : C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\idenityiq\W...
-
RJ_KEY — auto generated key (the Job ID) RJ_NAME — name of the scheduled job RJ_JOB_STATUS — current status of the job RJ_EVENT_CNT — number...
-
Ex: 1. Navigate to the following directory C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\identityiq\WEB-INF\classes\sailpoi...
-
1. Configure the Manager Quicklink population to allow account only requests. a. Navigate to ===> Global Settings ===> Quicklink Pop...
-
# ./ iiq console -j # Display the list of console commands: help (or) ? # Exit the from IIQ console : quit # Delete all identities...