Skip to content

feat: use VulnsStatus to skip NVD Rejected CVE - #542

Merged
knqyf263 merged 9 commits into
aquasecurity:mainfrom
gshanbhag525:gun-rejected-cve
Jun 30, 2025
Merged

feat: use VulnsStatus to skip NVD Rejected CVE#542
knqyf263 merged 9 commits into
aquasecurity:mainfrom
gshanbhag525:gun-rejected-cve

Conversation

@gshanbhag525

@gshanbhag525 gshanbhag525 commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

There are some CVE which will not have "** REJECT **" keyword, but they are rejected.

Hence used VulnStatus to skip such NVD CVEs.
eg.
CVE-2024-4109
CVE-2022-45046
CVE-2024-36610

@gshanbhag525
gshanbhag525 requested a review from knqyf263 as a code owner June 17, 2025 10:28
Comment thread pkg/vulnsrc/vulnerability/vulnerability.go Outdated
Comment thread pkg/vulnsrc/vulnerability/vulnerability.go Outdated
There are some CVE which will not have "** REJECT **" keyword, but they are rejected.

Hence added checks for such CVEs.
eg.
CVE-2024-4109
CVE-2022-45046
@gshanbhag525
gshanbhag525 requested a review from knqyf263 June 17, 2025 15:20
Comment thread pkg/vulnsrc/vulnerability/vulnerability.go Outdated
Comment thread pkg/vulnsrc/nvd/nvd.go Outdated
Comment thread pkg/vulnsrc/vulnerability/vulnerability.go Outdated
@knqyf263
knqyf263 requested review from DmitriyLewen and Copilot June 18, 2025 05:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the logic for skipping rejected CVEs by introducing a VulnStatus field and adding checks for additional rejection patterns in descriptions.

  • Add VulnStatus to core types and mappings from NVD payloads
  • Extend getRejectedStatus to skip CVEs based on status or new description markers
  • Update tests to populate and evaluate the new VulnStatus field

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/vulnsrc/vulnerability/vulnerability.go Add rejectedStatus, rejectedReason, rejectedDoNotUse constants and extend rejection logic
pkg/vulnsrc/vulnerability/vulnerability_test.go Populate VulnStatus in test cases for both modified and rejected CVEs
pkg/vulnsrc/nvd/types.go Add VulnStatus field to Cve struct
pkg/vulnsrc/nvd/nvd.go Map cve.VulnStatus into stored VulnerabilityDetail
pkg/vulnsrc/nvd/nvd_test.go Populate VulnStatus in NVD test fixtures
pkg/types/types.go Add VulnStatus to VulnerabilityDetail type
Comments suppressed due to low confidence (3)

pkg/vulnsrc/vulnerability/vulnerability_test.go:122

  • Add test cases where Description contains "DO NOT USE THIS CANDIDATE NUMBER" and where it starts with "Rejected reason:" to cover all new rejection branches.
					VulnStatus:  "Rejected",

pkg/vulnsrc/nvd/types.go:12

  • [nitpick] Add a comment above this field to explain what VulnStatus represents, which values are expected, and its source.
	VulnStatus   string       `json:"vulnStatus"`

pkg/vulnsrc/vulnerability/vulnerability.go:15

  • [nitpick] Consider renaming rejectVulnerability to something like rejectedKeyword or rejectionMarker to align clearly with the other rejected* constants.
	rejectVulnerability = "** REJECT **"

Comment thread pkg/vulnsrc/vulnerability/vulnerability.go Outdated
@gshanbhag525
gshanbhag525 requested a review from knqyf263 June 18, 2025 19:00

@knqyf263 knqyf263 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriyLewen Any comments?

Comment thread pkg/types/types.go Outdated
@gshanbhag525
gshanbhag525 requested a review from knqyf263 June 19, 2025 07:55
@gshanbhag525 gshanbhag525 changed the title bugfix: added new checks to skip NVD Rejected CVE feat: use VulnsStatus to skip NVD Rejected CVE Jun 23, 2025
Comment thread pkg/vulnsrc/vulnerability/vulnerability.go Outdated
Comment thread pkg/types/types.go Outdated

@DmitriyLewen DmitriyLewen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cc. @knqyf263

@knqyf263
knqyf263 added this pull request to the merge queue Jun 30, 2025
Merged via the queue into aquasecurity:main with commit 3a1cd4f Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants