Skip to main content
Skip table of contents

Update Global List

LAST UPDATED: AUG 08, 2024

Updates an object in the specified global list via a key-value pair.

READER NOTE

  • Only the key and value of a top-level property within a second-level JSON object are valid.

  • If an incorrect key or value is provided (data type or literal value), users will still receive a response – one that includes identical old and new lists in the context data.

CAUTION

When multiple properties are present within a single JSON object, specifying the key and value for one property will cause the entire object to be replaced upon command execution.

Implementation

System

Command Category

System Utility

Tags

GLOBAL LIST

Inputs

Parameter Name

Required/Optional

Description

Sample Data

Global List Name

Required

The name of the global list.

demoGlobalList

Key

Required

The key of a JSON object property. Used in conjunction with the Value to determine matching object(s).

ipAddress

Value

Required

The value associated with the selected key. Used in conjunction with the Key to determine matching object(s).

192.168.1.01

Object

Required

The new object that replaces all matching second-level objects in the global list.

CODE
{
  "key1": "value1",
  "key2": "value2",
  "key3": "value3"
}

Output

Return Data

The returned result of this command. If some required parameters are not defined, this returned data could be empty. The returned result can be passed down directly to a subsequent command in playbooks.

SAMPLE DATA

JSON
Succeed
Context Data

The response data from the utility command.

SAMPLE DATA

JSON
{
    "OldList": [
        {
            "ipAddress": "192.168.1.01"
        },
        {
            "ipAddress": "192.168.1.02"
        }
    ],
    "NewList": [
        {
            "ipAddress": "192.168.1.02"
        },
        {
            "key1": "value1",
            "key2": "value2",
            "key3": "value3"
        }
    ]
}

Remote Command API

The D3 command API allows you to send requests to D3 SOAR to execute this utility command via REST API.

Request

POST

CODE
https:/{base_url}/{api_namespace}/api/Command/UpdateGlobalList

Headers

Please refer to the page Webhook Configuration Guide - Authentication Method: API Keys for more details.

Request Body

JSON
{
  "Username": "<Username here>",
  "Site": "<Site here>",
  "CommandParams": {
    "Global List Name": "<Global List Name here>",
    "Key": "<Key here>",
    "Value": "<Value here>",
    "Object": "<Object here>"
  }
}

Body Parameters

Parameter Name

Type

Required/Optional

Description

Username

string

Required

The username of your D3 SOAR account.

Site

string

Required

The D3 SOAR site to run the remote command.

Global List Name

string

Required

The name of the global list.

Key

string

Required

The key to match in existing global list content.

Value

string

Required

The value to match in existing global list content.

Object

JSON Object

Required

The object used to replace the matched objects in the global list content.

Sample Request

SAMPLE DATA

JSON
{
  "Username": "Admin",
  "Site": "Security Operations",
  "CommandParams": {
    "Global List Name": "demoGlobalList",
    "Key": "ipAddress",
    "Value": "192.168.1.01",
    "Object": {
      "key1": "value1",
      "key2": "value2",
      "key3": "value3"
    }
  }
}

Response

Response Fields

Field Name

Type

Description

result

string

The HTML table representation of the adjusted global list.

error

string

The error message if the API request has failed.

returnData

string

The return data from the API request.

contextData

JSON Object

The context data from the API request.

Sample Response

JSON
{
    "result": "<table class='cc-table'><tr><th>ipAddress</th><th>key1</th><th>key2</th><th>key3</th></tr><tr><td>192.168.1.02</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>value1</td><td>value2</td><td>value3</td></tr></table>",
    "error": "",
    "returnData": "Succeed",
    "contextData": {
        "OldList": [
            {
                "ipAddress": "192.168.1.01"
            },
            {
                "ipAddress": "192.168.1.02"
            }
        ],
        "NewList": [
            {
                "ipAddress": "192.168.1.02"
            },
            {
                "key1": "value1",
                "key2": "value2",
                "key3": "value3"
            }
        ]
    }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.