Scan, triage, and remediate CVEs in the Gitpod monorepo. Use when asked to fix vulnerabilities, update dependencies for security, respond to CVE scan failures, or validate that dependency updates resolve known CVEs. Triggers on "fix CVE", "vulnerability scan", "security update", "dependency CVE", "grype scan", "leeway sbom", "CVE remediation", "update vulnerable dependency", "daily scan failure", "critical vulnerability".
Fix and validate CVE findings in the Gitpod monorepo. This repo has ~80 Go modules
under components/, dev/, install/, and test/, plus TypeScript/Node packages.
Install grype if missing, then scan individual modules or the whole repo:
# Install grype (one-time)
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
# Scan a single module (fastest — ~2s per module)
grype file:components/common-go/go.mod --only-fixed --output table
# Scan a single module directory (slower — ~40s, also picks up binaries/lockfiles)
grype dir:components/common-go --only-fixed --output table
# JSON output for programmatic use
grype file:components/common-go/go.mod --only-fixed --output json 2>/dev/null | \
jq '[.matches[] | {id: .vulnerability.id, severity: .vulnerability.severity, package: .artifact.name, installed: .artifact.version, fixedIn: .vulnerability.fix.versions}]'
# Scan all Go modules, show only Critical/High with fixes available
find components -name "go.mod" -not -path "*/vendor/*" \
-exec sh -c 'echo "=== {} ===" && grype file:"{}" --only-fixed -q 2>/dev/null' \;
Use --fail-on critical or --fail-on high to get a non-zero exit code.
CI uses leeway sbom export + leeway sbom scan against components:needs-vuln-scan.
Leeway embeds both syft (SBOM generation) and grype (vulnerability matching) internally.
The CI scan is slow (requires full build cache) and runs on every push to main and on PRs.
The daily scheduled run (build.yml, cron 0 0 * * *) checks vulnerability-stats.json
for critical counts and sends Slack alerts via notify-scheduled-failure.
Read references/ci-scanning.md for the full CI pipeline details.
A separate Trivy-based scan (scripts/trivy/trivy-scan-images.sh) scans built Docker
images. It uses scripts/trivy/trivyignore.yaml for suppressions. This is distinct from
the Go dependency scanning.
When a CVE is reported:
--only-fixed with grype. If no fix exists, document and defer.WORKSPACE.yaml under sbom.ignoreVulnerabilities
with a vulnerability ID and a reason explaining why.runc v1.1.x → v1.2.x) change
exported APIs. These require code migration, not just go get.For each affected module:
cd components/<module>
# Update a specific dependency
go get google.golang.org/[email protected]
# Update transitive dependencies that need bumping
go get golang.org/x/net@latest
# Clean up
go mod tidy
# Verify it builds
go build ./...
This repo has many Go modules that share dependencies via replace directives in go.mod.
When updating a dependency:
replace to point to local paths:
replace github.com/gitpod-io/gitpod/common-go => ../common-go // leeway
If common-go bumps a dependency, all modules that replace-reference it will
transitively pick up the new version.grep -rl "google.golang.org/grpc" components/*/go.mod | sort
dev/ and test/ modules. CI builds these too. They often lag behind.go mod tidy in every updated module. Missing this causes CI failures.Some modules (notably image-builder-bob) use replace directives to pin OpenTelemetry
versions. When upgrading grpc, the OTel SDK version requirements may change. Update the
replace directives to match:
replace (
go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.39.0
go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.39.0
// ... etc
)
When a package is deprecated and replaced (e.g., dgrijalva/jwt-go → golang-jwt/jwt/v5):
go.mod: remove old dependency, add new one..go files.go build ./... and go test ./... to confirm.Some upgrades cannot be done with a simple version bump. Document these in the PR
under "Not addressed (requires follow-up)" with the specific breaking change.
Example: opencontainers/runc v1.1.x → v1.2.x made libcontainer/cgroups/ebpf
functions unexported.
Two suppression mechanisms exist:
Add entries under sbom.ignoreVulnerabilities in WORKSPACE.yaml: