Closed driseley closed 1 month ago
Hi @driseley - thanks for the issue report and for providing an easily reproducible example.
I tried reproducing here on my system, running this twice, to ensure it was all downloaded before starting.
for f in grype-0810 grype-0820 grype-0821; do time ./$f jenkins/jenkins:latest -o json=$f.json; done
✔ Vulnerability DB [no update available]
✔ Parsed image sha256:f78b5b90f20c751402aee62cca2342ed20abb9af0d06e45cdc666918ad9f9a00
✔ Cataloged contents 62fe8db1f064ce5bfd13cf87d2dcc9083d129b083a43009dde3551393ca9f4fa
├── ✔ Packages [497 packages]
├── ✔ File digests [8,512 files]
├── ✔ File metadata [8,512 locations]
└── ✔ Executables [931 executables]
✔ Scanned for vulnerabilities [156 vulnerability matches]
├── by severity: 4 critical, 15 high, 22 medium, 8 low, 92 negligible (15 unknown)
└── by status: 13 fixed, 143 not-fixed, 0 ignored
real 0m34.169s
user 0m16.733s
sys 0m1.634s
✔ Parsed image sha256:f78b5b90f20c751402aee62cca2342ed20abb9af0d06e45cdc666918ad9f9a00
✔ Cataloged contents 62fe8db1f064ce5bfd13cf87d2dcc9083d129b083a43009dde3551393ca9f4fa
├── ✔ Packages [497 packages]
├── ✔ File digests [8,878 files]
├── ✔ File metadata [8,878 locations]
└── ✔ Executables [931 executables]
✔ Scanned for vulnerabilities [156 vulnerability matches]
├── by severity: 4 critical, 15 high, 22 medium, 8 low, 92 negligible (15 unknown)
└── by status: 13 fixed, 143 not-fixed, 0 ignored
[0031] WARN unable to discover java packages from opener: unable to process nested java archive (WEB-INF/lib/javax.inject-1.jar): /usr/share/jenkins/jenkins.war (sha256:9
[0059] WARN unable to parse cpe attributes for elf binary package error=unable to parse Attributes string: failed to parse Attributes="": wfn: unsupported format ""
real 1m0.503s
user 0m58.470s
sys 0m3.019s
✔ Parsed image sha256:f78b5b90f20c751402aee62cca2342ed20abb9af0d06e45cdc666918ad9f9a00
✔ Cataloged contents 62fe8db1f064ce5bfd13cf87d2dcc9083d129b083a43009dde3551393ca9f4fa
├── ✔ Packages [496 packages]
├── ✔ File digests [8,878 files]
├── ✔ File metadata [8,878 locations]
└── ✔ Executables [931 executables]
✔ Scanned for vulnerabilities [156 vulnerability matches]
├── by severity: 4 critical, 15 high, 22 medium, 8 low, 92 negligible (15 unknown)
└── by status: 13 fixed, 143 not-fixed, 0 ignored
[0042] WARN unable to discover java packages from opener: unable to process nested java archive (WEB-INF/lib/javax.inject-1.jar): /usr/share/jenkins/jenkins.war (sha256:9
real 1m2.205s
user 0m59.532s
sys 0m2.939s
I suspect this may be related to Grype v0.82.0 including Syft v1.14.0.
In Syft v1.13.0, we landed some changes which likely affected Java heavy containers.
Thanks for coming back so quicky @popey .
Is this considered a bug, or just what we need to expect now?
For some of our internal images (which I can't share) the scan times have gone from 10secs to 2 mins, and we have pipelines that produce 10 java images - so the cumulative effect of this is quite pronounced?
Sorry that this is causing you pronounced issues. I appreciate this is not desirable. The team is aware of the problem and its impact. They will take a look at the issue when they have a moment. As a short-term workaround, can you revert to the older, faster release of Grype in the interim?
Thanks for that, just wanted to know if it was going to be addressed in the future. For now we have reverted to the earlier version, which is fine for us for now. Thanks again for looking at this
Thanks for your patience. It's being looked at right now by the Best People. 😄 I'm not sure we'll crank a fixed release out, especially this late, on a Friday. But I know there are solid theories. So if you're good for now, that's great to know. Have a great weekend.
@wagoodman / @popey - many thanks for the fast fix, I can confirm performance for us has returned to the 0.81 levels
What happened: When upgrading grype from 0.81.0 to 0.82.1 (but also 0.82.0) the performance of scanning java heavy containers has decreased significantly
What you expected to happen: The performance would be similar
How to reproduce it (as minimally and precisely as possible):
Using
-vv
:[0007] INFO task completed elapsed=3.801204512s task=java-archive-cataloger
Using
-vv
:[0027] INFO task completed elapsed=22.68268451s task=java-archive-cataloger
Anything else we need to know?:
Environment:
grype version
:cat /etc/os-release
or similar):