Security Endpoint Management API

Spaces method and path for this operation:

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/scripts_library</span></div>

Refer to Spaces for more information.

Create a new script entry by uploading a script file

post/api/endpoint/scripts_library

Request

  • Base URL
    https://localhost:5601
  • URL
    https://localhost:5601/api/endpoint/scripts_library
  • Auth
    • API key in header Authorization
    • or HTTP basic

Request body multipart/form-data

descriptionstring

Description of the script and its purpose/functionality

examplestring

Example usage of the script

fileobject required

The script file upload

fileType'script' | 'archive' required

The type of the uploaded file, which determines the expected value of pathToExecutable. If fileType is "script", then pathToExecutable should not be included. If fileType is "archive", then pathToExecutable is required and should specify the path to the executable file within the archive.

instructionsstring

Instructions for using the script, including details around its supported input arguments

namestring required

Name of the script

pathToExecutablestring

Used only for when the uploaded script is an archive (.zip file for example). This property defines the relative path to the file included in the archive that should be executed once its contents are extracted. The path should be relative to the root of the archive.

platformSecurityEndpointManagementAPIEndpointScriptPlatform[] required

Platforms supported by the the script

requiresInputboolean

Whether the script requires input arguments

tagsSecurityEndpointManagementAPIEndpointScriptTags[]

Tags to categorize the script

Example request

{
  "pathToExecutable": "./bin/script.sh"
}

Response

Action request was successfully created

Example response

{
  "data": {
    "description": "Collects host data for investigation",
    "downloadUri": "/api/endpoint/scripts_library/123e4567-e89b-12d3-a456-426655440000/download",
    "example": "./collect_host_data.sh --help",
    "fileHash": "abf573681eb54aac5e05e35bf186d4d31abe45ecf242461490523f11d2a8fbb8",
    "fileName": "collect_host_data.sh",
    "fileSize": 12345,
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "instructions": "Collects host data for investigation",
    "name": "Collect host data",
    "platform": [
      "linux",
      "macos"
    ],
    "requiresInput": false
  }
}

Changes

    • breaking

      the request property's minLength was increased from 0 to 1

    • warning

      the request property's maxLength was set to 10000

    • warning

      the request property's maxLength was set to 10000

    • warning

      the request property's maxLength was set to 10000

    • warning

      the request property's maxLength was set to 256

    • warning

      the request property's maxLength was set to 4096