id: cape
name: CAPE Sandbox
version: 1.0.0
description: "CAPE Sandbox (APIv2) — dynamic malware analysis and config extraction: submit files and URLs, read task status and reports, and list tasks. Token authentication; stdlib-only, no extra Python dependencies."
changelog: "1.0.0 — Initial release: submit file/URL, get task, get report, list tasks."
category: enrichment

# Per-instance configuration. The token is sent as 'Authorization: Token <api_token>'.
config_schema:
  properties:
    base_url:
      type: string
      description: "CAPE URL (e.g. https://cape.example.com)"
    api_token:
      type: string
      description: "CAPE API token"
      x-soar-sensitive: true
    insecure:
      type: boolean
      description: "Trust any TLS certificate (not secure)"
      default: false
  required:
    - base_url
    - api_token

commands:
  - id: submit_file
    name: cape-submit-file
    description: "Submit a file (base64) for analysis."
    inputs_schema:
      properties:
        file_name: { type: string, description: "File name" }
        content_base64: { type: string, description: "File content, base64-encoded" }
      required: [file_name, content_base64]
    outputs_schema: { properties: {} }
  - id: submit_url
    name: cape-submit-url
    description: "Submit a URL for analysis."
    inputs_schema:
      properties:
        url: { type: string, description: "URL to detonate" }
      required: [url]
    outputs_schema: { properties: {} }
  - id: get_task
    name: cape-get-task
    description: "Get a task's status and metadata."
    risk: read
    inputs_schema:
      properties:
        task_id: { type: string, description: "Task ID" }
      required: [task_id]
    outputs_schema: { properties: {} }
  - id: get_report
    name: cape-get-report
    description: "Get a task's full analysis report (JSON)."
    risk: read
    inputs_schema:
      properties:
        task_id: { type: string, description: "Task ID" }
      required: [task_id]
    outputs_schema: { properties: {} }
  - id: list_tasks
    name: cape-list-tasks
    description: "List recent tasks."
    risk: read
    inputs_schema:
      properties:
        limit: { type: number, description: "Max tasks (default 50)" }
      required: []
    outputs_schema: { properties: {} }

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