-
Notifications
You must be signed in to change notification settings - Fork 363
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
Performance issues from scanSBOMFile reading every file multiple times #257
Labels
bug
Something isn't working
Comments
another-rex
added a commit
that referenced
this issue
Mar 2, 2023
Make sure the file name follows the recognized file names here: https://cyclonedx.org/specification/overview/#recognized-file-patterns Resolves #257 Also - adds tests for sboms, - makes SBOM scan logging output consistent with lockfile scan logging output - Minor refactor of SBOMs I believe we will also want something similar to parse-as in lockfiles for SBOMs as well in the future to allow file names that doesn't conform to the standard to be scanned.
hayleycd
pushed a commit
that referenced
this issue
Mar 9, 2023
Make sure the file name follows the recognized file names here: https://cyclonedx.org/specification/overview/#recognized-file-patterns Resolves #257 Also - adds tests for sboms, - makes SBOM scan logging output consistent with lockfile scan logging output - Minor refactor of SBOMs I believe we will also want something similar to parse-as in lockfiles for SBOMs as well in the future to allow file names that doesn't conform to the standard to be scanned.
julieqiu
pushed a commit
to julieqiu/osv-scanner
that referenced
this issue
May 2, 2023
Make sure the file name follows the recognized file names here: https://cyclonedx.org/specification/overview/#recognized-file-patterns Resolves google#257 Also - adds tests for sboms, - makes SBOM scan logging output consistent with lockfile scan logging output - Minor refactor of SBOMs I believe we will also want something similar to parse-as in lockfiles for SBOMs as well in the future to allow file names that doesn't conform to the standard to be scanned.
julieqiu
pushed a commit
to julieqiu/osv-scanner
that referenced
this issue
May 2, 2023
Make sure the file name follows the recognized file names here: https://cyclonedx.org/specification/overview/#recognized-file-patterns Resolves google#257 Also - adds tests for sboms, - makes SBOM scan logging output consistent with lockfile scan logging output - Minor refactor of SBOMs I believe we will also want something similar to parse-as in lockfiles for SBOMs as well in the future to allow file names that doesn't conform to the standard to be scanned.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scorecard utilizes
osvscanner.DoScan
when performing itsVulnerabilities
check. The time to complete the check is more than an order of magnitude higher than other checks. Runningpprof
shows a hot spot inscanSBOMFile
.It looks like when walking a directory, every file is potentially parsed as an SBOM:
osv-scanner/pkg/osvscanner/osvscanner.go
Lines 114 to 117 in 6eab450
There are currently two providers, SPDX and CycloneDX. While SPDX checks for a filename, there's no such check for CycloneDX:
osv-scanner/pkg/osvscanner/osvscanner.go
Lines 231 to 238 in 6eab450
I believe this means attempting to parse every file as a CycloneDX SBOM, twice. In large repositories, this adds up ( longest observed is 5 minutes) :
osv-scanner/internal/sbom/cyclonedx.go
Lines 50 to 59 in 6eab450
The text was updated successfully, but these errors were encountered: