<commit_before>id: D2 - Endpoint data collection
version: -1
name: D2 - Endpoint data collection
description: |-
  Uses Demisto's d2 agent to collect data from an endpoint for IR purposes.

  Input:
  * Hostname (default: ${Endpoint.Hostname})
  * OS (default: windows)
  * Credentials (default: Admin)
  * Path (default: None)
starttaskid: "0"
tasks:
  "0":
    id: "0"
    taskid: 816b1abc-8a51-4b98-8edb-8f200d16f878
    type: start
    task:
      id: 816b1abc-8a51-4b98-8edb-8f200d16f878
      version: -1
      name: ""
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "7"
    view: |-
      {
        "position": {
          "x": 500,
          "y": 50
        }
      }
  "3":
    id: "3"
    taskid: ffd5619d-eb26-4f14-8d71-b62e1e6bc97d
    type: regular
    task:
      id: ffd5619d-eb26-4f14-8d71-b62e1e6bc97d
      version: -1
      name: Add the endpoint as a System to this incident
      description: Add the relevant endpoint to the System
      scriptName: IncidentAddSystem
      type: regular
      iscommand: false
      brand: ""
    nexttasks:
      '#none#':
      - "14"
    scriptarguments:
      arch: ""
      credentialSet: ${inputs.Credentials}
      dmbPort: ""
      host: ${inputs.Host}
      name: ${inputs.Host}
      os: ${inputs.OS}
      password: ""
      sshPort: ""
      username: ""
      workgroup: ""
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 370
        }
      }
  "4":
    id: "4"
    taskid: a3cd0e59-5d57-4782-8795-0ea3811ec4d6
    type: regular
    task:
      id: a3cd0e59-5d57-4782-8795-0ea3811ec4d6
      version: -1
      name: d2 agent - Get process list
      scriptName: ExecuteCommandD2
      type: regular
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "5"
    scriptarguments:
      arguments: ""
      commandName: D2Processes
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 690
        }
      }
  "5":
    id: "5"
    taskid: 7411d33a-9c1c-494f-8422-c972b524abe2
    type: regular
    task:
      id: 7411d33a-9c1c-494f-8422-c972b524abe2
      version: -1
      name: d2 agent - Get hardware details
      description: Get Hardware details from endpoint
      scriptName: ExecuteCommandD2
      type: regular
      iscommand: false
      brand: ""
    nexttasks:
      '#none#':
      - "8"
    scriptarguments:
      arguments: ""
      commandName: D2Hardware
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 857
        }
      }
  "6":
    id: "6"
    taskid: 34499d4a-e00a-4886-8882-e5bcddf3a892
    type: regular
    task:
      id: 34499d4a-e00a-4886-8882-e5bcddf3a892
      version: -1
      name: d2 agent - Get active users
      scriptName: ActiveUsersD2
      type: regular
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "12"
    view: |-
      {
        "position": {
          "x": -479,
          "y": 1008
        }
      }
  "7":
    id: "7"
    taskid: bfdb339a-a8b5-4b46-822c-23b4d515787e
    type: condition
    task:
      id: bfdb339a-a8b5-4b46-822c-23b4d515787e
      version: -1
      name: Does 'Host' input exist?
      description: Check if a given value exists in the context. Will return 'no'
        for empty empty arrays. To be used mostly with DQ and selectors.
      scriptName: Exists
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      "no":
      - "12"
      "yes":
      - "3"
    scriptarguments:
      value: ${inputs.Host}
    view: |-
      {
        "position": {
          "x": 500,
          "y": 196
        }
      }
  "8":
    id: "8"
    taskid: 51867be7-4781-4482-87aa-2181e138b651
    type: condition
    task:
      id: 51867be7-4781-4482-87aa-2181e138b651
      version: -1
      name: Any files on endpoint that we should collect?
      scriptName: Exists
      type: condition
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#default#':
      - "12"
      "yes":
      - "11"
    scriptarguments:
      value: ${inputs.Path}
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 1040
        }
      }
  "11":
    id: "11"
    taskid: 6289197b-4aa9-4e44-8b96-d5abd1a9dbb3
    type: regular
    task:
      id: 6289197b-4aa9-4e44-8b96-d5abd1a9dbb3
      version: -1
      name: d2 agent - Collect file from endpoint
      scriptName: FetchFileD2
      type: regular
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "12"
    scriptarguments:
      filepath: ${File.Path}
      using: ""
    view: |-
      {
        "position": {
          "x": -41,
          "y": 1330
        }
      }
  "12":
    id: "12"
    taskid: b58ccd0e-1dbf-474b-8c8c-9de42f74d7bb
    type: title
    task:
      id: b58ccd0e-1dbf-474b-8c8c-9de42f74d7bb
      version: -1
      name: Done
      type: title
      iscommand: false
      brand: ""
      description: ""
    view: |-
      {
        "position": {
          "x": 175,
          "y": 1668
        }
      }
  "14":
    id: "14"
    taskid: 3d43e539-869a-4386-8395-2e7c6e2c91bc
    type: title
    task:
      id: 3d43e539-869a-4386-8395-2e7c6e2c91bc
      version: -1
      name: Collect data from endpoint
      type: title
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "4"
      - "15"
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 529
        }
      }
  "15":
    id: "15"
    taskid: 3a82031b-c9ed-4dff-8336-12c8279afc02
    type: condition
    task:
      id: 3a82031b-c9ed-4dff-8336-12c8279afc02
      version: -1
      name: Is the OS type Windows?
      scriptName: AreValuesEqual
      type: condition
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#default#':
      - "12"
      "yes":
      - "6"
    scriptarguments:
      left: ${inputs.OS}
      right: Windows
    results:
    - AreValuesEqual
    view: |-
      {
        "position": {
          "x": -251,
          "y": 691
        }
      }
