Skip to content

Commit

Permalink
fix: CPE generation for django (#2068)
Browse files Browse the repository at this point in the history
Signed-off-by: witchcraze <[email protected]>
  • Loading branch information
witchcraze authored Aug 28, 2023
1 parent dd09e03 commit cedfa05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 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 @@ -183,6 +183,11 @@ var defaultCandidateAdditions = buildCandidateLookup(
candidateKey{PkgName: "pip"},
candidateAddition{AdditionalVendors: []string{"pypa"}},
},
{
pkg.PythonPkg,
candidateKey{PkgName: "Django"},
candidateAddition{AdditionalVendors: []string{"djangoproject"}},
},
// Alpine packages
{
pkg.ApkPkg,
Expand Down
8 changes: 8 additions & 0 deletions syft/pkg/cataloger/common/cpe/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,14 @@ func TestCandidateVendor(t *testing.T) {
},
expected: []string{"apache"},
},
{
name: "Django",
p: pkg.Package{
Name: "Django",
Type: pkg.PythonPkg,
},
expected: []string{"djangoproject" /* <-- known good names | default guess --> */, "Django"},
},
}

for _, test := range tests {
Expand Down

0 comments on commit cedfa05

Please sign in to comment.