Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FP]: use a negative rule for cpe:2.3:a:grpc:grpc:*:*:*:*:*:*:*:* suppression matching for Maven artifacts #7250

Closed
FyiurAmron opened this issue Dec 13, 2024 · 9 comments

Comments

@FyiurAmron
Copy link

FyiurAmron commented Dec 13, 2024

Package URl

pkg:maven/(?!io.grpc/).*

CPE

cpe:2.3:a:grpc:grpc::::::::

CVE

multiple

ODC Integration

{"label"=>"Gradle Plugin"}

ODC Version

11.1.1

Description

I propose using a negative regex in a suppression rule for gRPC. We already had numerous FPs for this one, because having grpc in a package name is relatively common in the wild. OTOH, the CPEs using grpc in the co-ord are limited to io.grpc group in Maven ecosystem. The benefit of switching would be twofold:

  1. no need to manually add suppressions for those cases in the future,
  2. possibility of removing existing redundant suppression rules for it

Example rule:

    <suppress base="true">
        <notes><![CDATA[
        Match only actual `io.grpc` Maven packages to this CPE
        ]]></notes>
        <packageUrl regex="true">^pkg:maven\/(?!io.grpc\/).*$</packageUrl>
        <cpe>cpe:/a:grpc:grpc</cpe>
    </suppress>

We do have a precedent of having this kind of rules in the base suppression file, so I think changing this would be reasonable.

Copy link
Contributor

Error parsing package url: pkg:maven/(?!io.grpc/).*.

Error: Error: Invalid purl: maven requires a "namespace" component

Please correct the package URL - consider copying the package url from the HTML report.

Copy link
Contributor

Failed to automatically evaluate the false positive. See: https://github.com/jeremylong/DependencyCheck/actions/runs/12322881944

Copy link
Contributor

Error parsing package url: pkg:maven/(?!io.grpc/).*.

Error: Error: Invalid purl: maven requires a "namespace" component

Please correct the package URL - consider copying the package url from the HTML report.

Copy link
Contributor

Failed to automatically evaluate the false positive. See: https://github.com/jeremylong/DependencyCheck/actions/runs/12322890605

Copy link
Contributor

Error parsing package url: pkg:maven/(?!io.grpc/).*.

Error: Error: Invalid purl: maven requires a "namespace" component

Please correct the package URL - consider copying the package url from the HTML report.

Copy link
Contributor

Failed to automatically evaluate the false positive. See: https://github.com/jeremylong/DependencyCheck/actions/runs/12322911311

@FyiurAmron
Copy link
Author

I'm more than willing to do the PR here etc. if that's of any use.

aikebah added a commit that referenced this issue Dec 18, 2024
@aikebah
Copy link
Collaborator

aikebah commented Dec 18, 2024

@FyiurAmron Thanks for the suggestion.

Negative rule suppression has been prepared in the source for the hostedSuppressions, keeping ticket open until a workflow has run that publishes it.

@aikebah
Copy link
Collaborator

aikebah commented Dec 18, 2024

Suppression now also published in the hostedSuppressions

@aikebah aikebah closed this as completed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants