Skip to content
Merged
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
6 changes: 6 additions & 0 deletions syft/pkg/cataloger/common/cpe/candidate_by_package_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ var defaultCandidateAdditions = buildCandidateLookup(
candidateKey{PkgName: "spring-core"},
candidateAddition{AdditionalProducts: []string{"spring_framework", "springsource_spring_framework"}, AdditionalVendors: []string{"pivotal_software", "springsource", "vmware"}},
},
{
// example image: docker.io/jenkins/jenkins:latest
pkg.JavaPkg,
candidateKey{PkgName: "spring-security-core"},
candidateAddition{AdditionalProducts: []string{"spring_security"}, AdditionalVendors: []string{"vmware"}},
},
{
// example image: docker.io/nuxeo:latest
pkg.JavaPkg,
Expand Down
16 changes: 16 additions & 0 deletions syft/pkg/cataloger/common/cpe/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,14 @@ func TestCandidateProducts(t *testing.T) {
},
expected: []string{"spring_framework", "springsource_spring_framework" /* <-- known good names | default guess --> */, "springframework"},
},
{
name: "spring-security-core",
p: pkg.Package{
Name: "spring-security-core",
Type: pkg.JavaPkg,
},
expected: []string{"spring-security-core", "spring_security", "spring_security_core"},
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw in the above additional vendors is also using vmware.

Do we want to add a case here under TestCandidateVendor to cover spring-security-core as well?

{
name: "java",
p: pkg.Package{
Expand Down Expand Up @@ -857,6 +865,14 @@ func TestCandidateVendor(t *testing.T) {
},
expected: []string{"elastic" /* <-- known good names | default guess --> */, "elasticsearch"},
},
{
name: "spring-security",
p: pkg.Package{
Name: "spring-security-core",
Type: pkg.JavaPkg,
},
expected: []string{"vmware" /* <-- known good names | default guess --> */, "spring", "spring-security", "spring-security-core", "spring_security_core", "spring_security"},
},
{
name: "log4j",
p: pkg.Package{
Expand Down