Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Add parsing of Docker sha256 fixations #3440

Merged
merged 5 commits into from
Mar 16, 2021
Merged

Add parsing of Docker sha256 fixations #3440

merged 5 commits into from
Mar 16, 2021

Conversation

hermanbanken
Copy link
Contributor

@hermanbanken hermanbanken commented Mar 7, 2021

Fixes #3329,
Fixes #3189,
Fixes #3080,
Fixes #3009, see also #3009 (comment)
Fixes #929

The proposal is to largely ignore the SHA as far as flux is concerned. Workloads with fixated docker ID's to a specific sha256 should not be updated automatically anyway.

Allowing docker sha256 is extremely important security wise. If you trust a Docker registry today, that does not mean that some bad actor can’t take over and releases containers with backdoors the next day. Not having support for this is dangerous, as people might be tempted to remove the sha256, while it is there for good reasons: you can only vet the code currently in a git repository, and you can't take responsibility for the security mechanisms used by the owner of the repository.

Details

We have registry scanning disabled, but still we see warning about the cache warmer not understanding our ImageID's.

errorLogger.Log("err", errors.Wrap(err, "requesting tags"))

outputs:

requesting tags: mux: variable "hermanbanken/https-redirect@sha256" doesn't match, expected "^(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?/)?[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$"

Kingdon Barrett and others added 4 commits February 26, 2021 07:22
go.mod - reset k8s machinery to 1.17.17

This is the latest release that we can update to
-- see #3378

Try to remove when distribution/distribution#2905 is out

docker/distribution patch still needed for now

(Put it back for now.) On 2021-02-25 this has been merged, 2.7.2 of
docker/distribution should include it hopefully relatively soon!

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
Signed-off-by: Matt Willsher <matt@monki.org.uk>
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
@kingdonb kingdonb self-assigned this Mar 8, 2021
@kingdonb kingdonb self-requested a review March 8, 2021 08:14
@kingdonb kingdonb added bug enhancement review Issues that need a review labels Mar 8, 2021
@kingdonb
Copy link
Member

kingdonb commented Mar 8, 2021

Thanks for documenting so well what issues it targets!

I believe I am familiar with this problem and I have read some of the reports you're referencing. I have to review your PR and do some testing. I see a change in the Ref spec which is exported, this could be potentially considered as a breaking change, but I'm not sure. (I am pretty green at golang – sorry for this.) It seems safe since it is only adding a field.

I am going to try to include this in my upcoming release, bearing all that in mind I hope we will be able to test it in a prerelease shortly 👍 thanks so much!

@kingdonb kingdonb added this to the 1.22.0 milestone Mar 8, 2021
Signed-off-by: Herman Banken <hermanbanken@gmail.com>
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
@kingdonb
Copy link
Member

kingdonb commented Mar 9, 2021

I've rebased this into the omnibus branch that I am using to stage the 1.22.0 release.

Copy link
Member

@kingdonb kingdonb left a comment

Choose a reason for hiding this comment

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

LGTM 👍 💯

@kingdonb kingdonb merged commit ab450be into fluxcd:master Mar 16, 2021
@kingdonb kingdonb removed their assignment Mar 17, 2021
@hermanbanken hermanbanken deleted the fix/docker256 branch March 21, 2021 13:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug enhancement review Issues that need a review
Projects
None yet
2 participants