id: extrahop
name: ExtraHop
version: 1.0.0
description: "ExtraHop Reveal(x) (REST API v1) — network detection and asset context: search and read detections, list and search devices, and read a device. API-key (ESA) authentication; stdlib-only, no extra Python dependencies."
changelog: "1.0.0 — Initial release: search/get detections, list/search devices, get device."
category: ndr

# Per-instance configuration. Auth header 'Authorization: ESA <api_key>'.
config_schema:
  properties:
    base_url:
      type: string
      description: "ExtraHop appliance URL (e.g. https://extrahop.example.com)"
    api_key:
      type: string
      description: "ExtraHop REST API key"
      x-soar-sensitive: true
    insecure:
      type: boolean
      description: "Trust any TLS certificate (not secure)"
      default: false
  required:
    - base_url
    - api_key

commands:
  - id: search_detections
    name: extrahop-search-detections
    description: "Search detections in a time window."
    risk: read
    inputs_schema:
      properties:
        from_time: { type: number, description: "Start time (Unix ms, negative = relative, e.g. -3600000)" }
        limit: { type: number, description: "Max detections (default 50)" }
        min_risk_score: { type: number, description: "Minimum risk score 0-99 (optional)" }
      required: []
    outputs_schema: { properties: {} }
  - id: get_detection
    name: extrahop-get-detection
    description: "Get a single detection by ID."
    risk: read
    inputs_schema:
      properties:
        detection_id: { type: string, description: "Detection ID" }
      required: [detection_id]
    outputs_schema: { properties: {} }
  - id: list_devices
    name: extrahop-list-devices
    description: "List devices."
    risk: read
    inputs_schema:
      properties:
        limit: { type: number, description: "Max devices (default 50)" }
      required: []
    outputs_schema: { properties: {} }
  - id: search_devices
    name: extrahop-search-devices
    description: "Search devices by IP, name, or MAC."
    risk: read
    inputs_schema:
      properties:
        field: { type: string, description: "Field to match: ipaddr, name, or macaddr (default ipaddr)" }
        value: { type: string, description: "Value to match" }
        limit: { type: number, description: "Max devices (default 50)" }
      required: [value]
    outputs_schema: { properties: {} }
  - id: get_device
    name: extrahop-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: test_connection
    name: extrahop-test-connection
    description: "Verify connectivity and the API key (used by the Test button)."
    risk: read
    inputs_schema:
      properties: {}
      required: []
    outputs_schema: { properties: {} }
