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

Enable Docker digest pinning #90

Merged
merged 1 commit into from
May 28, 2024
Merged

Enable Docker digest pinning #90

merged 1 commit into from
May 28, 2024

Conversation

dbast
Copy link
Member

@dbast dbast commented May 28, 2024

Docker container tags are not immutable versions, thus pinning them from e.g. node:14.15.1 to node:14.15.1@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e prevents "unnoticed" changes in containers.

This is especially relevant to all the external containers we use in helm charts or FROM statements, as somebody could replace a known good version with a bad one (supply chain attack).

The impact of the PR is from "FROM CONTAINER:$VERSION" statements in Dockerfiles to helm charts and values files.

It requires to also to make certain tags more explicit like from "debian:12-slim" to "debian:12.5-slim", to not have the digest changed without a version change. This can be done incrementally via the PRs that renovate anyways opens.

Renovate says "We recommend that you pin your Docker images to an exact digest". We can disable this any time globally or per repo / file, in case it is unwanted.

See also:

Description/Purpose

Expected Impact

Docker container tags are not immutable versions, thus pinning them from
e.g. node:14.15.1 to node:14.15.1@sha256:d938c1761e3afbae9242848ffbb95b9cc1cb0a24d889f8bd955204d347a7266e
prevents "unnoticed" changes in containers.

This is especially relevant to all the external containers we use in helm
charts or FROM statements, as somebody could replace a known good version
with a bad one (supply chain attack).

The impact of the PR is from "FROM CONTAINER:$VERSION" statements in
Dockerfiles to helm charts and values files.

It requires to also to make certain tags more explicit like from
"debian:12-slim" to "debian:12.5-slim", to not have the digest changed
without a version change. This can be done incrementally via the PRs that
renovate anyways opens.

Renovate says "We recommend that you pin your Docker images to an exact
digest". We can disable this any time globally or per repo / file, in case
it is unwanted.

See also:
* https://docs.renovatebot.com/docker/#digest-pinning
* https://docs.renovatebot.com/presets-docker/#dockerpindigests
@dbast dbast requested review from morremeyer, a team and ximena9201 May 28, 2024 09:43
Copy link
Contributor

@morremeyer morremeyer left a comment

Choose a reason for hiding this comment

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

💯. Thanks for taking care of it!

@morremeyer morremeyer merged commit 1ef738a into main May 28, 2024
1 check passed
@morremeyer morremeyer deleted the docker-pin-digest branch May 28, 2024 13:45
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

Successfully merging this pull request may close these issues.

2 participants