Delegating Role Management in ISC Using Interactive Forms and Workflows

Introduction

  • Why: Empowering role owners to manage their own roles reduces the administrative burden on the core IAM team. By delegating this responsibility, business owners can maintain their roles efficiently and securely without needing backend access.
  • Problem: Out-of-the-box, Identity Security Cloud (ISC) requires an administrator to modify role configurations, such as adding or removing entitlements, updating descriptions, or changing owners.
  • Goal: A custom form and workflow solution that allows role owners to seamlessly manage their assigned roles directly through an interactive launcher.

CAUTION!
Important Security Warning: This form and workflow solution can make role and access-related changes. Please ensure you read the Safety and Governance Guardrails section below to understand the recommended security measures before deploying this solution.

Solution Overview

  • Tech Stack: 2 Forms + 3 Workflows
  • High-Level Flow: The solution uses two interactive forms. The first form allows the user to select a role they own. The second form displays the role’s current details and presents the available management actions. Based on the selected action, the backend workflows execute the necessary API calls to modify the role.

The available actions in this solution include the following API calls (all utilizing PATCH /roles/v1/{roleid}):

  • Modify Name
    • Body: [{"op": "replace", "path": "/name", "value": "{{newName}}"}]
  • Modify Description
    • Body: [{"op": "replace", "path": "/description", "value": "{{newDescription}}"}]
  • Modify Requestable Status
    • Body: [{"op": "replace", "path": "/requestable", "value": {{true/false}}}]
  • Change Primary Owner
    • Body: [{"op": "replace", "path": "/owner", "value": {"type": "IDENTITY", "id": "{{newOwnerId}}"}}]
  • Add Entitlement
    • Body: [{"op": "add", "path": "/entitlements/-", "value": {"id": "{{entitlementId}}", "type": "ENTITLEMENT"}}]
  • Remove Entitlement
    • Body: [{"op": "remove", "path": "/entitlements/{{index}}"}]

User Interface

The user experience is split into two distinct forms to ensure clarity and provide dynamic context.

1. Role Selector Form

The first step is selecting the role to manage.

  • Implementation Details: This form utilizes an advanced search and form input filter on the owner UID to display only the roles available to the current user. In the main role management workflow, we use trigger.launchedby.id to retrieve this ID and pass it to the form.

Form Code:
RoleSelectorForm_cleansed.json (2.4 KB)

2. Role Management Form

Once a role is selected, the second form displays the role’s current state and available actions.

  • Dynamic Summary: We use a form input to pull a summary from a roles/v1/ HTTP call, displaying all relevant details to the user. A “Define Variable” step maps this data and sets the relevant CSS/HTML tags for a clean display.
  • Conditional Fields: The form employs heavy conditional logic. When the user selects an action from the “Select Field to Modify” dropdown, the form dynamically adjusts which input fields are visible.
  • Smart Entitlement Selection: For the “Remove Entitlement” action, the form uses the entitlements field from the roles/v1/ API call as an input. This ensures the user can only select entitlements that are actually assigned to the role, preventing errors.

Form Code:
RoleManagementForm_cleansed.json (11.4 KB)

Back End

The backend consists of three workflows to handle the logic. The primary workflow manages standard modifications, while two external trigger workflows handle the complexities of adding and removing entitlements.

1. Main Role Management Workflow

This workflow handles the initial form interactions and standard role updates.

  • Conditional Logic Web: The workflow uses a web of “Define Comparison” calls to route the execution based on the chosen action.
  • Handling Arrays vs. Strings: A key challenge is that adding or removing entitlements can involve a single item (output as a string) or multiple items (output as an array). Passing this directly into a JSON body can break the API call if it expects one format over the other. To resolve this, the workflow branches to handle single and multiple selections distinctly.

Workflow Code:
RoleManagement_cleansed.json (20.3 KB)

2. Add Entitlement Workflow

