ServiceNow
Create ServiceNow Incident
The purpose of this example is to create a ServiceNow Incident 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 Repository and imported into your AttackForge.
Initial Set Up
Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows
Event: Vulnerability Created
Secrets:
af_auth - your AttackForge Self-Service API token.
snow_auth - your SNOW API Key
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 Repository and imported into your AttackForge.
Initial Set Up
SNOW WebHooks
Configure 'incident.updated' web hook in your ServiceNow
HTTP Trigger
Method: POST
Authentication: Enabled
Secrets:
snow_auth - your SNOW API Key
x_user_key - your AttackForge Self-Service API token.
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 Repository and imported into your AttackForge.
Initial Set Up
Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows
Event: Vulnerability Updated
Secrets:
snow_auth - your SNOW API Key
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 Repository and imported into your AttackForge.
Initial Set Up
Important: This example requires access to the AttackForge Self-Service API and AttackForge Flows
Event: Vulnerability Updated
Secrets:
snow_auth - your SNOW API Key
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 Repository and imported into your AttackForge.
Prerequisites:
Configure OAuth on ServiceNow
Navigate to
Inbound Integrations

Click on
New Integration. SelectClient Credentials Grant.

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

Create Scripted REST API
Navigate to
Scripted REST APIs

Click on
New. Enter a name e.g. AttackForge. Selectvulnerability_integration_svcin Default ACLs.

Click
Submit. ClickNew.

Enter
Create Vulnerable Itemin Name. SelectPOSTfor HTTP method. Enter/create_vulnerable_itemin Relative Path. Copy theResource Path- this will be referenced later in the flow secrets. Enter the following code, the clickUpdate.


Configure Severity Map
Navigate to
Normalized Severity Maps.

Click
New. Enter the following severity maps. Ensure that theSource,Source ValueandTarget Valuebelow 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 Repository 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
Navigate to REST Messages.

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

Click
New.

Enter
POSTfor Name and selectPOSTfor HTTP method. The Endpoint should reference your AttackForge Flow Trigger URL (see flow created above).

Click
HTTP Requesttab. EnterContent-TypeandX-USER-KEYheaders. The value for theX-USER-KEYshould be your AttackForge user API key which has access to trigger the flow you created (see above). ClickUpdate.

Configure Business Rule
Navigate to
Business Rules.

Click New. Enter
Vuln Updatedfor the Name. SelectVulnerable Item [sn_vul_vulnerable_item]for the Table. TickActiveandAdvanced. In theWhen to runtab, selectafterfor When, tickUpdate.

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

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 Repository and imported into your AttackForge.
Prerequisites:
Configure OAuth on ServiceNow
Navigate to
Inbound Integrations

Click on
New Integration. SelectClient Credentials Grant.

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

Create Scripted REST API
Navigate to
Scripted REST APIs

Click on
New. Enter a name e.g. AttackForge. Selectvulnerability_integration_svcin Default ACLs.

Click
Submit. ClickNew.

Enter
Get Vulnerable Itemin Name. SelectGETfor HTTP method. Enter/vulnerable_item/{vulnId}for the Relative Path. Copy theResource Path- this will be referenced later in the flow secrets. Enter the following code, the clickUpdate.


Click
New.

Enter
Update Vulnerable Itemin Name. SelectPOSTfor HTTP method. Enter/update_vulnerable_itemfor the Relative Path. Copy theResource Path- this will be referenced later in the flow secrets. Enter the following code, the clickUpdate.


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