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

Enforce manifest and blob digests in (skopeo inspect) and (skopeo layers) #2527

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

Conversation

mtrmac
Copy link
Contributor

@mtrmac mtrmac commented Feb 28, 2025

Nobody should be using skopeo layers.

For skopeo inspect, I could see an argument that it should return the data even if it does not match the digest, so that users can diagnose that. On balance, I think matching the expectation that digests are enforced is more valuable.

Copy link
Contributor

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Looks sane to me, just one nonblocking question

if err := retry.IfNecessary(ctx, func() error {
rawManifest, _, err = src.GetManifest(ctx, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a dim memory we talked about this before but is there a reason why GetManifest does not verify by default? We're just talking about some small JSON so the overhead of sha256 on it has to be pretty small.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are ~11 implementations in c/image + several outside, added over time; trusting that all of them are going to do the right thing is hard to enforce.

The idea originally was that the transports only deal with “I/O” and centralized code in c/image, primarily c/image/copy, provides a single location where the enforcement provably happens.

That doesn’t really work with the various external ImageSource users… compare containers/image#2742 .

We might provide some other interface, but we can’t prevent direct calls to GetManifest without breaking the stable API.

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