feat(vulnfeeds): add repository-level GHSA advisory converter - #6065
Draft
another-rex wants to merge 2 commits into
Draft
another-rex wants to merge 2 commits into
another-rex wants to merge 2 commits into
Conversation
…nverter - Support reading repository targets from GCS JSON/manifest files (gs://...). - Support directly uploading converted OSV records to GCS bucket. - Save execution timestamps to Datastore JobData entity (repository_ghsa_last_run). - Add Kubernetes CronJob manifests running every 6 hours (0 */6 * * *) for base, oss-vdb-test, and oss-vdb environments. - Add Dockerfile and Cloud Build step for building and staging the converter container. - Completely omit package and ecosystem fields for pure Git advisories. - Store original GHSA version bounds in range.database_specific.extracted_events.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the
repository-ghsavulnerability feed converter tool undervulnfeeds/cmd/converters/repository-ghsa/to fetch and convert repository-level GitHub Security Advisories (GHSAs) into the OSV Git repository advisory schema.Summary of Changes
vulnfeeds/cmd/converters/repository-ghsa):github.go: GitHub REST API client with Bearer token authentication, cursor pagination viaLinkheader, and exponential backoff retry on HTTP 429/5xx.convert.go: Converts GHSA advisories to OSV records. Produces pure Git records (omittingpackageandecosystem), resolves version ranges against Git tags via Gitter / Git tags cache into commit SHAs (Range_GIT), and records original GHSA version bounds indatabase_specific.extracted_events.main.go: CLI tool orchestrating repository ingestion across worker goroutines. Supports reading repository lists from local files or GCS (gs://..., JSON arrays/dicts/lists), writing output to local directories or GCS buckets, and recording execution timestamps in Datastore.jobdata.go: DatastoreJobDataentity tracking (repository_ghsa_last_run) for recording job execution timestamps.Dockerfile&run_repository_ghsa.sh: Multi-stage container build and entrypoint script for running the converter in containerized environments.deployment/build-and-stage.yaml: Cloud Build pipeline steps to build, tag, and pushgcr.io/oss-vdb/repository-ghsa-convert.deployment/clouddeploy/gke-workers/): Scheduled every 6 hours (0 */6 * * *) in base feeds with environment overlays foross-vdb-test(test bucket) andoss-vdb(prod bucket).github_test.go,convert_test.go,jobdata_test.go, andmain_test.gowith 100% pass rate and zero race conditions (-race).poetry run ./tools/lint_and_format.sh.agy