Universal Cloud REST API connector workflow for IBM Security ReaQta
You can customize your workflow and workflow parameters based on the default workflow.
A workflow is an XML document that describes the alert retrieval process. The workflow defines one or more parameters, which can be explicitly assigned values in the workflow XML or can derive values from the workflow parameter values XML document. The workflow consists of multiple actions that run sequentially.
ReaQta default workflow
Use the following XML to populate the Workflow field in the Universal Cloud REST API connector parameters section.
Click the Copy to clipboard icon at the upper right of the code block, and then paste the content into the Workflow field.
<?xml version="1.0" encoding="UTF-8" ?>
<Workflow name="ReaQta" version="1.0" xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/Workflow/V2">
<Parameters>
<Parameter name="app_id" label="ReaQta Application ID" required="true" />
<Parameter name="secret_key" label="ReaQta secret key" required="true" secret = "true"/>
<Parameter name="reaqta_host" label="ReaQta Host / IP Address" required="true" />
<Parameter name="port" label="ReaQta Host Port" required="false" default="443"/>
</Parameters>
<Actions>
<Initialize path="/reaqtaData/receivedAfterMilli" value="${time() - (60000 * 60 * 24 * 7)}" />
<FormatDate pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" timeZone="GMT" time="${/reaqtaData/receivedAfterMilli}" savePath="/reaqtaData/receivedAfter_Formatted" />
<Set path="/reaqtaData/url" value="https://${/reaqta_host}:${/port}/rqt-api/1/alerts"/>
<!-- Get Auth Token -->
<CallEndpoint url="https://${/reaqta_host}:${/port}/rqt-api/1/authenticate" method="POST" savePath="/reaqtaAuth/response">
<RequestHeader name="Content-Type" value="application/json" />
<RequestBody type="application/json" encoding="UTF-8">
{
"secret":"${/secret_key}",
"id": "${/app_id}"
}
</RequestBody>
</CallEndpoint>
<If condition="/reaqtaAuth/response/status_code != 200">
<Abort reason="${/reaqtaAuth/response/status_code}: ${/reaqtaAuth/response/status_message}" />
</If>
<Set path="/reaqtaAuth/token" value="${/reaqtaAuth/response/body/token}"/>
<!-- Get alerts -->
<DoWhile condition="not empty(/reaqtaData/response/body/nextPage)">
<CallEndpoint url="${/reaqtaData/url}" method="GET" savePath="/reaqtaData/response">
<QueryParameter name="receivedAfter" value="${/reaqtaData/receivedAfter_Formatted}" omitIfEmpty="true" />
<QueryParameter name="sortBy" value="receivedAt:asc" />
<RequestHeader name="Content-Type" value="application/json" />
<RequestHeader name="Authorization" value="Bearer ${/reaqtaAuth/token}" />
</CallEndpoint>
<If condition="/reaqtaData/response/status_code != 200">
<Abort reason="${/reaqtaData/response/status_code}: ${/reaqtaData/response/status_message}" />
</If>
<Log type="DEBUG" message="We received a total of ${count(/reaqtaData/response/body/result)} Offenses." />
<Log type="DEBUG" message="Remaining alerts to retrieve: ${/reaqtaData/response/body/remainingItems}" />
<If condition="${count(/reaqtaData/response/body/result)} > 0">
<!-- Post the alerts -->
<PostEvents path="/reaqtaData/response/body/result" source="${/reaqta_host}" />
<ParseDate pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" date="${max(/reaqtaData/response/body/result/receivedAt)}" timeZone="UTC" savePath="/reaqtaData/receivedAfterMilli"/>
<Set path="/reaqtaData/receivedAfterMilli" value="${/reaqtaData/receivedAfterMilli + 1}" />
<!-- Unset this for subsequent loops -->
<Set path="/reaqtaData/receivedAfter_Formatted" value="" />
</If>
<!-- Set the next page if present -->
<If condition="not empty(/reaqtaData/response/body/nextPage)">
<Log type="DEBUG" message="Response contained a next page link." />
<Set path="/reaqtaData/url" value="${/reaqtaData/response/body/nextPage}" />
</If>
</DoWhile>
<SetStatus type="INFO" message="Successfully queried for events." />
</Actions>
<Tests>
<DNSResolutionTest host="https://${/reaqta_host}"/>
<TCPConnectionTest host="${/reaqta_host}" port="${/port}"/>
<HTTPConnectionThroughProxyTest url="https://${/reaqta_host}:${/port}"/>
</Tests>
</Workflow>
ReaQta default workflow parameters
Use the following XML to populate the Workflow Parameter Values field in the Universal Cloud REST API connector parameters section.
- Click the Copy to clipboard icon at the upper right of the code block, and then paste the content to a text file.
- Replace the values for <app_id>, <secret_key> <reaqta_host>, and <port> with your own values.
- Copy the updated content into the Workflow Parameter Values field.
<?xml version="1.0" encoding="UTF-8" ?>
<WorkflowParameterValues xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/WorkflowParameterValues/V2">
<Value name="app_id" value="your-App-ID"/>
<Value name="secret_key" value="your-Secret-Key"/>
<Value name="reaqta_host" value="your-ReaQta Hostname-or-IP"/>
<Value name="port" value="443"/>
</WorkflowParameterValues>