Adding an entitlement is relatively straightforward using a PATCH call, but there is a specific nuance when adding multiple entitlements at once.

  • Wait Time Workaround: When sending multiple ADD patch requests simultaneously, they can potentially overwrite each other, causing some entitlements to be missed. Standard parallel loops do not work reliably for this scenario. To fix this, a waittime variable (e.g., 5 seconds) is added between iterations in the serial loop to ensure each patch is processed successfully.

Workflow Code:
AddEntitlementFromRole_cleansed.json (4.7 KB)

3. Remove Entitlement Workflow

Removing entitlements is the most complex part of this solution due to the mechanics of JSON Patch.

  • Index Shifting Challenge: JSON Patch only allows removals by index. When you remove one entitlement, the index shifts for all subsequent entitlements. To handle this safely, we perform only one removal per execution. We pull the role details fresh every run to ensure we are targeting the correct index.
  • Dynamic Re-looping: The workflow has two paths depending on if it receives a string (single item) or an array (multiple items) in the entitlementstoremove trigger. The single path signifies the last entitlement, allowing the workflow to exit. The array path processes the first item, and then makes an HTTP call to re-trigger the workflow with the remaining array items.
flowchart TD
    Start([Workflow Trigger]) --> InputCheck{"entitlementstoremove\ntype?"}
    
    InputCheck -- "Array (Multiple Items)" --> ExtractFirst["Extract 1st Item"]
    ExtractFirst --> SliceArray["Store Remaining Items\nin nextlist"]
    SliceArray --> FindIndex["GET Role -> Find Index of 1st Item"]
    FindIndex --> RemoveEntitlement["PATCH: Remove Entitlement by Index"]
    RemoveEntitlement --> RecallWorkflow["POST: Re-Trigger Workflow\nwith nextlist"]
    RecallWorkflow --> EndMultiple([End Current Execution])

    InputCheck -- "String (Single Item)" --> FindIndexSingle["GET Role -> Find Index of Item"]
    FindIndexSingle --> RemoveSingle["PATCH: Remove Entitlement by Index"]
    RemoveSingle --> EndSingle([End Current Execution])

    RecallWorkflow -.-> |"New Trigger Event\n(until all removed)"| Start
  • Counter Initialization Bug: Inside the loops, there is a specific quirk with the set counter variable. If you do not initialize the counter inside the “Define Variable” step before referencing it, it will not output properly in the REMOVE patch call.

Workflow Code:
RemoveEntitlementFromRole_cleansed.json (13.0 KB)

Safety and Governance Guardrails

While delegating role management empowers business owners and reduces IAM overhead, this workflow modifies roles and access related configurations. It is crucial to implement the following guardrails before deploying this solution to production:

  • Ownership Validation: Ensure the Role Selector Form strictly filters roles by the current user’s ID (trigger.launchedby.id). This prevents users from selecting and modifying roles they do not own.
  • Approvals and Review Steps: The current implementation lacks an approval schema. It is highly recommended to add an approval step within the workflow (routing modifications to the IAM team or a secondary owner for review) before the API calls are executed, particularly when adding high risk entitlements.
  • Entitlement Restrictions: To prevent owners from adding highly privileged or restricted entitlements to their roles, implement a filter or allowlist in the form’s entitlement selection field. Alternatively, add logic in the workflow to check for restricted entitlements and require additional approvals.
  • External Workflow Protection: Ensure the external trigger workflows (Add/Remove Entitlement) are securely configured. Treat the Client ID and Secret generated for these workflows like highly sensitive passwords to ensure they cannot be triggered by unauthorized external sources.
  • Audit and Rollback Considerations: Log all modifications made through this form (using a webhook to a ticketing system like ServiceNow, or sending an email notification to an audit group). Because role changes can impact access for many users, maintaining a clear audit trail ensures changes can be tracked and manually rolled back if an error occurs.

Conclusion

  • Summary: This solution demonstrates how to leverage interactive forms and advanced workflow logic to build a self-service delegated role management tool. While the entitlement removal process requires some creative engineering with JSON Patch indexing, the end result is a seamless experience for role owners.
  • Call to Action: If you have questions about setting up these API calls or want to expand this form to include an approval process, feel free to post below! I’d love to hear how you are using forms to delegate tasks in your organization.
3 Likes