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

fix: output invalid PURLs when scanning sboms #1283

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cmd/osv-scanner/__snapshots__/main_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ Scanned <rootdir>/fixtures/locks-insecure/composer.lock file and found 1 package
[TestRun/folder_of_supported_sbom_with_vulns - 1]
Scanning dir ./fixtures/sbom-insecure/
Scanned <rootdir>/fixtures/sbom-insecure/alpine.cdx.xml as CycloneDX SBOM and found 14 packages
Scanned <rootdir>/fixtures/sbom-insecure/bad-purls.cdx.xml as CycloneDX SBOM and found 8 packages
Ignored 6 packages with invalid PURLs
Ignored invalid PURL "/"
Ignored invalid PURL "pkg:///"
Ignored invalid PURL "pkg:apk/alpine/@1.36.1-r27?arch=x86_64&upstream=busybox&distro=alpine-3.17.2"
Ignored invalid PURL "pkg:pypi/"
Scanned <rootdir>/fixtures/sbom-insecure/postgres-stretch.cdx.xml as CycloneDX SBOM and found 136 packages
+-------------------------------------+------+-----------+--------------------------------+------------------------------------+-------------------------------------------------+
| OSV URL | CVSS | ECOSYSTEM | PACKAGE | VERSION | SOURCE |
Expand Down Expand Up @@ -688,6 +694,21 @@ No issues found

---

[TestRun/one_specific_supported_sbom_with_invalid_PURLs - 1]
Scanned <rootdir>/fixtures/sbom-insecure/bad-purls.cdx.xml as CycloneDX SBOM and found 8 packages
Ignored 6 packages with invalid PURLs
Ignored invalid PURL "/"
Ignored invalid PURL "pkg:///"
Ignored invalid PURL "pkg:apk/alpine/@1.36.1-r27?arch=x86_64&upstream=busybox&distro=alpine-3.17.2"
Ignored invalid PURL "pkg:pypi/"
No issues found

---

[TestRun/one_specific_supported_sbom_with_invalid_PURLs - 2]

---

[TestRun/one_specific_supported_sbom_with_vulns - 1]
Scanned <rootdir>/fixtures/sbom-insecure/alpine.cdx.xml as CycloneDX SBOM and found 14 packages
+--------------------------------+------+-----------+---------+-----------+---------------------------------------+
Expand Down
Loading