Skip to content

feat(vulnsrc): add RapidFort Security Advisories source#654

Open
vaibhav-rf wants to merge 6 commits intoaquasecurity:mainfrom
vaibhav-rf:feat/add-rapidfort-vulnsrc
Open

feat(vulnsrc): add RapidFort Security Advisories source#654
vaibhav-rf wants to merge 6 commits intoaquasecurity:mainfrom
vaibhav-rf:feat/add-rapidfort-vulnsrc

Conversation

@vaibhav-rf
Copy link
Copy Markdown

Summary

Adds rapidfort as a new vulnerability source in trivy-db, ingesting
advisory data published by RapidFort in
rapidfort/security-advisories.

What's added

pkg/ecosystem/ecosystem.go

  • New RapidFort Type = "rapidfort" ecosystem constant.

pkg/vulnsrc/bucket/bucket.go

  • New rapidFortBucket type implementing the Bucket interface with a
    Name() of the form "rapidfort {os} {version}" (e.g.
    "rapidfort ubuntu 22.04").
  • NewRapidFort(baseOS, version) constructor used by both the builder
    and the getter to guarantee consistent platform key derivation.

pkg/vulnsrc/rapidfort/

  • types.goPackageAdvisory, CVEEntry, Event, and
    RapidFortCustom types matching the JSON format written by
    vuln-list-update.
  • rapidfort.goVulnSrc (DB builder) and VulnSrcGetter
    (scanner query path):
    • Walks vuln-list/rapidfort/{os}/{version}/{pkg}.json using
      utils.FileWalk (consistent with other vulnsrc implementations).
    • Derives baseOS from the directory path — authoritative, no
      dependence on JSON field names.
    • Stores DataSource.BaseID = baseOS so the scanner can resolve the
      correct upstream source per OS.
    • Encodes Red Hat per-event identifiers (e.g. el9, fc39) in
      Advisory.Custom via RapidFortCustom; Ubuntu/Alpine advisories
      leave Custom nil.
  • rapidfort_test.goTestVulnSrc_Update and TestVulnSrc_Get
    covering Ubuntu, Debian, and Red Hat happy paths; empty dir; invalid
    JSON; and missing-advisory cases.

pkg/vulnsrc/vulnsrc.go

  • rapidfort.NewVulnSrc() registered in the global source list.

Supported OSes (initial)

  • Ubuntu
  • Debian
  • Red Hat

Testing

go test ./pkg/vulnsrc/rapidfort/...
go build ./...

vaibhav-rf and others added 6 commits February 25, 2026 12:07
Adds a new vulnerability source that ingests RapidFort's curated OS
advisories from vuln-list/rapidfort/{os}/{codename}/{package}.json into
trivy.db. Supports Ubuntu and Debian with automatic codename-to-version
mapping (e.g. focal→20.04, bookworm→12). OSV-style version events are
converted to PatchedVersions/VulnerableVersions ranges for trivy's
version checker.
Remove the codename→version mapping tables entirely. vuln-list-update
now writes version numbers (e.g. 20.04, 12) directly as the directory
name and distro_version JSON field, so trivy-db can use the value
as-is when naming platform buckets.
…raints

Signed-off-by: Vaibhav Thatai <vaibhav@rapidfort.com>
Add identifier tracking to CVEEntry events (e.g. el9, fc39) for
    Red Hat advisories. Store identifiers in Advisory.Custom parallel
    to VulnerableVersions for distro-specific version matching. Includes
    Red Hat test fixtures and test cases for both Update and Get paths.
- Register RapidFort as a first-class ecosystem.Type in ecosystem.go
- Add rapidFortBucket with Name/Ecosystem/BaseOS methods in bucket.go,
  replacing the ad-hoc fmt.Sprintf platform name construction
- Refactor rapidfort.go to use utils.FileWalk (consistent with other
  vulnsrc implementations), carry baseOS through the entry struct, and
  split Update into parse/put helpers
- Fix import ordering in vulnsrc.go; normalise map[string]any in tests
@vaibhav-rf vaibhav-rf marked this pull request as ready for review March 27, 2026 10:56
@vaibhav-rf vaibhav-rf requested a review from knqyf263 as a code owner March 27, 2026 10:56
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.

2 participants