Mend (formerly WhiteSource) Executor¶
Category: Software Composition Analysis
Script: mend.py
Integration: REST API
Faraday Plugin: Raw JSON
Website: https://www.mend.io/
Description¶
Imports security alerts (vulnerable open-source libraries) from Mend (formerly WhiteSource) into Faraday. Each Mend project becomes a host and each alert becomes an [SCA] vulnerability.
Prerequisites¶
- A Mend account with API access (Mend API v2.0)
- A Mend user key and organization token
- The token of the project or product to import
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
MEND_HOST |
Yes | Mend API server, with or without https:// (e.g., api-saas.mend.io) |
MEND_USER_KEY |
No* | Mend user key, used together with MEND_API_KEY to log in |
MEND_API_KEY |
Yes | Mend organization token. You can also pass a ready-made JWT as Bearer <jwt>, and then MEND_USER_KEY is not needed. |
MEND_EMAIL |
No | User email, sent with the login request when set |
* Required unless MEND_API_KEY is a Bearer <jwt> value.
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
MEND_PROJECT_TOKEN |
string | No* | Token (UUID) of the project to import |
MEND_PRODUCT_TOKEN |
string | No* | Token (UUID) of a product. All its projects are imported. Ignored if MEND_PROJECT_TOKEN is set. |
MEND_MIN_SEVERITY |
string | No | Minimum severity to import: info, low, medium, high or critical (default: info) |
* You must set MEND_PROJECT_TOKEN or MEND_PRODUCT_TOKEN.
YAML Configuration Example¶
executors:
mend:
repo_executor: mend.py
max_size: 65536
varenvs:
MEND_HOST: "api-saas.mend.io"
MEND_USER_KEY: "<mend_user_key>"
MEND_API_KEY: "<mend_org_token>"
params:
MEND_PROJECT_TOKEN:
mandatory: false
type: string
base: string
MEND_PRODUCT_TOKEN:
mandatory: false
type: string
base: string
MEND_MIN_SEVERITY:
mandatory: false
type: string
base: string
How It Works¶
- Logs in with
POST /api/v2.0/login(user key and organization token) to get a JWT - Uses
MEND_PROJECT_TOKEN, or lists the product's projects withGET /api/v2.0/products/{token}/projects - For each project, reads the security alerts from
/api/v2.0/projects/{token}/alerts/security. If that endpoint is missing, it reads/alertsand keeps the security ones. It also reads the project's libraries to count them. - Maps each alert to a vulnerability:
- Name:
[SCA] <vulnerability> in <group:artifact@version> - Severity: Mend's severity, or the CVSS score when no label is available
- Status: ignored, suppressed or false-positive alerts become risk-accepted, resolved or fixed alerts become closed, the rest are open
- Resolution and references: the top fix, CVEs, CWEs and advisory links
- Name:
Notes¶
- Each project becomes one host with IP
0.0.0.0and hostname<project name>@<project token>. Projects without alerts (after filtering) are not created. - TLS certificates are not verified.
- The run fails if the login fails or neither project nor product token is set.
- The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseMEND_MIN_SEVERITYto filter by severity.