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)
requestsavailable in the agent's Python environment (checked withpython3 -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¶
- Authenticates with HTTP Basic, using
RISKIQ_USERas user andRISKIQ_API_KEYas password - Reads
GET /v2/account/sourcesandGET /v2/account/quotasfor context. If either call fails, the run continues. - Calls
GET /v2/enrichmentwith the query and its type - Creates one Faraday host for the queried asset, including its sub-domains, and adds these vulnerabilities:
- Classification: a
highfinding if RiskIQ classifies the asset as malicious,mediumif suspicious - Previously compromised: a
highfinding if RiskIQ reportseverCompromised - Tags: one finding per tag in a risky category:
highfor malware, phishing, fraud, ransomware, C2 or exploit,mediumfor suspicious or Tor,lowfor proxy or VPN
- Classification: a
Notes¶
- The host IP is the query when
RISKIQ_TYPEisip. For domain and host queries, PassiveTotal gives no IP, so the host uses0.0.0.0and 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.