You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
I'm new to the project but came across a recent issue with Trivy I traced to this library. In short, I am scanning quay.io/argoproj/argocli:v3.1.10 for vulnerabilities, and the history that fanal returns does not match the image's actual history. Specifically, the empty_layers differ. Tracing through fanal, the problematic line is here:
The difference is fanal counts the second layer with the "WORKDIR /home/argo" command as empty when it should not be. This causes issues downstream when trying to attach layer diff ids back to the history that created them. This image has 5 diff ids but fanal only shows 4 as non empty.
For now, I have resulted to parsing the image tar file directly to extract the correct empty_layers for my use case. It would be nice to see this fixed natively!
Thanks for looking into it
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi fanal team,
I'm new to the project but came across a recent issue with Trivy I traced to this library. In short, I am scanning
quay.io/argoproj/argocli:v3.1.10
for vulnerabilities, and the history that fanal returns does not match the image's actual history. Specifically, theempty_layers
differ. Tracing through fanal, the problematic line is here:fanal/image/daemon/image.go
Line 156 in d775d7b
It appears that my image has a layer with
size == 0
but docker does not consider it anempty_layer
.For example, here is the contents of the image's config json history:
and here is the history returned by fanal:
The difference is fanal counts the second layer with the "WORKDIR /home/argo" command as empty when it should not be. This causes issues downstream when trying to attach layer diff ids back to the history that created them. This image has 5 diff ids but fanal only shows 4 as non empty.
I'm not sure what a proper solution would be here but I did come across the dive project which appears to read the image's config json directly and produces the correct results:
https://github.com/wagoodman/dive/blob/c7d121b3d72aeaded26d5731819afaf49b686df6/dive/image/docker/config.go#L18-L45
For now, I have resulted to parsing the image tar file directly to extract the correct
empty_layers
for my use case. It would be nice to see this fixed natively!Thanks for looking into it
The text was updated successfully, but these errors were encountered: