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

Syft finds no apks for some images with apks #1354

Closed
luhring opened this issue Nov 19, 2022 · 1 comment · Fixed by #1365
Closed

Syft finds no apks for some images with apks #1354

luhring opened this issue Nov 19, 2022 · 1 comment · Fixed by #1365
Labels
bug Something isn't working

Comments

@luhring
Copy link
Contributor

luhring commented Nov 19, 2022

Please provide a set of steps on how to reproduce the issue

syft -q registry:cgr.dev/chainguard/sdk@sha256:871b75ddd7b91a29ea0ed8695e271f59056c21af6a2f937f9224e81d6030dbec | grep 'apk\s'

What happened:

No apk type packages are found by Syft for this image.

What you expected to happen:

Since the image's /lib/apk/db/installed does contain several package entries, Syft should have reported those packages.

Anything else we need to know?:

I did a small amount of debugging. It seems like Syft does find the installed db and starts to find packages, but then hits a scanner error (ErrTooLong) and so it returns a nil slice of packages.

Package entries in the apk db can be pretty large. I think Syft's current parsing approach isn't able to handle these larger entries, because the entry's byte count exceeds the scanner's buffer size.

This may be solvable by increasing the size of the buffer, but it may be better to try an approach that doesn't require the scanner to hold an entire package entry in the buffer at once. I haven't thought through this idea, but would be happy to chat through it on this issue if that helps!

@luhring luhring added the bug Something isn't working label Nov 19, 2022
@kzantow
Copy link
Contributor

kzantow commented Nov 21, 2022

We definitely should log issues instead of completely failing to return any packages when we hit an error like this. Also -- as you say, for this specific one, we could probably bump a buffer size somewhere.

GijsCalis pushed a commit to GijsCalis/syft that referenced this issue Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants