Skip to content

Bishop Fox Cosmos Executor

Category: Attack Surface Management Script: bishopfox_cosmos.py Integration: REST API Faraday Plugin: Raw JSON Website: https://bishopfox.com/platform/cosmos

Description

Imports externally discovered assets and security findings from Bishop Fox Cosmos attack surface management into Faraday. Each asset becomes a host, and its findings become vulnerabilities.

Prerequisites

  • A Bishop Fox Cosmos tenant with API access
  • A Cosmos API key with permission to read assets and findings
  • requests available in the agent's Python environment

Configuration

Environment Variables (Setup)

Variable Required Description
COSMOS_HOST Yes Bishop Fox Cosmos API host (e.g., https://cosmos.bishopfox.com). https:// is added if missing.
COSMOS_API_KEY Yes Bishop Fox Cosmos API key

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
COSMOS_ENGAGEMENT_ID string No Restrict the import to one Cosmos engagement (shown in the console URL). Default: whatever the API key can see.
COSMOS_MIN_SEVERITY string No Minimum severity of the findings to import: info, low, medium, high or critical. Cosmos names such as Important, Moderate, Sev1 to Sev5 and P1 to P5 also work. Default: import all findings.
COSMOS_PAGES string No Maximum number of pages of 100 records to read for assets and, separately, for findings (default: 5, maximum: 50)

YAML Configuration Example

executors:
  bishopfox_cosmos:
    repo_executor: bishopfox_cosmos.py
    max_size: 65536
    varenvs:
      COSMOS_HOST: "https://cosmos.bishopfox.com"
      COSMOS_API_KEY: "<cosmos_api_key>"
    params:
      COSMOS_ENGAGEMENT_ID:
        mandatory: false
        type: string
        base: string
      COSMOS_MIN_SEVERITY:
        mandatory: false
        type: string
        base: string
      COSMOS_PAGES:
        mandatory: false
        type: string
        base: string

How It Works

  1. Authenticates every request with the Cosmos API key
  2. Reads the external assets from GET {COSMOS_HOST}/api/v1/assets and the findings from GET {COSMOS_HOST}/api/v1/findings, 100 records per page, optionally scoped to COSMOS_ENGAGEMENT_ID
  3. Creates one host per asset, using its first public IP (or 0.0.0.0) and its domain and hostname values as hostnames
  4. Attaches each finding to its asset by asset ID and maps it to a Faraday vulnerability, with severity from the finding's severity, priority or risk score (0 to 10), and status derived from the finding's state (resolved/fixed become closed, risk-accepted/false-positive/dismissed become risk-accepted)

Notes

  • Findings that do not match any imported asset are grouped under one host with the IP 0.0.0.0 and the hostname (unattached).
  • By default the executor reads at most 500 assets and 500 findings per run. Raise COSMOS_PAGES for larger engagements.
  • COSMOS_MIN_SEVERITY only filters findings. Assets are still imported as hosts when all their findings are filtered out. Unrecognized values are ignored.
  • COSMOS_HOST can be given with or without https://. Without it, https:// is assumed.
  • The run stops if the API key is rejected (HTTP 401). If Cosmos rate-limits or denies a later request, the executor keeps what it has already read.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use COSMOS_MIN_SEVERITY to filter by severity.