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

Pin dockerfile dependencies by hash #16580

Open
laurentsimon opened this issue May 19, 2021 · 9 comments
Open

Pin dockerfile dependencies by hash #16580

laurentsimon opened this issue May 19, 2021 · 9 comments
Labels
area/docker dependencies Pull requests that update a dependency file enhancement Feature requests. Not bugs or questions. no stalebot Disables stalebot from closing an issue

Comments

@laurentsimon
Copy link

laurentsimon commented May 19, 2021

If you are reporting any crash or any potential security issue, do not
open an issue in this repo. Please report the issue via emailing
envoy-security@googlegroups.com where the issue will be triaged appropriately.

Title: Reduce attack surface by pinning docker dependencies by hash

Description:
scorecard reports

!! frozen-deps - .devcontainer/Dockerfile has non-pinned dependency 'gcr.io/envoy-ci/envoy-build:55d9e4719d2bd0accce8f829b44dab70cd42112a'
!! frozen-deps - ci/Dockerfile-envoy-alpine has non-pinned dependency 'frolvlad/alpine-glibc:alpine-3.12_glibc-2.31'
!! frozen-deps - ci/Dockerfile-envoy-distroless has non-pinned dependency 'gcr.io/distroless/base-debian10:nonroot'

Fix:
Pin dependencies by hash. Example here.
You can retrieve the digest corresponding to the dependencies thru:

$ docker pull <dep>
...
Digest: sha256:acf7795dc91df17e10effee064bd229580a9c34213b4dba578d64768af5d8c51
...
@laurentsimon laurentsimon added bug triage Issue requires triage labels May 19, 2021
@asraa
Copy link
Contributor

asraa commented May 19, 2021

@lizan @phlax

@phlax
Copy link
Member

phlax commented May 19, 2021

this seems like a good idea - there was an issue recently with the alpine upstream image

my only concern is that if we pin to a particular version we probs also want to scan ~frequently that there are no issues with the pinned dep

@laurentsimon do you want to raise a PR to address the hashes ?

if not i can follow up

@laurentsimon
Copy link
Author

@asraa volunteered to help, so I will let her send the PR. Thanks again @asraa !

@phlax phlax added area/docker dependencies Pull requests that update a dependency file enhancement Feature requests. Not bugs or questions. and removed bug triage Issue requires triage labels May 19, 2021
@lizan
Copy link
Member

lizan commented May 20, 2021

There's a problem that sha256 hash differs by architecture, so it doesn't work for our multiarch image build.

@daixiang0
Copy link
Member

I have experience about use SHA256 for different arches and can help if you need.

@phlax
Copy link
Member

phlax commented May 20, 2021

@daixiang0 do you have some idea how this can be achieved ? if so - please do open a PR and lets see

my quick internet search seems to confirm what @lizan has said - but i didnt find any definitive answers - nor any workarounds

@phlax
Copy link
Member

phlax commented May 20, 2021

regarding my concern about keeping up-to-date - it seems dependabot has support for dockerfiles so that is a non-issue i think

@daixiang0
Copy link
Member

I would post soon.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Jun 20, 2021
@phlax phlax added no stalebot Disables stalebot from closing an issue and removed stale stalebot believes this issue/PR has not been touched recently labels Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker dependencies Pull requests that update a dependency file enhancement Feature requests. Not bugs or questions. no stalebot Disables stalebot from closing an issue
Projects
None yet
Development

No branches or pull requests

5 participants