Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .claude/skills/security-check/skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: security-check
description: Run Trivy vulnerability scan on Docker images (API and Workers). Builds images, scans for CRITICAL/HIGH CVEs, and reports findings.
user_invocable: true
---

Run a local Trivy security scan matching the CI pipeline configuration.

## Steps

1. Run `make trivy-scan` from the repo root using the Bash tool. This will:
- Build the Docker images (`caseai-connect/api:local` and `caseai-connect/workers:local`)
- Scan both images with Trivy for CRITICAL and HIGH vulnerabilities
- Apply `.trivyignore.yaml` exclusions

2. If the scan **passes** (exit code 0): report that no unignored CRITICAL/HIGH vulnerabilities were found.

3. If the scan **fails** (exit code 1): parse the Trivy output and for each CVE found:
- List the CVE ID, severity, package name, installed version, and fixed version (if available)
- Indicate whether a fix is available upstream
- Suggest next steps:
- If a direct dependency can be updated: suggest the `npm update` or `npm install` command
- If blocked on a transitive dependency with no fix: suggest using the `/trivy-ignore` skill to add it to `.trivyignore.yaml`
- If a major version bump is needed: flag it for manual review
4 changes: 2 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
pkg-types: 'os,library'
severity: 'CRITICAL,HIGH'
trivyignores: '.trivyignore.yaml'
output: 'trivy-api-results.txt'
Expand All @@ -48,7 +48,7 @@ jobs:
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
pkg-types: 'os,library'
severity: 'CRITICAL,HIGH'
trivyignores: '.trivyignore.yaml'
output: 'trivy-workers-results.txt'
Expand Down
3 changes: 3 additions & 0 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ vulnerabilities:
- id: CVE-2025-32434
expired_at: 2026-05-01
reason: "torch 2.5.1+cu121 — fix requires 2.6.0+, blocked by docling compatibility"
- id: CVE-2026-4800
expired_at: 2026-05-02
reason: "lodash 4.17.23 — fix in 4.18.1, blocked by @nestjs/config, llamaindex, @auth0/auth0-spa-js"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ check-web-changes:
# ==============================================================================

trivy-scan: docker-build
trivy image --ignore-unfixed --vuln-type os,library --severity CRITICAL,HIGH --ignorefile .trivyignore.yaml ${localApiImage}
trivy image --ignore-unfixed --vuln-type os,library --severity CRITICAL,HIGH --ignorefile .trivyignore.yaml ${localWorkersImage}
trivy image --ignore-unfixed --pkg-types os,library --severity CRITICAL,HIGH --ignorefile .trivyignore.yaml ${localApiImage}
trivy image --ignore-unfixed --pkg-types os,library --severity CRITICAL,HIGH --ignorefile .trivyignore.yaml ${localWorkersImage}

docker-build: docker-build-api docker-build-workers

Expand Down
2 changes: 1 addition & 1 deletion docs/monthly-dependency-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ make trivy-scan

`make trivy-scan` runs trivy against both `caseai-connect/api:local` and `caseai-connect/workers:local` images with:
- `--ignore-unfixed` — only report CVEs that have a fix available
- `--vuln-type os,library` — scan OS packages and language libraries
- `--pkg-types os,library` — scan OS packages and language libraries
- `--severity CRITICAL,HIGH` — ignore low/medium findings
- `--ignorefile .trivyignore.yaml` — skip acknowledged upstream CVEs

Expand Down
Loading