From c73ed7f32f88d782d6bd947daf7d5eae7d41afd8 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Fri, 24 Sep 2021 16:23:23 +0900 Subject: [PATCH] chore: update find-lock file type (#1309) --- models/library.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/models/library.go b/models/library.go index 69268034..cfda36aa 100644 --- a/models/library.go +++ b/models/library.go @@ -10,7 +10,6 @@ import ( "github.com/aquasecurity/trivy/pkg/types" "golang.org/x/xerrors" - // "github.com/aquasecurity/go-dep-parser/pkg/types" ) // LibraryScanners is an array of LibraryScanner @@ -121,19 +120,24 @@ func getCveContents(cveID string, vul trivyDBTypes.Vulnerability) (contents map[ // LibraryMap is filename and library type var LibraryMap = map[string]string{ - "package-lock.json": "node", - "yarn.lock": "node", - "Gemfile.lock": "ruby", - "Cargo.lock": "rust", - "composer.lock": "php", - "Pipfile.lock": "python", - "poetry.lock": "python", - "go.sum": "gomod", + "package-lock.json": "node", + "yarn.lock": "node", + "Gemfile.lock": "ruby", + "Cargo.lock": "rust", + "composer.lock": "php", + "Pipfile.lock": "python", + "poetry.lock": "python", + "packages.lock.json": ".net", + "go.sum": "gomod", } // GetLibraryKey returns target library key func (s LibraryScanner) GetLibraryKey() string { fileName := filepath.Base(s.Path) + switch s.Type { + case "jar", "war", "ear": + return "java" + } return LibraryMap[fileName] }