Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all package types (including alpine) to the glad extractor #212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/vulnsrc/bucket/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const separator = "::"
func Name(ecosystem, dataSource string) string {
var prefix types.Ecosystem
switch strings.ToLower(ecosystem) {
case "alpine", "apk":
prefix = vulnerability.Apk
case "go", "golang":
prefix = vulnerability.Go
case "maven", "gradle":
Expand Down
25 changes: 13 additions & 12 deletions pkg/vulnsrc/glad/glad.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ import (
)

const (
// GitLab Advisory Database
gladDir = "glad"

Conan packageType = "Conan"
Gem packageType = "Gem"
Go packageType = "Go"
Maven packageType = "Maven"
Npm packageType = "Npm"
Nuget packageType = "Nuget"
Packagist packageType = "Packagist"
PyPI packageType = "PyPI"
// GitLab Advisory Database
gladDir = "glad"

Alpine packageType = "Alpine"
Conan packageType = "Conan"
Gem packageType = "Gem"
Go packageType = "Go"
Maven packageType = "Maven"
Npm packageType = "Npm"
Nuget packageType = "Nuget"
Packagist packageType = "Packagist"
PyPI packageType = "PyPI"
)

var (
// TODO: support Conan, Npm, NuGet, PyPI and Packagist
supportedPkgTypes = []packageType{Go, Maven}
supportedPkgTypes = []packageType{Alpine, Conan, Gem, Go, Maven, Npm, Nuget, Packagist, PyPI}
supportedIDPrefixes = []string{"CVE", "GMS"}

source = types.DataSource{
Expand Down
1 change: 1 addition & 0 deletions pkg/vulnsrc/vulnerability/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
OSV types.SourceID = "osv"

// Ecosystem
Apk types.Ecosystem = "apk"
Npm types.Ecosystem = "npm"
Composer types.Ecosystem = "composer"
Pip types.Ecosystem = "pip"
Expand Down