Skip to content

feat(go): OSV dependency scanning for go.mod - #244

Merged
jaurakunal merged 1 commit into
mainfrom
feat/go-osv-dependency-scan
Sep 14, 2026
Merged

jaurakunal merged 1 commit into
mainfrom
feat/go-osv-dependency-scan

Conversation

@jaurakunal

Copy link
Copy Markdown
Owner

What

Adds go.mod dependency (SCA) scanning — the last Go gap. The OSV.dev core already covers the Go ecosystem; this adds the missing extractor and indexes the file.

  • _extract_go parses direct and indirect requires (block and single-line), strips the leading v to OSV's semver (preserving +incompatible and pseudo-versions), and skips module/go/toolchain/replace/exclude/retract.
  • go.mod added to KEY_FILE_NAMES so ingestion indexes it — without this the OSV scanner (which reads repo.file_index) never saw it and returned clean on a vulnerable project.

Verified live (real isitsecure scan)

  • github.com/dgrijalva/jwt-go v3.2.0+incompatible → 2 OSV vulnerabilities, grade dropped to C+.
  • Extractor test hits the OSV API and returns findings for jwt-go, golang.org/x/crypto, and gin.
  • Full suite: 2612 passed, 1 xfailed.

Go is now fully first-class: injection SAST + route mapping + gopls-refined per-route auth + go.mod SCA. README marks Go Dependency Scan: Yes (go.mod).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EZ4QoTqRoYWE25CNoV2Wfy

The OSV.dev core already covers the Go ecosystem; this adds the missing
go.mod extractor and indexes the file so it reaches the scanner.

- _extract_go parses direct and indirect `require`s (block and single-line
  forms), strips the leading `v` to OSV's semver (preserving +incompatible and
  pseudo-versions), and skips module/go/toolchain/replace/exclude/retract.
- go.mod added to KEY_FILE_NAMES so ingestion indexes it — without this the
  OSV scanner (which reads repo.file_index) never saw it and returned clean on
  a vulnerable project. (Found by live testing, not unit tests.)

Verified live end-to-end (real `isitsecure` scan of a go.mod project):
- github.com/dgrijalva/jwt-go v3.2.0+incompatible -> 2 OSV vulnerabilities,
  grade dropped to C+.
- Extractor unit test hit the OSV API and returned findings for jwt-go,
  golang.org/x/crypto, and gin.
- Full suite: 2612 passed, 1 xfailed.

Go is now a fully first-class language: injection SAST + route mapping +
gopls-refined per-route auth + go.mod dependency (SCA) scanning. README marks
Go Dependency Scan as Yes (go.mod).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ4QoTqRoYWE25CNoV2Wfy
@jaurakunal
jaurakunal merged commit d95e32d into main Sep 14, 2026
8 checks passed
@jaurakunal
jaurakunal deleted the feat/go-osv-dependency-scan branch September 14, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant