Workflow - Remove entitlements when a identity turns inactive

Hi all,

I am working on a requirement to remove all the entitlement when a user turns inactive, and the ad account is disabled then all the entitlement of the ad should be removed So, some reason the entitlements are not getting removed. The loop step doesnt fetch the results

Identity trigger
$.changes[?(@.attribute == "cloudLifecycleState" && @.newValue == "inactive")]

FIRST HTTP JSON BODY

{
  "indices": [
    "identities"
  ],
  "query": {
    "query": "id:{{$.trigger.identity.id}}"
  }
}

Loop input:
$.hTTPRequest.body[0].access[?(@.type == "ENTITLEMENT" && @.source.name == "Active Directory")]

Second HTTP Request JSON Body:

{
  "requestType": "REVOKE_ACCESS",
  "requestedFor": [
    "{{$.loop.context.id}}"
  ],
  "requestedItems": [
    {
      "comment": "Please remove",
      "id": "{{$.loop.loopInput.id}}",
      "name": "{{$.loop.loopInput.name}}",
      "type": "{{$.loop.loopInput.type}}"
    }
  ]
}
1 Like

And the HTTP details for both are as follows
First HTTP CALL : https://TENANT.api.identitynow.com/v3/search
Second HTTP CALL: https://TENANT.api.identitynow.com/v3/access-requests

You don’t have to use a workflow.
You could use:

  • afterModify rule to catch the DISABLE function to then run a PS script
  • run a scheduled script to remove all entitlements from any users that are disabled.

All depends on your coding preference

Hello Soundarya,
You may follow the below link which will give you the high level information to your Workflow approach which considers the Workflow limitation, sticky entitlements and AD group default behaviors.

Let me know whether it helps you.

Try using Services Standard IdentityNow BeforeProvisioning Rule which has an action RemoveADEntitlements .

This is not deployed to your tenant by default . You can take support help to deploy this rule or you can deploy on your own.

Try Something Like this for your usecase :

[
{
“op”: “add”,
“path”: “/connectorAttributes/cloudServicesIDNSetup”,
“value”: {
“eventConfigurations”: [
{
“eventActions”: [
{
“Action”: “ADMoveAccount”,
“Attribute”: “AC_NewParent”,
“Value”: “OU=Disabled,OU=Users,OU=,OU=,DC=***,DC=”
},
{
“Action”: “ScramblePassword”,
“Attribute”: “password”,
“Value”: null
}, {
“Action”: “RemoveADEntitlements”,
“Attribute”: “memberOf”,
“Value”: “CN=Domain Users,CN=Users,
DC=testing,DC=com”
}
],
“Identity Attribute Triggers”: [
{
“Attribute”: “cloudLifecycleState”,
“Value”: “inactive”,
“Operation”: “eq”
}
],
“Operation”: “Disable”
}
]
}
}
]

Hi Bhaskar,

can you give me the full steps on how to deploy this in our tenant?

Unfortunately I couldn’t provide the JSON since it is implemented in a client tenant and you can refer the link which provides the JSON to built the basic workflow and on top of it you can customize it based on your requirement.

1 Like

You can try using the built in Get Access and Manage Access workflow actions instead of HTTP actions.

Hi Bhaskar,

Which is the api you are using here? is it update-provisioning-policy | SailPoint Developer Community

Hi Soundarya,

You need to make sure to have the rule deployed and then you need to patch the source .

Thanks,
Bhaskar.

Hi Bhaskar,

The rule is already deployed in our tenant so let me know which is the patch API you used was it this update-provisioning-policy | SailPoint Developer Community?

Please use v3 api to patch the source.
PATCH https://****.api.identitynow.com/v3/sources/{sourceid} - in body just modify the below content.

[
{
“op”: “add”,
“path”: “/connectorAttributes/cloudServicesIDNSetup”,
“value”: {
“eventConfigurations”: [
{
“eventActions”: [
{
“Action”: “ADMoveAccount”,
“Attribute”: “AC_NewParent”,
“Value”: “OU=Disabled,OU=Users,OU=,OU= ,DC=***,DC= ”
},
{
“Action”: “ScramblePassword”,
“Attribute”: “password”,
“Value”: null
}, {
“Action”: “RemoveADEntitlements”,
“Attribute”: “memberOf”,
“Value”: “CN=Domain Users,CN=Users,
DC=testing,DC=com”
}
],
“Identity Attribute Triggers”: [
{
“Attribute”: “cloudLifecycleState”,
“Value”: “inactive”,
“Operation”: “eq”
}
],
“Operation”: “Disable”
}
]
}
}
]

1 Like

Hi Suresh,

Yes, this helped, and I was able to remove all the entitlements. But in the get identity can the workflow take more then 100 users and process the campaign for them?

Get identity will get a single identity on a iteration, so it will work and creates individual campaign for each identity