Skip to content

Commit

Permalink
fix: add relevant CPEs to python and busybox classifiers (#1517)
Browse files Browse the repository at this point in the history
Signed-off-by: Weston Steimel <[email protected]>
  • Loading branch information
westonsteimel authored Jan 25, 2023
1 parent 02fb757 commit 4c0aef0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion syft/pkg/cataloger/binary/default_classifiers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package binary

import "github.com/anchore/syft/syft/pkg"
import (
"github.com/anchore/syft/syft/cpe"
"github.com/anchore/syft/syft/pkg"
)

var defaultClassifiers = []classifier{
{
Expand All @@ -11,6 +14,10 @@ var defaultClassifiers = []classifier{
`(?m)(?P<version>{{ .version }}\.[0-9]+[-_a-zA-Z0-9]*)`),
Package: "python",
PURL: mustPURL("pkg:generic/python@version"),
CPEs: []cpe.CPE{
cpe.Must("cpe:2.3:a:python_software_foundation:python:*:*:*:*:*:*:*:*"),
cpe.Must("cpe:2.3:a:python:python:*:*:*:*:*:*:*:*"),
},
},
{
Class: "python-binary-lib",
Expand All @@ -20,6 +27,10 @@ var defaultClassifiers = []classifier{
`(?m)(?P<version>{{ .version }}\.[0-9]+[-_a-zA-Z0-9]*)`),
Package: "python",
PURL: mustPURL("pkg:generic/python@version"),
CPEs: []cpe.CPE{
cpe.Must("cpe:2.3:a:python_software_foundation:python:*:*:*:*:*:*:*:*"),
cpe.Must("cpe:2.3:a:python:python:*:*:*:*:*:*:*:*"),
},
},
{
Class: "cpython-source",
Expand All @@ -28,6 +39,10 @@ var defaultClassifiers = []classifier{
`(?m)#define\s+PY_VERSION\s+"?(?P<version>[0-9\.\-_a-zA-Z]+)"?`),
Package: "python",
PURL: mustPURL("pkg:generic/python@version"),
CPEs: []cpe.CPE{
cpe.Must("cpe:2.3:a:python_software_foundation:python:*:*:*:*:*:*:*:*"),
cpe.Must("cpe:2.3:a:python:python:*:*:*:*:*:*:*:*"),
},
},
{
Class: "go-binary",
Expand Down Expand Up @@ -103,6 +118,7 @@ var defaultClassifiers = []classifier{
EvidenceMatcher: fileContentsVersionMatcher(
`(?m)BusyBox\s+v(?P<version>[0-9]+\.[0-9]+\.[0-9]+)`),
Package: "busybox",
CPEs: singleCPE("cpe:2.3:a:busybox:busybox:*:*:*:*:*:*:*:*"),
},
{
Class: "php-cli-binary",
Expand Down

0 comments on commit 4c0aef0

Please sign in to comment.