Search This Blog

Nov 26, 2026

How to run an RTR action in workflow that is triggered by an Identity Account Event

 In CrowdStrike Falcon, one can create workflow with triggers from "Identity Account Event" - this is nice and easy until you also need to call an RTR action in the same workflow. CrowdStrike mandates a prerequisite condition 'Platform equals Windows" in front of the RTR action, while Identity Account Event is associated with users only - it doesn't expose any device therefore nowhere you can set a condtion as 'Platform equals Windows.

A workaround is instead of using Identity Account Event as trigger, one can do below:

  1. Generate detections using Identity Protection policy
    1. go to Identity Protection \ Enforcement \ Policy \ Conditional Access
    2. click on 'add rule', follow the onscreen instructions
    3. Note the rule name
  2. Using Identity Detection as trigger instead in the workflow
  3. Add a condition in the workflow to match the rule name that you just created in step 1
    policy rule name == 'xxx'
  4. Add the action "get device details"
  5. After device details, add the condition 'platform == Windows'
  6. Add other components as needed

Instead of using Identity Protection rules (which is rumored to  be retired), we can also use NG-SIEM detections. 

Nov 23, 2026

Create RTR-based custom action in CrowdStrike Falcon Fusion Workflow

 

 

Data availability

 

Three categories of data from upstream actions are available to a custom action

 

1.      Data from all previous events and actions. E.g. for above screenshot, at first condition “if account event type is compromised pwd”, data exposed by “Identity Account Event” is available for composing the condition. Under this category, below attributes are available for downstream actions

a.      Account UPN

b.     Account Domain

c.      Account email

d.     … etc

2.      Similarly, at “Device query” step, data exposed by all previous steps, including output of both trigger and “Get Identity Context”, are available for “Devie Query” to use – this can be seen in the right side of the screenshot under “workflow data” where all first level nodes are the data source

3.      Trigger data

a.      Trigger category

b.     cid

c.      Trigger ID

d.     …etc

4.      Workflow data

a.      Workflow definition data

                                                                          i.      Workflow definition ID

                                                                        ii.      Workflow name

                                                                      iii.      Workflow description

b.     Workflow execution data

                                                                          i.      Execution error

                                                                        ii.      Execution id

 

Data available to an action in a workflow is accumulative, meaning the action can read all outputs from all previous steps

Step-by-step:

1.      Write the script as below

# Param block only works for a typical RTR.
# It doesn't work for RTR that will be used in workflow
Param(
    [string] $EntitySID,
    [string] $AccountDomain
)

# Instead, we should parse args[0] as a JSON blob

$inputJSON = $args[0] | ConvertFrom-Json
$EntitySID = $inputJSON.EntitySID
$domainName = $inputJSON.domainName

<#
    Your workload here
    Do something
#>

#
# return a JSON object for downstream workflow items
#
$result | ConvertTo-Json -Compress | Write-Output

           Compose input and output JSON files. For above source code, JSON file as below

a.      Input.JSON

{

    "EntitySID": "S-1-5-21-1234-5678-90123-555",

    "AccountDomain":"contoso.com"

}

 

b.     Output.JSON

{

    "Output_param1": "",

    "Output_param2":""

}

 

 

3.      Let CS convert above JSON file to input output schemas

4.      Now move to workflow editor, select the RTR-based custom action, it should list the input parameters. In our example above, it should list EntitySID and AccountDomain that allow you to pick available (exposed by previous steps) data and populate

5.      In actions after our custom action, “output_Param1” and “output_param2” should become available

 

 

Test:

1.      You can do either whole workflow test or a unit test against a single action. You will have to go into Edit mode to perform tests. 

  • To perform workflow test, use the "Test" button on top right corner of edit window;  
  • To perform unit test, select the action, click on "Test" on left hand panel
Mock data for test:

One can set mock data to test. Mock data can be from either previous runs - they are listed for you to select from as your mock data source - or from custom JSON  

  1. Enter editing mode
  2. highlight the trigger (or any subsequent actions)
  3. click "Execution settings", it tells you what the current source is


  4. click on the pen icon, it lets you switch between different sources


T

References

Falcon Fusion With Real Time Response | Tech Hub

RTR that can be used in workflow: sample code and notes

This script enrich data available in workflow by reading an AD user's description and exposes it in workflow. CrowdStrike exposes limited user attributes in Identity Account Event or Identity Protection Detections, even with the help of action 'Get User Context'. If we need any attribute outside of what CS exposes, RTR is probably the best tool at our disposal.

The key point about an RTR script to be shared in workflow is : CS packages all mapped input parameters into a JSON text blob and passes it to RTR action as the first and only arg. As a result, named parameter doesn't really work (or required). All we need is to parse args[0] as a JSON text stream.

$inputJSON = $args[0] | ConvertFrom-Json

$EntitySID = $inputJSON.EntitySID
$domainName = $inputJSON.domainName

Similarly, the script should also do the same to package all data into a JSON blob for subsequent actions in workflow to consume:

$result | ConvertTo-Json -Compress | Write-Output


The sample:

#
# Getting description attrbitue based on user SID
# This is necessary because none of CrowdStrike builtin action gets description for workflow use
#
# John.Lan@gmail.com
#

<#
    As per https://docs.crowdstrike.com/r/en-US/a5kj6wfu/j42eeacd
    RTR used in workflow doesn't accept named parameters, it reads input from args[0] as a json text blob

    For debugging purpose, we can put below in a text file:

                {
                "EntitySID": "S-1-5-21-12345678-12345678-612345678-12345678",
                "domainName": "foo.bar"
                }

    Then read the file into a variable:
                $inputJSON = get-content 'input.json'

    Finally test this RTR in command line as
                ./get-UserDetails-JSON $inputJSON
#>


$inputJSON = $args[0] | ConvertFrom-Json
$EntitySID = $inputJSON.EntitySID
$domainName = $inputJSON.domainName

import-module ActiveDirectory -ErrorAction Stop -WarningAction SilentlyContinue
$result = [ordered]@{
    description = ""
    UserGUID = ""
    getUserDetailsErrorMsg     = "$($EntitySID)||$($domainName)"
}

#
# Validate SID
#
if ([string]::IsNullOrWhiteSpace($EntitySID)) {
    $result.getUserDetailsErrorMsg = "$($EntitySID)||$($domainName) || EntitySID is null or blank"  # This should never happen as CS shouldn't pass in an invalid SID
    $result | ConvertTo-Json -Compress | Write-Output
    exit
}

#
# Validate DomainName
#
if ([string]::IsNullOrWhiteSpace($domainName)) {
    $result.getUserDetailsErrorMsg = "$($EntitySID)||$($domainName) || domainName is null or blank"  # This should never happen as CS shouldn't pass in an invalid SID
    $result | ConvertTo-Json -Compress | Write-Output
    exit
}

#
# Ensure execution host has AD Module
#
if (-not (Get-Module -ListAvailable -Name ActiveDirectory)) {
    $result.getUserDetailsErrorMsg = "ActiveDirectory Module is not available on the RTR execution host"
    $result | ConvertTo-Json -Compress | Write-Output
    Exit
}

#
# Query AD
#
$user = $null
$filter = "(ObjectSID=$($EntitySID))"

try {
    $user = Get-ADUser -server $domainName -LDAPFilter $filter -Properties description,objectGUID -ErrorAction Stop
    if ($null -ne $user){
        $result.description = $user.description
        $result.userGUID = $user.ObjectGUID
        $result.getUserDetailsErrorMsg = "Success"
    } else{
        $result.getUserDetailsErrorMsg = "SID not found."
    }
}
catch {
    $result.getUserDetailsErrorMsg = "Failed to retrieve user from AD, domainName passed from input: $domainName error: $_"
}
$result | ConvertTo-Json -Compress | Write-Output