Closed tnh closed 3 hours ago
When just doing this build action:
# build the image you wish to scan
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
build-args: |
GIT_SHA=${{ github.sha }}
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:latest
${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
(eg without any Platform
) the scan works. Given I see the image in ECR, it seems to suggest that the problem is not understanding that it is a multi-arch image?
So I think the bug is somewhere within imageInit.go.
Hello, thank you for submitting the issue. I understand you are having difficulty scanning a multi-arch image. Multi-arch images are unsupported by this action at this time.
I am presently researching this to determine the level of effort involved in supporting the feature. Additionally, I am exploring possible work-arounds for your consideration.
I will report back with additional guidance after I've validated work-arounds.
I'd imagine the only viable workaround would be to do this via some tagging standard. Eg
${ECR}:/${Some identifier}-${architecture}
# build the image you wish to scan
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
build-args: |
GIT_SHA=${{ github.sha }}
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}-arm64
load: true
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
...
@tnh Hi there, I wanted to let you know that I was out most of last week with pneumonia - thank you for your continued patience. I'm resuming work on this feature again.
Now, I'm presently working on a PoC for supporting multi-arch images.
That said, I am interested in feedback for this use case if you have any to share. May I ask, how would you like to scan multi-arch images with this action or in general? Is it sufficient to add a new field that lets the user specify the image arch to scan? Something like this:
platform: "linux/amd64"
Update: we have a pull request in progress that allows users to specify the container image platform they wish to scan:
https://github.com/aws-actions/vulnerability-scan-github-action-for-amazon-inspector/pull/102
We are planning on shipping this with our next release, ETA early November.
Feel free to let us know if you have questions or feedback.
@bluesentinelsec Thanks for making that PR. Any update when this will be released? Would be fantastic for our workflow
@ethanr-bjss Hello, thank you for the follow-up. Our intent is to publish a new release of this action within the next two weeks. We may adjust those timelines if we feel more testing is warranted.
@ethanr-bjss @tnh
We have released a new version of this Action that supports multi-arch images.
Please see here for details: https://github.com/aws-actions/vulnerability-scan-github-action-for-amazon-inspector/releases/tag/v1.2.0
Please feel encouraged to open an issue if you encounter any problems or have feedback.
Thank you!
Marking this issue as resolved. Please re-open if this does not resolve your problem.
Description
it doesnt appear that you support multiarch builds within ECR
Expected Behavior
You should
Actual Behavour
ECR is returning unauthorised.
Steps to Reproduce
This github action pipeline:
The build output is:
Other Information
Please provide any additional information such as logs or screenshots.
I see the
e4ec5a89a346c47eb8f81af9a4109e0d7e436521
in my ecr: