Lacework (CNAPP) Executor¶
Category: Cloud Security
Script: lacework.py
Integration: REST API
Faraday Plugin: Raw JSON
Website: https://www.lacework.com/
Description¶
Imports host and container image vulnerability assessments from a Lacework tenant into Faraday. Each affected machine or container image becomes a host, and each finding becomes a vulnerability.
Prerequisites¶
- A Lacework tenant with API access
- A Lacework API key ID and secret (service account) with permission to read vulnerability data
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
LACEWORK_ACCOUNT |
Yes | Lacework account name (e.g., acme, which resolves to https://acme.lacework.net) or a full tenant URL |
LACEWORK_API_KEY |
Yes | API key ID |
LACEWORK_API_SECRET |
Yes | API key secret |
These variables are also accepted as execution arguments, so a single run can override them.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
LACEWORK_SCOPE |
string | No | What to import: hosts, containers or both (default: both) |
LACEWORK_MIN_SEVERITY |
string | No | Minimum severity to import: info, low, medium, high or critical (default: info) |
YAML Configuration Example¶
executors:
lacework:
repo_executor: lacework.py
max_size: 65536
varenvs:
LACEWORK_ACCOUNT: "acme"
LACEWORK_API_KEY: "<lacework_api_key>"
LACEWORK_API_SECRET: "<lacework_api_secret>"
params:
LACEWORK_SCOPE:
mandatory: false
type: string
base: string
LACEWORK_MIN_SEVERITY:
mandatory: false
type: string
base: string
How It Works¶
- Requests a bearer token from
/api/v2/access/tokens, sending the key ID in the body and the secret in theX-LW-UAKSheader - Queries
POST /api/v2/Vulnerabilities/Hosts/searchand/orPOST /api/v2/Vulnerabilities/Containers/search(depending onLACEWORK_SCOPE) for findings of the last 24 hours, following the pagination links. The minimum severity is sent to Lacework as a filter. - Groups findings by machine (hosts) or by container image
- Maps each finding to a Faraday vulnerability:
- Severity: Lacework's severity, or the CVSS score when the severity is missing
- Status:
New,ActiveandReopenedbecome open;FixedandResolvedbecome closed; suppressed, muted and ignored findings become risk-accepted - References: CVEs and links from the finding
Notes¶
- Only findings from the last 24 hours are requested.
- Every host has IP
0.0.0.0, because Lacework findings belong to cloud resources. Host names look like<hostname>@<machine id>for machines and<image>@<image id>for container images. The description holds the cloud provider, account, region, registry and digest when available. - An unrecognized
LACEWORK_SCOPEfalls back toboth, and an unrecognizedLACEWORK_MIN_SEVERITYfalls back toinfo. - TLS certificates are not verified.
- The setup variables can also be passed as execution arguments.
- The shared agent parameters (
AGENT_CONFIG_*tags and severity filters) are not applied by this executor. UseLACEWORK_MIN_SEVERITYto filter by severity.