-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(report): add fingerprint generation for vulnerabilities #9794
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
Merged
knqyf263
merged 6 commits into
aquasecurity:main
from
knqyf263:feat/vulnerability-fingerprint
Nov 17, 2025
Merged
feat(report): add fingerprint generation for vulnerabilities #9794
knqyf263
merged 6 commits into
aquasecurity:main
from
knqyf263:feat/vulnerability-fingerprint
Nov 17, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change adds unique fingerprint generation for detected vulnerabilities to enable external systems to track and deduplicate vulnerabilities across multiple scans. Key changes: - Add Fingerprint field to DetectedVulnerability type - Create pkg/fingerprint package with Fill() function - Fingerprint is SHA256 hash of: artifactID:target:pkgID:vulnerabilityID - Add CalcSHA256() function to pkg/digest for byte array hashing - Rename CalcSHA256 to CalcSHA256FromReader for clarity - Include comprehensive unit tests for fingerprint generation - Update integration test golden files with fingerprint values The fingerprint is deterministic, ensuring the same inputs always produce the same hash. This enables reliable tracking of vulnerabilities across scans even when other metadata may change. Future work will extend fingerprint generation to misconfigurations, secrets, and licenses using the same pattern. Closes aquasecurity#9793
This commit adds the "sha256:" prefix to fingerprint values for consistency with Docker/OCI digest standards. The fingerprint format is now "sha256:<64-char-hex>" instead of just the hex string. Changes: - Updated pkg/fingerprint to use digest.String() instead of Encoded() - Updated pkg/digest/digest.go to use hex.EncodeToString for better performance - Added nolint directives for placeholder functions - Updated all integration test golden files with new fingerprint format
📊 API Changes DetectedSemver impact: |
Update the fingerprint length validation from 64 to 71 characters to account for the 'sha256:' prefix (7 characters) added to fingerprints.
Update spring4shell-jre8 and spring4shell-jre11 golden files to include the Fingerprint field with sha256 prefix for vulnerability CVE-2022-22965.
Add overrideFingerprint to TestSBOMEquivalence and TestTarWithOverride to clear fingerprints before comparison, as fingerprints vary between tests.
Signed-off-by: knqyf263 <[email protected]>
DmitriyLewen
approved these changes
Nov 13, 2025
Contributor
DmitriyLewen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
apidiff
Indicates Go API changes relevant to library consumers (CLI compatibility may be unaffected)
kind/feature
Categorizes issue or PR as related to a new feature.
scan/vulnerability
Issues relating to vulnerability scanning
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements fingerprint generation for detected vulnerabilities to enable external systems to uniquely identify and track vulnerabilities across multiple scans.
Each vulnerability is assigned a deterministic SHA256-based fingerprint composed of:
The fingerprint format uses the "sha256:" prefix for consistency with Docker/OCI digest standards.
Related issues
Before and After
Before (without fingerprint)
{ "VulnerabilityID": "CVE-2023-42366", "PkgID": "[email protected]", "PkgName": "busybox", "InstalledVersion": "1.35.0-r17", "FixedVersion": "1.35.0-r18", "Status": "fixed", "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2023-42366", "Title": "busybox: A heap-buffer-overflow", "Severity": "MEDIUM" }After (with fingerprint)
{ "VulnerabilityID": "CVE-2023-42366", "PkgID": "[email protected]", "PkgName": "busybox", "InstalledVersion": "1.35.0-r17", "FixedVersion": "1.35.0-r18", "Status": "fixed", "Fingerprint": "sha256:c2f054e07c516fabf395ddc7b362fbe43597bc2e1d80ac46d6043a0e67968efb", "PrimaryURL": "https://avd.aquasec.com/nvd/cve-2023-42366", "Title": "busybox: A heap-buffer-overflow", "Severity": "MEDIUM" }Checklist