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

Set default rootless sigstore #1035

Merged
merged 1 commit into from
Sep 18, 2020
Merged

Set default rootless sigstore #1035

merged 1 commit into from
Sep 18, 2020

Conversation

QiWang19
Copy link
Collaborator

@QiWang19 QiWang19 commented Aug 26, 2020

Set default rootless sigstore to ~/.local/share/containers/sigstore if the caller is non-root.
Fix rootless podman push --sign-by.

Signed-off-by: Qi Wang qiwan@redhat.com

@QiWang19
Copy link
Collaborator Author

@mtrmac PTAL

@QiWang19
Copy link
Collaborator Author

Add GetRootlessUID() to internal subpackage according to #1027 (comment), can use unshare.GetRootlessUID() from containers/storage here?

docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
internal/uid/uid.go Outdated Show resolved Hide resolved
internal/uid/uid.go Outdated Show resolved Hide resolved
internal/uid/uid.go Outdated Show resolved Hide resolved
internal/uid/uid.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Oh… the rest of the client will now need to account for the state that sigstore is no longer “opt-in”. Especially after the /var path is added, the various code paths that assume signatureStorageBase can be nil become dead code.

docker/lookaside.go Outdated Show resolved Hide resolved
@QiWang19 QiWang19 force-pushed the sigstore branch 2 times, most recently from 23f5660 to 2c79bdc Compare September 2, 2020 17:41
@QiWang19
Copy link
Collaborator Author

QiWang19 commented Sep 2, 2020

@mtrmac PTAL. I added the changes from #385. But the CI is not happy, will check the test failures.

docker/lookaside.go Outdated Show resolved Hide resolved
docs/containers-registries.d.5.md Outdated Show resolved Hide resolved
docs/containers-registries.d.5.md Outdated Show resolved Hide resolved
The default `sigstore-staging` is `/var/lib/containers/sigstore` from `/etc/containers/registries.d/default.yaml`.
If the user has no privilege to write the signature to the default sigstore-staging, the YAML format files
under `$HOME/.config/containers/registries.d` can be configured, otherwise, `$HOME/.local/share/containers/sigstore` will be used.

## Examples
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider adding an extra “example” for no configuration.

docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside_test.go Outdated Show resolved Hide resolved
docker/lookaside_test.go Outdated Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
@mtrmac
Copy link
Collaborator

mtrmac commented Sep 7, 2020

I added the changes from #385. But the CI is not happy, will check the test failures.

I think that’s because this adds only half of #385; the source implementation needs the change as well, or it will try reading the sigstore instead of X-R-S-S.

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

ACK overall.

Would it be useful to make some variant of configuredSignatureStorageBase public for Podman? That’s up mostly to you, I think.

docker/lookaside.go Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
docs/containers-registries.d.5.md Outdated Show resolved Hide resolved
docs/containers-registries.d.5.md Outdated Show resolved Hide resolved
@QiWang19 QiWang19 linked an issue Sep 9, 2020 that may be closed by this pull request
@QiWang19 QiWang19 force-pushed the sigstore branch 4 times, most recently from a853970 to 90600f0 Compare September 10, 2020 01:55
@QiWang19
Copy link
Collaborator Author

@mtrmac PTAL

docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside.go Outdated Show resolved Hide resolved
docker/lookaside_test.go Outdated Show resolved Hide resolved
docker/docker_image_dest.go Show resolved Hide resolved
docker/docker_image_dest.go Show resolved Hide resolved
docker/docker_image_src.go Show resolved Hide resolved
docker/docker_image_src.go Show resolved Hide resolved
docker/lookaside.go Show resolved Hide resolved
@mtrmac mtrmac mentioned this pull request Sep 11, 2020
@QiWang19 QiWang19 force-pushed the sigstore branch 2 times, most recently from f6b9e9e to 344d6a8 Compare September 14, 2020 16:50
@QiWang19
Copy link
Collaborator Author

@mtrmac Can I get a review before you leave for PTO?

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

ACK, please rebase on top of the recent typo fix.

(And ideally make sure Podman can benefit from SignatureStorageBaseURL.)

docker/docker_image_src.go Outdated Show resolved Hide resolved
docker/docker_transport.go Outdated Show resolved Hide resolved
docs/containers-registries.d.5.md Outdated Show resolved Hide resolved
@mtrmac
Copy link
Collaborator

mtrmac commented Sep 17, 2020

LGTM after dropping the docker/docker_transport.go part, actually.

Set default rootless sigstore to ~/.local/share/containers/sigstore if the caller is non-root.
Export the func ConfiguredSignatureStorageBase() for Podman image sign implementation.
Signed-off-by: Qi Wang <qiwan@redhat.com>
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Thanks!

@mtrmac mtrmac merged commit 1a0dda7 into containers:master Sep 18, 2020
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.

Wrong sigstore location on rootless podman push --sign-by
2 participants