Skip to content

Policy condition PURL IS_NOT will match a substring #5158

@jakub-bochenski

Description

@jakub-bochenski

Current Behavior

Define a policy with condition:

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

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 not triggered.

Expected Behavior

I don't think the behaviour is documented anywhere.
Yet I think it's reasonable to expect IS/IS_NOT operator requires equality, not being a substring.

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