Skip to content

RiskIQ PassiveTotal Executor

Category: Attack Surface Management Script: riskiq.py Integration: REST API Faraday Plugin: Raw JSON Website: https://www.riskiq.com/

Description

Enriches one domain, IP address or host name with RiskIQ PassiveTotal (Microsoft Defender EASM) and imports the result into Faraday. The asset becomes a Faraday host, and malicious or suspicious classifications, past compromises and risky tags become [EASM] vulnerabilities.

Prerequisites

  • A RiskIQ PassiveTotal account with an API key pair (the account email and the API key)
  • requests available in the agent's Python environment (checked with python3 -c 'import requests')
  • Enough PassiveTotal enrichment quota for the query

Configuration

Environment Variables (Setup)

Variable Required Description
RISKIQ_HOST No PassiveTotal API URL (default: https://api.passivetotal.org). Change it only for a custom deployment.
RISKIQ_USER Yes PassiveTotal account email (API username)
RISKIQ_API_KEY Yes PassiveTotal API key

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

Execution Arguments

Parameter Type Mandatory Description
RISKIQ_QUERY string Yes Domain, IP address or host name to enrich (e.g., example.com, 192.0.2.1 or mail.example.com)
RISKIQ_TYPE string No Type of the query: domain, ip or host (default: domain). Aliases such as fqdn, ipv4 and hostname are accepted. Unknown values fall back to domain.

YAML Configuration Example

executors:
  riskiq:
    repo_executor: riskiq.py
    max_size: 65536
    varenvs:
      RISKIQ_HOST: "https://api.passivetotal.org"
      RISKIQ_USER: "<riskiq_user>"
      RISKIQ_API_KEY: "<riskiq_api_key>"
    params:
      RISKIQ_QUERY:
        mandatory: true
        type: string
        base: string
      RISKIQ_TYPE:
        mandatory: false
        type: string
        base: string

How It Works

  1. Authenticates with HTTP Basic, using RISKIQ_USER as user and RISKIQ_API_KEY as password
  2. Reads GET /v2/account/sources and GET /v2/account/quotas for context. If either call fails, the run continues.
  3. Calls GET /v2/enrichment with the query and its type
  4. Creates one Faraday host for the queried asset, including its sub-domains, and adds these vulnerabilities:
    • Classification: a high finding if RiskIQ classifies the asset as malicious, medium if suspicious
    • Previously compromised: a high finding if RiskIQ reports everCompromised
    • Tags: one finding per tag in a risky category: high for malware, phishing, fraud, ransomware, C2 or exploit, medium for suspicious or Tor, low for proxy or VPN

Notes

  • The host IP is the query when RISKIQ_TYPE is ip. For domain and host queries, PassiveTotal gives no IP, so the host uses 0.0.0.0 and the domain, primary domain and sub-domains as hostnames.
  • Tags in other categories, and benign or unknown classifications, are not created as findings. The classification is kept in the host description.
  • If the enrichment call fails (other than a 401, which stops the run), an empty host for the query is imported.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.