Skip to content

Commit

Permalink
rhel: deprecate updater in favor of VEX updater
Browse files Browse the repository at this point in the history
We can extract vulnerability information about containers from the
VEX data. This negates the need to look for it in the cvemap.xml file.
This change modifies the VEX updater to allow for ingesting
vulnerabilities in a way that can be matched my the RHCC matcher.

Signed-off-by: crozzy <[email protected]>
  • Loading branch information
crozzy committed Sep 23, 2024
1 parent 7088f7b commit 286c7c3
Show file tree
Hide file tree
Showing 20 changed files with 3,845 additions and 920 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- The rhel-vex updater will now be responsible for RHCC advisories so we have
-- to delete the existing RHCC vulnerabilities.
DELETE FROM update_operation WHERE updater = 'rhel-container-updater';
DELETE FROM vuln where updater = 'rhel-container-updater';
4 changes: 4 additions & 0 deletions datastore/postgres/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,8 @@ var MatcherMigrations = []migrate.Migration{
ID: 13,
Up: runFile("matcher/13-delete-rhel-oval.sql"),
},
{
ID: 14,
Up: runFile("matcher/14-delete-rhcc-vulns.sql"),
},
}
4 changes: 2 additions & 2 deletions rhel/rhcc/coalescer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestCoalescer(t *testing.T) {
// Mark them as if they came from this package's package scanner
p.RepositoryHint = `rhcc`
}
repo := []*claircore.Repository{&goldRepo}
repo := []*claircore.Repository{&GoldRepo}
layerArtifacts := []*indexer.LayerArtifacts{
{
Hash: test.RandomSHA256Digest(t),
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestCoalescer(t *testing.T) {
}
for _, id := range e.RepositoryIDs {
r := ir.Repositories[id]
if got, want := r.Name, goldRepo.Name; got != want {
if got, want := r.Name, GoldRepo.Name; got != want {
t.Errorf("got: %q, want: %q", got, want)
}
}
Expand Down
51 changes: 0 additions & 51 deletions rhel/rhcc/fetcher_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion rhel/rhcc/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (*matcher) Name() string { return "rhel-container-matcher" }
// Filter implements [driver.Matcher].
func (*matcher) Filter(r *claircore.IndexRecord) bool {
return r.Repository != nil &&
r.Repository.Name == goldRepo.Name
r.Repository.Name == GoldRepo.Name

Check warning on line 29 in rhel/rhcc/matcher.go

View check run for this annotation

Codecov / codecov/patch

rhel/rhcc/matcher.go#L29

Added line #L29 was not covered by tests
}

// Query implements [driver.Matcher].
Expand Down
274 changes: 0 additions & 274 deletions rhel/rhcc/parser_test.go

This file was deleted.

Loading

0 comments on commit 286c7c3

Please sign in to comment.