anchore / grype

A vulnerability scanner for container images and filesystems
Apache License 2.0
8.86k stars 574 forks source link

Add v6 vulnerability & blob stores #2243

Closed wagoodman closed 1 week ago

wagoodman commented 2 weeks ago

Adds the VulnerabilityHandle, Blob, and BlobDigest models as well as the first blob, VulnerabilityBlob with supporting structs and store accessors (only in the Db v6 schema).

When adding a new vulnerability to the DB the store objects handle serializing the object to JSON and storing to the DB within the blobs table (and the same is true for fetching in reverse). When the store is open for writing the blob_digests table is created and populated with each write to the blobs table; since this takes up a good amount of space in the DB and isn't needed for distribution, upon closing the store this table is dropped entirely.

Partially addresses #2128 #2132