Skip to content

Validate digest in repo for pull by digest#44327

Merged
thaJeztah merged 3 commits into
moby:masterfrom
thaJeztah:ghsa-ambiguous-pull-by-digest_master
Oct 21, 2022
Merged

Validate digest in repo for pull by digest#44327
thaJeztah merged 3 commits into
moby:masterfrom
thaJeztah:ghsa-ambiguous-pull-by-digest_master

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Upstreaming the patch for GHSA-vjgr-4595-fc6r to master.

This is a rebase and squash of https://github.com/moby/moby-ghsa-vjgr-4595-fc6r/pull/3

This is accomplished by storing the distribution source in the content labels. If the distribution source is not found then we check to the registry to see if the digest exists in the repo, if it does exist then the puller will use it.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah

Copy link
Copy Markdown
Member Author

Ah, still need to revert 1f21c4d

integration/image/pull_test.go:123:36: undefined: registry.WithStdout
integration/image/pull_test.go:123:68: undefined: registry.WithStderr

@thaJeztah
thaJeztah force-pushed the ghsa-ambiguous-pull-by-digest_master branch from ab18022 to 0697ba1 Compare October 19, 2022 10:21
@thaJeztah

This comment was marked as outdated.

@thaJeztah

This comment was marked as outdated.

@thaJeztah

Copy link
Copy Markdown
Member Author

Looks only on Windows (ran it locally on Linux, and that worked).

@thaJeztah

Copy link
Copy Markdown
Member Author

Ah, never mind; we don't build the registry on Windows (we don't run docker-in-docker, and it's not in the Dockerfile.windows).

@thaJeztah

Copy link
Copy Markdown
Member Author

Interesting; it seems like in Jenkins we are running a registry; maybe it's installed on those machines; let me check that. #44326 (comment)

@thaJeztah

Copy link
Copy Markdown
Member Author

Interesting; it seems like in Jenkins we are running a registry; maybe it's installed on those machines; let me check that. #44326 (comment)

Nevermind, I was looking at the wrong results; it's failing on rootless (not Windows), so no registry on Windows in 20.10 either

@thaJeztah

This comment was marked as outdated.

@thaJeztah

Copy link
Copy Markdown
Member Author

doh!

integration/image/pull_test.go:7:2: `io/ioutil` is in the denylist (depguard)
	"io/ioutil"
	^

@thaJeztah
thaJeztah force-pushed the ghsa-ambiguous-pull-by-digest_master branch 3 times, most recently from dac6e1c to b83ebbf Compare October 20, 2022 20:57
thaJeztah and others added 3 commits October 21, 2022 01:48
This is accomplished by storing the distribution source in the content
labels. If the distribution source is not found then we check to the
registry to see if the digest exists in the repo, if it does exist then
the puller will use it.

Signed-off-by: Brian Goff <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
- On Windows, we don't build and run a local  test registry (we're not running
  docker-in-docker), so we need to skip this test.
- On rootless, networking doesn't support this (currently)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah

Copy link
Copy Markdown
Member Author

@cpuguy83 @tianon @tonistiigi ptal

@thaJeztah

Copy link
Copy Markdown
Member Author

CI is happy; I'm bringing these in

@thaJeztah
thaJeztah merged commit 43b8dff into moby:master Oct 21, 2022
@thaJeztah
thaJeztah deleted the ghsa-ambiguous-pull-by-digest_master branch October 21, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants