Create Post-Process Rules - Tutorials - 6.x - Cortex XSOAR - Cortex - Security Operations

Cortex XSOAR 6.x Tutorials

Product
Cortex XSOAR
Version
6.x
Creation date
2022-10-13
Last date published
2023-06-05
Category
Tutorials

After you remedy an incident, you may want to perform additional actions on the incident, such as closing a ticket in a ticketing system such as Service Now or sending out an email, verifying all tasks are completed, etc. You can create a post-processing script to cover as many scenarios as you need.

In this example, when closing an incident we want to update automatically the owner of the incident to the user who closes it. This user is responsible for any post closure issues.

  1. Create a script in the Automation page.

    1. Click Upload Automation.

    2. Upload the following script.

      commonfields:
        id: Close Incident by User ID
        version: 1
      contentitemexportablefields:
        contentitemfields:
          packID: ""
          itemVersion: ""
          fromServerVersion: ""
          toServerVersion: ""
          propagationLabels:
          - all
      vcShouldKeepItemLegacyProdMachine: false
      name: CloseIncidentbyUserID
      script: |-
        result = (demisto.args())
        demisto.executeCommand("setIncident", {'owner': result['closingUserId']})
      type: python
      tags:
      - post-processing
      enabled: true
      scripttarget: 0
      subtype: python2
      pswd: ""
      runonce: false
      runas: DBotWeakRole

      Ensure that the post-processing tag is selected.

      phishing-process.png
    3. Click Save Version.

  2. Add the automation to the Phishing incident type.

    1. Select SettingsOBJECTS SETUPIncidentsTypesPhishingEdit.

    2. In the Post-process using field, select CloseIncidentbyUserID.

    3. Click Save.

    When a user closes an incident, the user who closed the incident now becomes the owner. When an incident is re-opened. the user who closed the incident will be able to keep track of reopened incidents.