diff --git a/internal/spdxlicense/license_list.go b/internal/spdxlicense/license_list.go index 442ceb89f..c46022ef2 100644 --- a/internal/spdxlicense/license_list.go +++ b/internal/spdxlicense/license_list.go @@ -1,9 +1,9 @@ // Code generated by go generate; DO NOT EDIT. -// This file was generated by robots at 2022-10-14 11:46:16.097525 -0400 EDT m=+0.276930979 +// This file was generated by robots at 2022-12-02 12:51:33.814385 -0500 EST m=+1.688731869 // using data from https://spdx.org/licenses/licenses.json package spdxlicense -const Version = "3.18" +const Version = "3.19" var licenseIDs = map[string]string{ "0bsd": "0BSD", @@ -372,6 +372,7 @@ var licenseIDs = map[string]string{ "cern-ohl-w-2": "CERN-OHL-W-2.0", "cern-ohl-w-2.0": "CERN-OHL-W-2.0", "cern-ohl-w-2.0.0": "CERN-OHL-W-2.0", + "checkmk": "checkmk", "clartistic": "ClArtistic", "cnri-jython": "CNRI-Jython", "cnri-python": "CNRI-Python", @@ -470,6 +471,7 @@ var licenseIDs = map[string]string{ "fsfap": "FSFAP", "fsful": "FSFUL", "fsfullr": "FSFULLR", + "fsfullrwd": "FSFULLRWD", "ftl": "FTL", "gd": "GD", "gfdl-1": "GFDL-1.1-only", @@ -617,6 +619,7 @@ var licenseIDs = map[string]string{ "jasper-2.0.0": "JasPer-2.0", "jpnic": "JPNIC", "json": "JSON", + "knuth-ctan": "Knuth-CTAN", "lal-1": "LAL-1.2", "lal-1.2": "LAL-1.2", "lal-1.2.0": "LAL-1.2", @@ -665,6 +668,7 @@ var licenseIDs = map[string]string{ "libselinux-1.0": "libselinux-1.0", "libselinux-1.0.0": "libselinux-1.0", "libtiff": "libtiff", + "libutil-david-nugent": "libutil-David-Nugent", "liliq-p-1": "LiLiQ-P-1.1", "liliq-p-1.1": "LiLiQ-P-1.1", "liliq-p-1.1.0": "LiLiQ-P-1.1", @@ -984,7 +988,7 @@ var licenseIDs = map[string]string{ "sspl-1": "SSPL-1.0", "sspl-1.0": "SSPL-1.0", "sspl-1.0.0": "SSPL-1.0", - "standardml-nj": "StandardML-NJ", + "standardml-nj": "SMLNJ", "sugarcrm-1": "SugarCRM-1.1.3", "sugarcrm-1.1": "SugarCRM-1.1.3", "sugarcrm-1.1.3": "SugarCRM-1.1.3", diff --git a/syft/pkg/cataloger/binary/classifier.go b/syft/pkg/cataloger/binary/classifier.go index 32d2dc1ae..eddbccda4 100644 --- a/syft/pkg/cataloger/binary/classifier.go +++ b/syft/pkg/cataloger/binary/classifier.go @@ -91,6 +91,12 @@ func fileNameTemplateVersionMatcher(fileNamePattern string, contentTemplate stri } } +func patternEndingWithNull(pattern string) string { + bytes := []byte(pattern) + bytes = append(bytes, 0) + return string(bytes) +} + func fileContentsVersionMatcher(pattern string) evidenceMatcher { pat := regexp.MustCompile(pattern) return func(classifier classifier, reader source.LocationReadCloser) ([]pkg.Package, error) { @@ -130,6 +136,7 @@ func singlePackage(classifier classifier, reader source.LocationReadCloser, vers Locations: source.NewLocationSet(reader.Location), Type: pkg.BinaryPkg, CPEs: cpes, + FoundBy: catalogerName, MetadataType: pkg.BinaryMetadataType, Metadata: pkg.BinaryMetadata{ Classifier: classifier.Class, diff --git a/syft/pkg/cataloger/binary/default_classifiers.go b/syft/pkg/cataloger/binary/default_classifiers.go index d0f601fe3..dbc7d9a07 100644 --- a/syft/pkg/cataloger/binary/default_classifiers.go +++ b/syft/pkg/cataloger/binary/default_classifiers.go @@ -29,9 +29,10 @@ var defaultClassifiers = []classifier{ { Class: "go-binary", FileGlob: "**/go", - EvidenceMatcher: fileContentsVersionMatcher( - `(?m)go(?P[0-9]+\.[0-9]+(\.[0-9]+|beta[0-9]+|alpha[0-9]+|rc[0-9]+)?)`), + EvidenceMatcher: fileContentsVersionMatcher(patternEndingWithNull( + `(?m)go(?P[0-9]+\.[0-9]+(\.[0-9]+|beta[0-9]+|alpha[0-9]+|rc[0-9]+)?)`)), Package: "go", + CPEs: singleCPE("cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*"), }, { Class: "nodejs-binary", diff --git a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go index 56c6f3c7a..f18b07b8a 100644 Binary files a/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go and b/syft/pkg/cataloger/binary/test-fixtures/classifiers/positive/go differ