-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Snyk can't scan kaniko-produced images #1976
Comments
Can you share the invalid tar file, and the valid one produced by skopeo copying? Diffing them may help uncover what the problem is. |
Sure! Here is the file produced by kaniko: out.tar.gz and here is after copying with skopeo: out2.tar.gz (both got renamed to |
I think I had a meeting with developers form Snyk . We spoke about changing the kaniko tar format to adhere to https://snyk.io/blog/container-image-formats. However, we havent seen any movement from them. |
I think this issue is also related to scanning docker images using Synopsis Black Duck, I am getting a similar issue " Exception thrown while getting image packages: Could not parse the image manifest file" |
There was a potentially similar issue with Dive (wagoodman/dive#318). Docker and Kaniko use different naming conventions for the config files. Dive assumed all config files would end in Looking at @markszabo's example files, we can see similar differences: Kaniko file structure
Skopeo file structure
|
Is there any further update on this issue? |
Any news on this?? |
does Synk supports or scans kaniko produced images ? any further update on this ? |
I'm seeing the same issue on my end, any updates? |
I would like to see this fixed, one way or another, as well please. |
The only way I was able to get this to work is by doing the below, the solution assumed you are using aws ecr as the repo & kaniko image to build out your docker images. Automation Pipelines General Overview:
This is an obvious work around, but since the team has no direction as to when it will get fixed, this is the solution I'm leveraging for automated docker scans in the pipeline. The entire solution can be put into a docker container btw, i.e install the snyk cli + skopeo tool on a docker container. Command for skopeo to get the ECR Token and make the call to aws ecr to pull the image layers: |
I was able to get it to work by doing |
If anybody is looking for an example repro, have a kaniko built image which Source: https://github.com/CMS-Enterprise/batcave-knight-light/tree/main/node-server Attempting to scan with a locally build version of the Initially I received After running Original archive: https://drive.google.com/file/d/12k0ovaUfDfhnzqkPzksTIqi3gs_7eA4R/view?usp=drive_link The issue is also reproducible in a CI environment running on amd64 instead of arm. |
It seems likely that this is a problem with snyk, not with Kaniko. Snyk has the same issue with images built using buildx with buildkit and save/exported using the |
Actual behavior
Snyk fails to scan docker images produced by kaniko:
However
docker load
ing the same image make snyk work:Expected behavior
I expect kaniko to produce images that can be scanned with snyk
To Reproduce
See above.
Additional Information
nothing
Workaround
We found that if the archive is copied with
skopeo
, then snyk can work with it:Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: