Skip to content

Commit

Permalink
Removes aliasing for namespaces that affected maven (#349)
Browse files Browse the repository at this point in the history
* Removes aliasing for namespaces that affected maven

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>

---------

Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu authored Sep 22, 2024
1 parent 7efd5ac commit 1d55dab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions depscan/lib/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ def create_pkg_variations(pkg_dict):
vendor_aliases.add(vendor)
vendor_aliases.add(vendor.lower())
vendor_aliases.add(vendor.lstrip("@"))
if (
vendor.startswith("org.")
or vendor.startswith("io.")
or vendor.startswith("com.")
or vendor.startswith("net.")
):
tmpA = vendor.split(".")
# Automatically add short vendor forms
# Increase to 6 to reduce false positives when the package name is core
if len(tmpA) > 1 and len(tmpA[1]) > 6:
if tmpA[1] != name:
vendor_aliases.add(tmpA[1])
# Add some common vendor aliases
if purl.startswith("pkg:golang") and not name.startswith("go"):
vendor_aliases.add("go")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "owasp-depscan"
version = "5.4.5"
version = "5.4.6"
description = "Fully open-source security audit for project dependencies based on known vulnerabilities and advisories."
authors = [
{name = "Team AppThreat", email = "cloud@appthreat.com"},
Expand Down
2 changes: 1 addition & 1 deletion test/test_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_pkg_variations():
pkg_list = create_pkg_variations(
{"vendor": "org.eclipse.foo", "name": "bar", "version": "1.0.0"}
)
assert len(pkg_list) > 1
assert len(pkg_list) == 1
pkg_list = create_pkg_variations(
{
"vendor": "com.fasterxml.jackson.core",
Expand Down

0 comments on commit 1d55dab

Please sign in to comment.