Security Scans¶
Drape ingests security scan results and tracks vulnerabilities across your repositories. It detects new and resolved CVEs, tracks severity breakdowns, and enforces SLA-based remediation timelines.
Supported Formats¶
| Format | Description |
|---|---|
sarif |
SARIF JSON (Grype, Trivy, Snyk, etc.) |
cyclonedx |
CycloneDX JSON (npm audit, etc.) |
pip-audit-json |
pip-audit native JSON (--format json) |
How It Works¶
- Run a vulnerability scanner that outputs SARIF or CycloneDX
- Upload the results to Drape via the GitHub Action
- Drape tracks vulnerabilities, detects new/resolved CVEs, and posts PR comments
Image Scans¶
Scan container images for known vulnerabilities. The examples on this page assume the job has id-token: write, so the action uploads without an API key. See GitHub Action setup.
- name: Run Grype scan
uses: anchore/scan-action@v6
with:
image: my-app:latest
output-format: sarif
output-file: scan.sarif
- name: Upload scan results
uses: drape-io/drape-action@v2
if: always()
continue-on-error: true
with:
command: scan
file: scan.sarif
format: sarif
scan-name: my-app
scan-tag: latest
scan-type: image
fail-on-vulnerabilities: true
You can also use glob patterns to upload multiple scan files at once:
Dependency Scans¶
Scan your project's dependencies for known vulnerabilities. Most dependency scanners output CycloneDX. For pip-audit, upload its native JSON instead: its CycloneDX output leaves out fix versions, so Drape would show every finding's fix as unknown.
- name: Run pip-audit
run: |
pip-audit --format json --aliases on --output pip-audit.json || true
- name: Upload dependency scan
uses: drape-io/drape-action@v2
if: always()
continue-on-error: true
with:
command: scan
file: pip-audit.json
format: pip-audit-json
scan-name: pip-audit
scan-type: dependency
fail-on-vulnerabilities: true
Keep --aliases on. Drape records each pip-audit finding under its GHSA id, the same id Grype uses, and that id is only in the report when aliases are included.
If you already upload pip-audit's CycloneDX output, those findings are stored under pip-audit's own PYSEC-... ids. The first upload in the native format reports them as new findings, which fails fail-on-vulnerabilities on that run and resets their first-seen dates. Suppressions made under the old ids no longer match. Switch while the scan has no open findings, or upload under a new scan-name.
Combining Image + Dependency Scans¶
For comprehensive security coverage, run both scan types in the same job. Each upload is tracked separately:
# Image vulnerabilities (Grype on Docker image)
- uses: drape-io/drape-action@v2
with:
command: scan
file: "test-results/scan*.sarif"
format: sarif
scan-name: my-app
scan-tag: ci
scan-type: image
fail-on-vulnerabilities: true
# Dependency vulnerabilities (pip-audit)
- uses: drape-io/drape-action@v2
with:
command: scan
file: test-results/pip-audit.json
format: pip-audit-json
scan-name: pip-audit
scan-type: dependency
fail-on-vulnerabilities: true
Scan Types¶
| Type | Description |
|---|---|
image |
Container image scan (e.g., Grype, Trivy on a Docker image) |
dependency |
Dependency scan (e.g., pip-audit, npm audit, Snyk) |
Failing on Vulnerabilities¶
Set fail-on-vulnerabilities: 'true' to make the action exit non-zero when a scan introduces new unsuppressed vulnerabilities. Drape compares a pull request's scan with the latest scan of the same name on the target branch, and a push to the default branch with that branch's previous scan. Vulnerabilities already present there don't fail the check. The first scan of a name, and a push to any other branch, have nothing to compare against, so every vulnerability counts as new. Your security policy can fail a scan whether or not this is set, for example on a new critical CVE or a CVE past its SLA deadline, when there is an earlier scan to compare against. Control the threshold with fail-on-severity:
| Severity | Fails on |
|---|---|
critical |
Critical only |
high |
Critical + High |
medium |
Critical + High + Medium (default) |
low |
All severities |
any |
Any vulnerability |
PR Comments¶
The action posts a PR comment with:
- Severity breakdown table (Critical / High / Medium / Low)
- New vulnerabilities introduced in the PR
- Resolved vulnerabilities
- NVD links for each CVE
- SLA violation warnings
Suppression¶
Known vulnerabilities can be suppressed in the Drape UI — for example, if a CVE doesn't apply to your usage or a fix isn't available yet. Suppressed vulnerabilities don't trigger fail-on-vulnerabilities.