Universal Cloud REST API connector workflow for VectraNetworksVectra

You can customize your workflow and workflow parameters based on the default workflow.

A workflow is an XML document that describes the event 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.

VectraNetworksVectra 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="VectraAlerts" version="1.0" xmlns="http://qradar.ibm.com/UniversalCloudRESTAPI/Workflow/V2">
        <Parameter name="host"          label="Provide the host to run the query on."   required="true" />
        <Parameter name="apiToken"      label="Provide the API Token to use for authentication to the host."   required="true" secret="true"/>
        <Parameter name="apiVersion"    label="Provide the version of the API we are hitting"   required="true" default="v2.2" />
        <Initialize path="/from" value="${time() - (7 * 60000 * 60 * 24)}" />
        <FormatDate pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"  timeZone="UTC" time="${/from}" savePath="/vectraFrom" />
        <Set path="/queryUrl" value="https://${/host}/api/${/apiVersion}/detections" />
        <DoWhile condition="not empty(/vectraAlerts/response/body/next)">
            <CallEndpoint url="${/queryUrl}" method="GET" savePath="/vectraAlerts/response">
                <SSLConfiguration allowUntrustedServerCertificate="true" />
                <QueryParameter name="last_timestamp_gte" value="${/vectraFrom}"/>
                <QueryParameter name="page_size"            value="10"/>
                <QueryParameter name="ordering"             value="last_timestamp"/>
                <RequestHeader name="Authorization" value="Token ${/apiToken}"/>
                <RequestHeader name="Content-Type"  value="application/json" />
                <RequestHeader name="Accept"        value="application/json" />
            <!-- catch any status code other than 200 -->
            <If condition="/vectraAlerts/response/status_code != 200">
                <Log type="INFO" message="Could not retrieve data for the following reason: [${/vectraAlerts/response/body/detail}]"/>
                <Abort reason="${/vectraAlerts/response/status_code}: ${/vectraAlerts/response/status_message}" />
            <PostEvents path="/vectraAlerts/response/body/results" source="${/host}" />
            <Log type="DEBUG" message="Posted ${count(/vectraAlerts/response/body/results)} entities to the pipeline."/>
            <If condition="not empty(/vectraAlerts/response/body/next)">
                <Log type="DEBUG" message="Next page value found, setting new query string to [${/vectraAlerts/response/body/next}]."/>
                <Set path="/queryUrl" value="${/vectraAlerts/response/body/next}"/>
                <Log type="DEBUG" message="No next page value found. Completed pulling events."/>
        <!--Translate it back to epoch for incrementation-->
        <ParseDate pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"       timeZone="UTC" date="${/vectraFrom}"       savePath="/from" />
        <Set path="/from" value="${/from + 1}"/>
        <DNSResolutionTest              host="${/host}"/>
        <TCPConnectionTest              host="${/host}"/>
        <HTTPConnectionThroughProxyTest url="${/host}"/>

VectraNetworksVectra default workflow parameter values

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 <your-vectranetworksvectra-host>, <your-api-token> and <your-api-version> with your own values. Then 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="host" 		    value="<your-vectra networks vectra-host>"/>
    <Value name="apiToken"  	value="<your-api-token>"/>
    <Value name="apiVersion"    value="<your-api-version>"/>