view: |-
  {
    "linkLabelsPosition": {
      "15_12_#default#": 0.11,
      "15_6_yes": 0.58,
      "7_12_no": 0.1,
      "8_11_yes": 0.52,
      "8_12_#default#": 0.22
    },
    "paper": {
      "dimensions": {
        "height": 1683,
        "width": 1359,
        "x": -479,
        "y": 50
      }
    }
  }
inputs:
- key: Host
  value: ${Endpoint.Hostname}
  description: Deploy D2 on target Host
- key: OS
  value: windows
  description: The default OS type of target host
- key: Credentials
  value: Admin
  description: Name of the credential set from Demisto Settings -> Integrations ->
    Credentials
- key: Path
  value: ""
  description: If initialized, D2 will try and collect the file at target path<commit_msg>pr fixes<commit_after>id: D2 - Endpoint data collection
version: -1
name: D2 - Endpoint data collection
description: |-
  Uses Demisto's d2 agent to collect data from an endpoint for IR purposes.

  Input:
  * Hostname (default: ${Endpoint.Hostname})
  * OS (default: windows)
  * Credentials (default: Admin)
  * Path (default: None)
starttaskid: "0"
tasks:
  "0":
    id: "0"
    taskid: 816b1abc-8a51-4b98-8edb-8f200d16f878
    type: start
    task:
      id: 816b1abc-8a51-4b98-8edb-8f200d16f878
      version: -1
      name: ""
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "7"
    view: |-
      {
        "position": {
          "x": 500,
          "y": 50
        }
      }
  "3":
    id: "3"
    taskid: ffd5619d-eb26-4f14-8d71-b62e1e6bc97d
    type: regular
    task:
      id: ffd5619d-eb26-4f14-8d71-b62e1e6bc97d
      version: -1
      name: Add the endpoint as a System to this incident
      description: Add the relevant endpoint to the System
      scriptName: IncidentAddSystem
      type: regular
      iscommand: false
      brand: ""
    nexttasks:
      '#none#':
      - "14"
    scriptarguments:
      arch: ""
      credentialSet: ${inputs.Credentials}
      dmbPort: ""
      host: ${inputs.Host}
      name: ${inputs.Host}
      os: ${inputs.OS}
      password: ""
      sshPort: ""
      username: ""
      workgroup: ""
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 370
        }
      }
  "4":
    id: "4"
    taskid: a3cd0e59-5d57-4782-8795-0ea3811ec4d6
    type: regular
    task:
      id: a3cd0e59-5d57-4782-8795-0ea3811ec4d6
      version: -1
      name: d2 agent - Get process list
      scriptName: ExecuteCommandD2
      type: regular
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "5"
    scriptarguments:
      arguments: ""
      commandName: D2Processes
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 690
        }
      }
  "5":
    id: "5"
    taskid: 7411d33a-9c1c-494f-8422-c972b524abe2
    type: regular
    task:
      id: 7411d33a-9c1c-494f-8422-c972b524abe2
      version: -1
      name: d2 agent - Get hardware details
      description: Get Hardware details from endpoint
      scriptName: ExecuteCommandD2
      type: regular
      iscommand: false
      brand: ""
    nexttasks:
      '#none#':
      - "8"
    scriptarguments:
      arguments: ""
      commandName: D2Hardware
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 857
        }
      }
  "6":
    id: "6"
    taskid: 34499d4a-e00a-4886-8882-e5bcddf3a892
    type: regular
    task:
      id: 34499d4a-e00a-4886-8882-e5bcddf3a892
      version: -1
      name: d2 agent - Get active users
      scriptName: ActiveUsersD2
      type: regular
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "12"
    view: |-
      {
        "position": {
          "x": -479,
          "y": 1008
        }
      }
  "7":
    id: "7"
    taskid: bfdb339a-a8b5-4b46-822c-23b4d515787e
    type: condition
    task:
      id: bfdb339a-a8b5-4b46-822c-23b4d515787e
      version: -1
      name: Does 'Host' input exist?
      description: Check if a given value exists in the context. Will return 'no'
        for empty empty arrays. To be used mostly with DQ and selectors.
      scriptName: Exists
      type: condition
      iscommand: false
      brand: ""
    nexttasks:
      "no":
      - "12"
      "yes":
      - "3"
    scriptarguments:
      value: ${inputs.Host}
    view: |-
      {
        "position": {
          "x": 500,
          "y": 196
        }
      }
  "8":
    id: "8"
    taskid: 51867be7-4781-4482-87aa-2181e138b651
    type: condition
    task:
      id: 51867be7-4781-4482-87aa-2181e138b651
      version: -1
      name: Any files on endpoint that we should collect?
      scriptName: Exists
      type: condition
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#default#':
      - "12"
      "yes":
      - "11"
    scriptarguments:
      value: ${inputs.Path}
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 1040
        }
      }
  "11":
    id: "11"
    taskid: 6289197b-4aa9-4e44-8b96-d5abd1a9dbb3
    type: regular
    task:
      id: 6289197b-4aa9-4e44-8b96-d5abd1a9dbb3
      version: -1
      name: d2 agent - Collect file from endpoint
      scriptName: FetchFileD2
      type: regular
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "12"
    scriptarguments:
      filepath: ${File.Path}
      using: ""
    view: |-
      {
        "position": {
          "x": -41,
          "y": 1330
        }
      }
  "12":
    id: "12"
    taskid: b58ccd0e-1dbf-474b-8c8c-9de42f74d7bb
    type: title
    task:
      id: b58ccd0e-1dbf-474b-8c8c-9de42f74d7bb
      version: -1
      name: Done
      type: title
      iscommand: false
      brand: ""
      description: ""
    view: |-
      {
        "position": {
          "x": 175,
          "y": 1668
        }
      }
  "14":
    id: "14"
    taskid: 3d43e539-869a-4386-8395-2e7c6e2c91bc
    type: title
    task:
      id: 3d43e539-869a-4386-8395-2e7c6e2c91bc
      version: -1
      name: Collect data from endpoint
      type: title
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#none#':
      - "4"
      - "15"
    view: |-
      {
        "position": {
          "x": 162.5,
          "y": 529
        }
      }
  "15":
    id: "15"
    taskid: 3a82031b-c9ed-4dff-8336-12c8279afc02
    type: condition
    task:
      id: 3a82031b-c9ed-4dff-8336-12c8279afc02
      version: -1
      name: Is the OS type Windows?
      scriptName: AreValuesEqual
      type: condition
      iscommand: false
      brand: ""
      description: ""
    nexttasks:
      '#default#':
      - "12"
      "yes":
      - "6"
    scriptarguments:
      left: ${inputs.OS}
      right: Windows
    results:
    - AreValuesEqual
    view: |-
      {
        "position": {
          "x": -251,
          "y": 691
        }
      }
view: |-
  {
    "linkLabelsPosition": {
      "15_12_#default#": 0.11,
      "15_6_yes": 0.58,
      "7_12_no": 0.1,
      "8_11_yes": 0.52,
      "8_12_#default#": 0.22
    },
    "paper": {
      "dimensions": {
        "height": 1683,
        "width": 1359,
        "x": -479,
        "y": 50
      }
    }
  }
inputs:
- key: Host
  value: ${Endpoint.Hostname}
  description: Deploy D2 on target Host
- key: OS
  value: windows
  description: The default OS type of target host
- key: Credentials
  value: Admin
  description: Name of the credential set from Demisto Settings -> Integrations ->
    Credentials
- key: Path
  value: ""
  description: If initialized, D2 will try and collect the file at target path
releaseNotes: "-"
{'fraction_non_alphanumeric': 0.12315022016891648, 'fraction_numerical': 0.09355374287158016, 'mean_word_length': 1.6293414310115772, 'pattern_counts': {'":': 120, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6714901', 'n_tokens_mistral': 5732, 'n_tokens_neox': 5131, 'n_words': 1145}