Skip to content

Detectify Executor

Category: Attack Surface Management Script: detectify.py Integration: REST API (HMAC-signed) Faraday Plugin: Raw JSON Website: https://detectify.com/

Description

Imports the domains and findings of a Detectify team (external attack surface management) into Faraday. Each Detectify domain becomes a host and its findings become vulnerabilities, prefixed with [EASM].

Prerequisites

  • A Detectify account with API access
  • A Detectify API key and secret (Team Settings -> API Keys)
  • The team token of the Detectify team to import

Configuration

Environment Variables (Setup)

Variable Required Description
DETECTIFY_API_KEY Yes Detectify API key
DETECTIFY_HOST No Detectify API URL (default: https://api.detectify.com)
DETECTIFY_SECRET Yes Detectify API secret (the base64 value shown when you create the key)

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

Execution Arguments

Parameter Type Mandatory Description
DETECTIFY_TEAM_TOKEN string Yes Token of the Detectify team to import
DETECTIFY_DOMAIN_TOKEN string No Import only the findings of this domain token (default: all domains of the team)
DETECTIFY_MIN_SEVERITY string No Minimum severity to import: info, low, medium, high or critical (default: no filter)
DETECTIFY_PAGES string No Maximum number of pages (100 items each) to read per list, from 1 to 50 (default: 5)

YAML Configuration Example

executors:
  detectify:
    repo_executor: detectify.py
    max_size: 65536
    varenvs:
      DETECTIFY_API_KEY: "<detectify_api_key>"
      DETECTIFY_SECRET: "<detectify_secret>"
    params:
      DETECTIFY_TEAM_TOKEN:
        mandatory: true
        type: string
        base: string
      DETECTIFY_DOMAIN_TOKEN:
        mandatory: false
        type: string
        base: string
      DETECTIFY_MIN_SEVERITY:
        mandatory: false
        type: string
        base: string
      DETECTIFY_PAGES:
        mandatory: false
        type: string
        base: string

How It Works

  1. Signs every request with the API key and secret (X-Detectify-Key, X-Detectify-Timestamp and X-Detectify-Signature headers)
  2. Lists the team's domains from /rest/v3/teams/{team_token}/domains/, 100 per page, following the marker cursor
  3. Lists the findings from /rest/v3/teams/{team_token}/findings/, or from /rest/v3/teams/{team_token}/domains/{domain_token}/findings/ when DETECTIFY_DOMAIN_TOKEN is set
  4. Attaches each finding to its domain and maps it to a Faraday vulnerability:
    • Severity: Detectify's severity label, or its CVSS/risk score when there is no label
    • Status: open-like statuses stay open, fixed/resolved become closed, accepted risk/false positive/won't fix/dismissed become risk-accepted
    • Details: description, affected URL, CVEs found in the finding, CWE and other references
  5. Applies DETECTIFY_MIN_SEVERITY, if set, and sends the result to Faraday

Notes

  • Hosts use the synthetic IP 0.0.0.0 because Detectify is domain-based. The domain name is the hostname.
  • Findings that cannot be matched to a listed domain are grouped under a host named (unattached).
  • The executor reads at most DETECTIFY_PAGES pages for the domains and for the findings.
  • An unrecognized DETECTIFY_MIN_SEVERITY is ignored and logged.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use DETECTIFY_MIN_SEVERITY to filter by severity.