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

Hash Pin docker images #62472

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

joycebrum
Copy link
Contributor

Also related to #62471, would you consider hash pin the docker images?

The security benefit of doing so is that it mitigates the risk of typosquatting attacks since the images are public. If there is a need for them to be updated regularly, I can also submit a .github/dependabot file to update the docker images regularly (weekly or monthly for example).

Besides, AFAIUC, the dockerfiles are used for build and tests, which lead to another benefit of hash pinning: reliability and stability.

Let me know your thoughts about i.

Thanks!

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label Nov 23, 2023
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Nov 27, 2023
@gbaned gbaned requested a review from angerson November 27, 2023 03:26
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Nov 27, 2023
@angerson
Copy link
Contributor

Pinning is a pain when working on these containers. I'm fine with the change as long as you update this PR to alleviate the trouble for developers:

  • Add a dependabot job to keep the shas updated, and add a sha if there is not one
  • Add a comment on each affected FROM line that links to the job definition and explains that a sha will be added automatically post-submission

@joycebrum
Copy link
Contributor Author

joycebrum commented Nov 28, 2023

Hi, I can add the dependabot config file to automatically update the digests on the dockerfiles (which is in fact a security practice too), although dependabot has no feature yet to automatically add hash when there is not one.

The renovatebot, although being a third party tool (not GitHub owned), it has an option to pin digests automatically to the given ecosystem (docker images). It would need to be installed on the repo, but only with read permissions, because we can use the forking renovate.

Would you be interested on the renovatebot instead (I can submit a config file for it) or the dependabot only updating the hashes and versions periodically would be enough to alleviate the trouble for developers?

@joycebrum
Copy link
Contributor Author

An additional feature of renovatebot would be the manual update -- when you select a image and ask for an update without having to wait for the next run of renovatebot job

@gbaned
Copy link
Contributor

gbaned commented Dec 15, 2023

Hi @angerson Any update on this PR? Please. Thank you!

1 similar comment
@gbaned
Copy link
Contributor

gbaned commented Dec 29, 2023

Hi @angerson Any update on this PR? Please. Thank you!

@joycebrum
Copy link
Contributor Author

I've suggested the configuration file for dependabot to show how it would like to update both the actions and the dockerfiles. Dependabot will automatically update the hashes and comments, but it is not able to automatically add a sha when there is none.

Copy link
Collaborator

@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM to me, but leave approval to Austin.

@gbaned gbaned requested review from angerson and removed request for angerson February 9, 2024 08:38
@gbaned
Copy link
Contributor

gbaned commented Mar 7, 2024

Hi @angerson Can you please review this PR ? Thank you!

@gbaned
Copy link
Contributor

gbaned commented Apr 26, 2024

Hi @joycebrum Can you please resolve conflicts? Thank you!

@gbaned gbaned added stat:awaiting response Status - Awaiting response from author and removed awaiting review Pull request awaiting review labels Apr 26, 2024
@joycebrum
Copy link
Contributor Author

Done!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Apr 26, 2024
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Apr 27, 2024
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Apr 27, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Apr 27, 2024
@google-ml-butler google-ml-butler bot removed the ready to pull PR ready for merge process label May 10, 2024
joycebrum and others added 2 commits May 10, 2024 13:09
Signed-off-by: Joyce Brum <joycebrum@google.com>
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
…n_1715346713

[StepSecurity] Apply security best practices
@gbaned gbaned requested a review from mihaimaruseac May 14, 2024 03:15
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label May 14, 2024
@gbaned
Copy link
Contributor

gbaned commented May 21, 2024

Hi @MichaelHudgins Can you please review this PR ? Thank you!

@gbaned gbaned requested review from MichaelHudgins and removed request for angerson May 21, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review Pull request awaiting review size:S CL Change Size: Small
Projects
PR Queue
  
Approved by Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

6 participants