ServiceNow

Create ServiceNow Incident

The purpose of this example is to create a ServiceNow Incidentarrow-up-right when a Vulnerability is created in AttackForge, and to update AttackForge to assign the SNOW Incident Id against the Vulnerability.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Initial Set Up

Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows

Action 1 - Create SNOW Incident

  • Method: POST

  • URL: https://<YOUR-SNOW>/api/now/table/incident

  • Headers:

    • Key = Accept; Type = Value; Value = application/json

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Action 2 - Update AF Vuln with SNOW Incident Id

  • Method: PUT

  • URL: <defined in Request Script>

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = X-SSAPI-Key; Type = Secret; Value = af_auth

  • Request Script:

  • Response Script:

ServiceNow Incident Retest -> Update Vuln to Ready for Retest

The purpose of this example is when a ServiceNow Incident is assigned the 'Resolved' status - the matching vulnerability in AttackForge is assigned as retest.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Initial Set Up

Action 1 - Get Vulnerability

  • Method: GET

  • URL: https://demo.attackforge.dev/api/ss/vulnerabilities

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = X-SSAPI-KEY; Type = Secret; Value = x_user_key

  • Request Script:

  • Response Script:

Action 2 - Get SNOW Incident State

  • Method: GET

  • URL: https://dev310111.service-now.com/api/now/table/sys_choice?sysparm_query=name=incident&element=state&value={state}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Action 3 - Update Vulnerability

  • Method: PUT

  • URL: https://demo.attackforge.dev/api/ss/vulnerability/{id}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = X-SSAPI-KEY; Type = Secret; Value = x_user_key

  • Request Script:

  • Response Script:

Close ServiceNow Incident

The purpose of this example is when a vulnerability is closed in AttackForge, the matching ServiceNow Incident is also closed.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Initial Set Up

Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows

Action 1 - Get SNOW Incident

  • Method: GET

  • URL: https://dev310111.service-now.com/api/now/table/incident?sysparm_query=GOTOnumber={incidentId}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Action 2 - Get SNOW Incident States

  • Method: GET

  • URL: https://dev310111.service-now.com/api/now/table/sys_choice?sysparm_query=name=incident&element=state&value={state}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Action 3 - Close SNOW Incident

  • Method: PUT

  • URL: https://dev310111.service-now.com/api/now/v1/table/incident/{sys_id}?sysparm_exclude_ref_link=true

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Re-Open ServiceNow Incident

The purpose of this example is when a vulnerability is re-opened in AttackForge, the matching ServiceNow Incident is also re-opened.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Initial Set Up

Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows

Action 1 - Get SNOW Incident

  • Method: GET

  • URL: https://dev310111.service-now.com/api/now/table/incident?sysparm_query=GOTOnumber={incidentId}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Action 2 - Get SNOW Incident States

  • Method: GET

  • URL: https://dev310111.service-now.com/api/now/table/sys_choice?sysparm_query=name=incident&element=state&value={state}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Action 3 - Re-Open SNOW Incident

  • Method: PUT

  • URL: https://dev310111.service-now.com/api/now/v1/table/incident/{sys_id}?sysparm_exclude_ref_link=true

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = Accept; Type = Value; Value = application/json

    • Key = Authorization; Type = Secret; Value = snow_auth

  • Request Script:

  • Response Script:

Create VR Item In ServiceNow

The purpose of this example is when a vulnerability is created in AttackForge, a vulnerability is also created in ServiceNow Vulnerability Response (VR) module.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Prerequisites:

Configure OAuth on ServiceNow

  1. Navigate to Inbound Integrations

  1. Click on New Integration. Select Client Credentials Grant.

  1. Configure the credentials as required. Copy the Client Id and Client Secret. These will be referred to in the secrets within the flow.

Create Scripted REST API

  1. Navigate to Scripted REST APIs

  1. Click on New. Enter a name e.g. AttackForge. Select vulnerability_integration_svc in Default ACLs.

  1. Click Submit. Click New.

  1. Enter Create Vulnerable Item in Name. Select POST for HTTP method. Enter /create_vulnerable_item in Relative Path. Copy the Resource Path - this will be referenced later in the flow secrets. Enter the following code, the click Update.

Configure Severity Map

  1. Navigate to Normalized Severity Maps.

  1. Click New. Enter the following severity maps. Ensure that the Source, Source Value and Target Value below matches exactly.

Initial Set Up

Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows

  • Event: Vulnerability Created

  • Secrets:

    • af_tenant - your AttackForge hostname e.g. demo.attackforge.com

    • af_token - your AttackForge user API key

    • snow_client_id - your ServiceNow Client Id (see Prerequisites above)

    • snow_client_secret - your ServiceNow Client Id (see Prerequisites above)

    • snow_hostname - your ServiceNow hostname e.g. company.service-now.com

    • snow_resource_path - your ServiceNow Scripted REST API route (see Prerequisites above)

Action 1 - Get OAuth Token

  • Method: POST

  • URL: https://{{snow_hostname}}/oauth_token.do

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/x-www-form-urlencoded

  • Request Script:

  • Response Script:

Action 2 - Format SNOW Vuln Body

  • Script:

Action 3 - Create SNOW Vulnerability

  • Method: POST

  • URL: https://{{snow_hostname}}{{snow_resource_path}}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

  • Request Script:

  • Response Script:

Action 4 - Insert SNOW Vuln Info on AF Vuln

  • Method: PUT

  • URL: https://{{af_tenant}}/api/ss/vulnerability/{id}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = X-SSAPI-KEY; Type = Secret; Value = af_token

  • Request Script:

  • Response Script:

Update Vuln Status When ServiceNow VR Item Status Changes

The purpose of this example is when a Vulnerability Item changes status in the ServiceNow Vulnerability Response (VR) module, the matching vulnerability in AttackForge also updates its status.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Initial Set Up

Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows

  • HTTP Trigger

    • Method: POST

    • Authentication: User API Key

      • Header Key: x-user-key

  • Secrets:

    • af_tenant - your AttackForge hostname e.g. demo.attackforge.com

    • af_token - your AttackForge user API key

Action 1 - Update Vulnerability

  • Method: PUT

  • URL: https://{{snow_hostname}}/oauth_token.do

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

    • Key = X-SSAPI-KEY: Type = Secret; Value = af_token

  • Request Script:

  • Response Script:

Postrequisites:

Create Rest Message

  1. Navigate to REST Messages.

  1. Click New. Enter Name AttackForge Vuln Update Webhook. The Endpoint should reference your AttackForge Flow Trigger URL (see flow created above). Click Submit.

  1. Click New.

  1. Enter POST for Name and select POST for HTTP method. The Endpoint should reference your AttackForge Flow Trigger URL (see flow created above).

  1. Click HTTP Request tab. Enter Content-Type and X-USER-KEY headers. The value for the X-USER-KEY should be your AttackForge user API key which has access to trigger the flow you created (see above). Click Update.

Configure Business Rule

  1. Navigate to Business Rules.

  1. Click New. Enter Vuln Updated for the Name. Select Vulnerable Item [sn_vul_vulnerable_item] for the Table. Tick Active and Advanced. In the When to run tab, select after for When, tick Update.

  1. Click on Advanced tab. Enter the following code, ensuring that the highlighted section in the image matches the name and HTTP method defined in Create Rest Message above. Click Submit.

Update ServiceNow VR Item Status When Vuln Status Changes

The purpose of this example is when a vulnerability status is updated in AttackForge, the status is also updated for the linked Vulnerability Item in ServiceNow Vulnerability Response (VR) module.

This example Flow can be downloaded from our Flows GitHub Repositoryarrow-up-right and imported into your AttackForge.

Prerequisites:

Configure OAuth on ServiceNow

  1. Navigate to Inbound Integrations

  1. Click on New Integration. Select Client Credentials Grant.

  1. Configure the credentials as required. Copy the Client Id and Client Secret. These will be referred to in the secrets within the flow.

Create Scripted REST API

  1. Navigate to Scripted REST APIs

  1. Click on New. Enter a name e.g. AttackForge. Select vulnerability_integration_svc in Default ACLs.

  1. Click Submit. Click New.

  1. Enter Get Vulnerable Item in Name. Select GET for HTTP method. Enter /vulnerable_item/{vulnId} for the Relative Path. Copy the Resource Path - this will be referenced later in the flow secrets. Enter the following code, the click Update.

  1. Click New.

  1. Enter Update Vulnerable Item in Name. Select POST for HTTP method. Enter /update_vulnerable_item for the Relative Path. Copy the Resource Path - this will be referenced later in the flow secrets. Enter the following code, the click Update.

Initial Set Up

Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows

  • Event: Vulnerability Updated

  • Secrets:

    • snow_client_id - your ServiceNow Client Id (see Prerequisites above)

    • snow_client_secret - your ServiceNow Client Id (see Prerequisites above)

    • snow_hostname - your ServiceNow hostname e.g. company.service-now.com

    • snow_get_vulnitem_api - your ServiceNow Scripted REST API route for Get Vulnerable Item (see Prerequisites above)

    • snow_update_vulnitem_api - your ServiceNow Scripted REST API route for Update Vulnerable Item (see Prerequisites above)

Action 1 - Get OAuth Token

  • Method: POST

  • URL: https://{{snow_hostname}}/oauth_token.do

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/x-www-form-urlencoded

  • Request Script:

  • Response Script:

Action 2 - Get SNOW VR Item Status

  • Method: GET

  • URL: https://{{snow_hostname}}{{snow_get_vulnitem_api}}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

  • Request Script:

  • Response Script:

Action 3 - Detect If Status Changed

  • Script:

Action 4 - Update SNOW VR Item

  • Method: POST

  • URL: https://{{snow_hostname}}{{snow_update_vulnitem_api}}

  • Headers:

    • Key = Content-Type; Type = Value; Value = application/json

  • Request Script:

  • Response Script:

Last updated