You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Policy to detect components with neither PURL nor CPE defined #2587
I want to define a policy to detect components that neither have a PURL nor a CPE defined. I have tried the following, as I couldn't find a condition for "not defined":
My policy does not mark any components with No Identifier.
Looking at the code, it becomes apparent why my policy would not work:
The CpePolicyEvaluator does not evaluate empty (null) CPEs, just like the PackageURLPolicyEvaluator.
Proposed Behavior
It should be possible to check for empty PURL and/or CPE. I want to do this to remind me and my team to always add an identifier for vulnerability scanning.
I see two possible solutions:
Add a condition to CPE and PURL (and possibly the others, too) to check for is empty.
Remove the early return in the Evaluator classes, since the Matcher catches null anyways.
Activity
github-actions commentedon Apr 15, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.