Grype Executor¶
Category: IaC, Containers and Kubernetes
Script: grype.py
Integration: CLI
Faraday Plugin: GrypePlugin
Website: anchore/grype
Description¶
Runs the Anchore Grype vulnerability scanner on a container image, directory or SBOM and imports the vulnerabilities found into Faraday.
Prerequisites¶
grypeinstalled and available in the agent'sPATH(checked withgrype version)- Network access to pull the image and the Grype vulnerability database (for image targets)
- Credentials configured for Grype/Docker if the image is in a private registry
Configuration¶
Environment Variables (Setup)¶
This executor does not require setup environment variables.
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
GRYPE_TARGET |
string | Yes | What to scan: an image name (e.g., alpine:3.10), a directory or an SBOM path |
GRYPE_FAIL_ON |
string | No | Make Grype report failure when it finds vulnerabilities at or above this severity: negligible, low, medium, high or critical |
GRYPE_ONLY_FIXED |
boolean | No | Set to true to hide vulnerabilities that have no fix available (default: false) |
GRYPE_SCOPE |
string | No | Layers to scan: squashed (default, the merged image) or all-layers (every layer) |
YAML Configuration Example¶
executors:
grype:
repo_executor: grype.py
max_size: 65536
varenvs: {}
params:
GRYPE_TARGET:
mandatory: true
type: string
base: string
GRYPE_FAIL_ON:
mandatory: false
type: string
base: string
GRYPE_ONLY_FIXED:
mandatory: false
type: boolean
base: boolean
GRYPE_SCOPE:
mandatory: false
type: string
base: string
How It Works¶
- Runs
grype <target> -o json -q, adding--fail-on,--only-fixedand--scopewhen configured - Parses the JSON output with
GrypePluginand sends the results to Faraday
Notes¶
GRYPE_TARGETaccepts anything Grype can scan: an image name (e.g.,alpine:3.10), a directory (e.g.,dir:/app) or an SBOM file (e.g.,sbom:./sbom.json).GRYPE_FAIL_ONmakes Grype exit with an error when it finds a vulnerability at or above the given severity. The findings are still imported if Grype prints its results.- The executor fails if Grype prints no output.
- Supports the shared agent parameters (
AGENT_CONFIG_*tags and severity filters).