id: vmray
name: VMRay
version: 1.0.0
description: "VMRay (REST API) — detonate files and URLs in the VMRay sandbox, retrieve samples/submissions/analyses (by ID or hash), and pull IOCs. API-key authentication; stdlib-only, no extra Python dependencies. Works with VMRay Cloud or an on-prem appliance."
changelog: "1.0.0 — Initial release: file/URL submission, sample/submission/analysis retrieval, sample-by-hash lookup and IOCs."
category: enrichment

# Per-instance configuration. The API key is sent as 'Authorization: api_key <key>'.
config_schema:
  properties:
    server_url:
      type: string
      description: "VMRay server URL (e.g. https://cloud.vmray.com)"
    api_key:
      type: string
      description: "VMRay API key"
      x-soar-sensitive: true
  required:
    - server_url
    - api_key

commands:
  - id: upload_sample
    name: vmray-upload-sample
    description: "Submit a file (base64) for analysis. Returns submission and sample IDs."
    inputs_schema:
      properties:
        file_name: { type: string, description: "File name" }
        content_base64: { type: string, description: "File content, base64-encoded" }
        tags: { type: string, description: "Comma-separated tags" }
      required: [file_name, content_base64]
    outputs_schema: { properties: {} }
  - id: upload_url
    name: vmray-upload-url
    description: "Submit a URL for analysis."
    inputs_schema:
      properties:
        url: { type: string, description: "URL to detonate" }
        tags: { type: string, description: "Comma-separated tags" }
      required: [url]
    outputs_schema: { properties: {} }
  - id: get_sample
    name: vmray-get-sample
    description: "Get a sample's details and verdict by sample ID."
    risk: read
    inputs_schema:
      properties:
        sample_id: { type: string, description: "Sample ID" }
      required: [sample_id]
    outputs_schema: { properties: {} }
  - id: get_sample_by_hash
    name: vmray-get-sample-by-hash
    description: "Look up samples by file hash (MD5, SHA1 or SHA256)."
    risk: read
    inputs_schema:
      properties:
        hash: { type: string, description: "File hash" }
      required: [hash]
    outputs_schema: { properties: {} }
  - id: get_submission
    name: vmray-get-submission
    description: "Get a submission's status by submission ID."
    risk: read
    inputs_schema:
      properties:
        submission_id: { type: string, description: "Submission ID" }
      required: [submission_id]
    outputs_schema: { properties: {} }
  - id: get_analysis_by_sample
    name: vmray-get-analysis-by-sample
    description: "List the analyses for a sample."
    risk: read
    inputs_schema:
      properties:
        sample_id: { type: string, description: "Sample ID" }
      required: [sample_id]
    outputs_schema: { properties: {} }
  - id: get_iocs
    name: vmray-get-iocs
    description: "Get the IOCs extracted for a sample."
    risk: read
    inputs_schema:
      properties:
        sample_id: { type: string, description: "Sample ID" }
      required: [sample_id]
    outputs_schema: { properties: {} }

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