id: carbon_black_cloud
name: VMware Carbon Black Cloud
version: 1.0.0
description: "VMware Carbon Black Cloud (Platform API) — endpoint containment: search and read devices, quarantine/unquarantine an endpoint, trigger a background scan, update a device's policy, search alerts, and ban/unban a file hash (reputation override). API-token authentication; stdlib-only, no extra Python dependencies."
changelog: "1.0.0 — Initial release: device search/get, quarantine/unquarantine, background scan, update policy, alert search, ban hash, delete reputation override."
category: endpoint

# Per-instance configuration. The API token is sent as
# 'X-Auth-Token: <api_secret_key>/<api_id>'. org_key identifies the org.
config_schema:
  properties:
    base_url:
      type: string
      description: "Carbon Black Cloud URL (e.g. https://defense.conferdeploy.net)"
    api_id:
      type: string
      description: "API key ID"
    api_secret_key:
      type: string
      description: "API secret key"
      x-soar-sensitive: true
    org_key:
      type: string
      description: "Organization key"
  required:
    - base_url
    - api_id
    - api_secret_key
    - org_key

commands:
  - id: list_devices
    name: cbc-list-devices
    description: "Search devices (optionally by hostname or IP)."
    risk: read
    inputs_schema:
      properties:
        query: { type: string, description: "Free-text query (hostname, user, IP)" }
        rows: { type: number, description: "Max devices (default 50)" }
      required: []
    outputs_schema: { properties: {} }
  - id: get_device
    name: cbc-get-device
    description: "Get a single device by ID."
    risk: read
    inputs_schema:
      properties:
        device_id: { type: string, description: "Device ID" }
      required: [device_id]
    outputs_schema: { properties: {} }
  - id: quarantine_device
    name: cbc-quarantine-device
    description: "Quarantine (network-isolate) a device."
    inputs_schema:
      properties:
        device_id: { type: string, description: "Device ID" }
      required: [device_id]
    outputs_schema: { properties: {} }
  - id: unquarantine_device
    name: cbc-unquarantine-device
    description: "Remove a device from quarantine."
    inputs_schema:
      properties:
        device_id: { type: string, description: "Device ID" }
      required: [device_id]
    outputs_schema: { properties: {} }
  - id: background_scan
    name: cbc-background-scan
    description: "Start or stop a background scan on a device."
    inputs_schema:
      properties:
        device_id: { type: string, description: "Device ID" }
        toggle: { type: string, description: "ON or OFF (default ON)" }
      required: [device_id]
    outputs_schema: { properties: {} }
  - id: update_device_policy
    name: cbc-update-device-policy
    description: "Assign a device to a different policy."
    inputs_schema:
      properties:
        device_id: { type: string, description: "Device ID" }
        policy_id: { type: string, description: "Target policy ID" }
      required: [device_id, policy_id]
    outputs_schema: { properties: {} }
  - id: search_alerts
    name: cbc-search-alerts
    description: "Search alerts."
    risk: read
    inputs_schema:
      properties:
        query: { type: string, description: "Free-text alert query" }
        rows: { type: number, description: "Max alerts (default 50)" }
      required: []
    outputs_schema: { properties: {} }
  - id: ban_hash
    name: cbc-ban-hash
    description: "Ban a file by SHA-256 hash (reputation deny-list override)."
    inputs_schema:
      properties:
        sha256: { type: string, description: "SHA-256 hash to ban" }
        filename: { type: string, description: "Optional associated file name" }
        description: { type: string, description: "Optional reason/description" }
      required: [sha256]
    outputs_schema: { properties: {} }
  - id: delete_reputation_override
    name: cbc-delete-reputation-override
    description: "Delete a reputation override (unban) by its ID."
    inputs_schema:
      properties:
        override_id: { type: string, description: "Reputation override ID" }
      required: [override_id]
    outputs_schema: { properties: {} }

  - id: test_connection
    name: cbc-test-connection
    description: "Verify connectivity and the API token (used by the Test button)."
    risk: read
    inputs_schema:
      properties: {}
      required: []
    outputs_schema: { properties: {} }
