Skip to content

PURL NO_MATCH policy condition doesn't match by ?type #5142

@jakub-bochenski

Description

@jakub-bochenski

Current Behavior

Setup a policy with condition

{
	"subject": "PACKAGE_URL",
	"operator": "NO_MATCH",
	"value": "pkg:maven/com.mysql/[email protected]?type=jar"
}

Upload a BOM:

{
  "bomFormat": "CycloneDX",
  "specVersion": "1.5",
  "version": 1,
  "components": [
     {
        "type" : "library",
        "group" : "com.mysql",
        "name" : "mysql-connector-j",
        "version" : "8.0.33",
        "purl" : "pkg:maven/com.mysql/[email protected]?type=jar"
      }
  ]
}

Observe that the policy is triggered.

If you define a policy with condition (notice no ?type)

{
	"subject": "PACKAGE_URL",
	"operator": "NO_MATCH",
	"value": "pkg:maven/com.mysql/[email protected]"
}

Then the policy will not trigger for the above BOM

Expected Behavior

PURL policy condition should match a component with exactly the same PURL

Dependency-Track Version

4.13.2

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

No response

Browser

N/A

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions