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 image version to SHA of the tag #1208

Open
ego93 opened this issue Jan 6, 2025 · 1 comment
Open

Pin image version to SHA of the tag #1208

ego93 opened this issue Jan 6, 2025 · 1 comment

Comments

@ego93
Copy link

ego93 commented Jan 6, 2025

As suggested here Kong/kubernetes-ingress-controller#6907 (comment) after the recent security incident with the kubernetes-ingress-controller 3.4.0 image Kong/kubernetes-ingress-controller#6907 (comment), it would be a good idea to pin the image tag for kubernetes-ingress-controller to the SHA rather than the moving target 3.4 tag

@ego93 ego93 changed the title Pin kubernetes-ingress-controller image tag to SHA Pin image version to SHA of the tag Jan 14, 2025
@ego93
Copy link
Author

ego93 commented Jan 16, 2025

After some testing, adding SHA to the image tag is possible, but it would be better to have a separate value in the values file.

This is what I tested, it hard codes the image version to 3.8.0 with it's SHA from the kong docker repo for linux/amd64

image:
  repository: kong
  tag: "3.8.0@sha256:e66c22bf9bc7140c439c96b09ff6022e0875b0a131c052ec129c29ec9c02c5bc"

If the SHA does not match the image tag it will not pull, this is why you won't be able to use the floating 3.8 tag as that is subject to change with newer versions.

That said, if Kong releases a new version, even with a patch version change, It is my belief that it should be updated in the chart to allow for testing before wildly accepting a new version.

A better implementation of this would be as I said to have a value for sha like so:

image:
  repository: kong
  tag: 3.8.0
  sha: e66c22bf9bc7140c439c96b09ff6022e0875b0a131c052ec129c29ec9c02c5bc

in the templates you could make this support sha value with or without the sha256: for better compatibility.

This also applies to the KIC and waitImage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant