Support vulnerability matching for Rocky Linux (#500)

- Update grype-db dependency for the distro-feed namespace mapping
- Add test to verify the above mapping

Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
This commit is contained in:
Swathi Gangisetty 2021-11-15 16:14:24 -08:00 committed by GitHub
parent a2762bbbf0
commit 5aa2b7bcac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

2
go.mod
View file

@ -7,7 +7,7 @@ require (
github.com/adrg/xdg v0.2.1
github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04
github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4
github.com/anchore/grype-db v0.0.0-20210928194208-f146397d6cd0
github.com/anchore/grype-db v0.0.0-20211004133852-e0170394d953
github.com/anchore/stereoscope v0.0.0-20211024152658-003132a67c10
github.com/anchore/syft v0.30.1
github.com/bmatcuk/doublestar/v2 v2.0.4

4
go.sum
View file

@ -128,8 +128,8 @@ github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4 h1:rmZG77uXgE
github.com/anchore/go-version v1.2.2-0.20210903204242-51efa5b487c4/go.mod h1:Bkc+JYWjMCF8OyZ340IMSIi2Ebf3uwByOk6ho4wne1E=
github.com/anchore/grype v0.14.1-0.20210702143224-05ade7bbbf70/go.mod h1:yPh9WHflzInB/INwPrDs2wLKmRsa8owAuojmv4K8H6I=
github.com/anchore/grype-db v0.0.0-20210527140125-6f881b00e927/go.mod h1:XSlPf1awNrMpah+rHbWrzgUvnmWLgn/KkdicxERVClg=
github.com/anchore/grype-db v0.0.0-20210928194208-f146397d6cd0 h1:Ci/9i16zOJF+vpuOuOJB/B/A1lY/2IlN+H/e7Ha7UFQ=
github.com/anchore/grype-db v0.0.0-20210928194208-f146397d6cd0/go.mod h1:GniMuMokZ2iAX67Qrd5fJW7BstX8a+4U48LyypGC2g0=
github.com/anchore/grype-db v0.0.0-20211004133852-e0170394d953 h1:+oxiCcI0xwNdFZxDFwP4/dzWSmew3SlZZT318lc3ukE=
github.com/anchore/grype-db v0.0.0-20211004133852-e0170394d953/go.mod h1:GniMuMokZ2iAX67Qrd5fJW7BstX8a+4U48LyypGC2g0=
github.com/anchore/packageurl-go v0.0.0-20210922164639-b3fa992ebd29 h1:K9LfnxwhqvihqU0+MF325FNy7fsKV9EGaUxdfR4gnWk=
github.com/anchore/packageurl-go v0.0.0-20210922164639-b3fa992ebd29/go.mod h1:Oc1UkGaJwY6ND6vtAqPSlYrptKRJngHwkwB6W7l1uP0=
github.com/anchore/stereoscope v0.0.0-20210524175238-3b7662f3a66f/go.mod h1:vhh1M99rfWx5ejMvz1lkQiFZUrC5wu32V12R4JXH+ZI=

View file

@ -86,7 +86,7 @@ func (pr *mockProvider) stubWithEpoch(packageName, indrectName string) {
func (pr *mockProvider) GetByDistro(d *distro.Distro, p pkg.Package) ([]vulnerability.Vulnerability, error) {
var ty = strings.ToLower(d.Type.String())
if d.Type == distro.CentOS || d.Type == distro.RedHat {
if d.Type == distro.CentOS || d.Type == distro.RedHat || d.Type == distro.RockyLinux {
ty = "rhel"
}