-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Added REST storage for images/signatures resource #9181
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
Conversation
d19f2fc to
7ad1c59
Compare
39bcb8f to
fa3fa4b
Compare
|
Will review once the first part is in. |
|
Thanks, I have successfully used this from an independently written client in containers/skopeo#93 ; but I ran into a fairly serious difficulty about the permissions design. The way things work now, the first user uploading a specific image can include any signatures they want in the original This is bad for multitenancy or for the stand-alone Atomic Registry; everyone should be able to upload any images they please in their own namespace, and add any signatures they please to images in their own namespace. It is fine if removing signatures is restricted; adding a signature should never break anything or cause the image to be removed, so removing signatures is not needed except for an “approval/revoking approval” workflow. Could the permission design be modified so that adding signatures (through the new (Even with that, the signatures would not be namespaced, and the existence a tenant’s signature would be visible to other tenants. That is a slight privacy leak, but perhaps not a showstopper.) |
@miminar, is that intentional?
We wouldn't let normal users interact with unnamespaced objects in that way. If we wanted regular users to add signatures, there would need to be a namespaced API to allow that.
I would expect it to be a subresource, which would allow granular control over whether signing was enabled. Access to that subresource could possibly be added to existing roles if that makes sense. |
|
I think we can resolve many use-cases by having signatures live as a subresource on images. The status-y parts would be stripped when POSTing to the subresource. The status-y parts could be set via a direct image update/patch or via a status endpoint (if we split the signature, but right now nothing in an image is split along spec/status lines). This would mean that image signatures start out as only available to people more trusted that project-admins and editors. I agree that we'll end up wanting to allow any editor to add a signature to an image, but the "scope" of that signature is less clear. Because there are size limits for an etcd record, allowing any editor to add any number of signatures won't scale out for large environments. There are definitely cases where you want to share the signature (QA signs an image and the production namespace should get that sig when they retag) and there are definitely cases where you don't want to share it ("bob signed his istag of the openshift/rhel 7.2, but I don't know who bob is and don't care"). If we stored these signatures in a different etcd hierarchy, we could automatically inject signatures from your namespace. If you want to see other signatures, maybe you need a different API call with a special filter. Either way, I think I see the |
It is. An uploader of a new image should be allowed to upload any signatures he wants. New image is tagged just in one namespace so the uploader may be considered as the sole owner of the image at that time. Modification of signatures of existing image is another story because the image may be tagged in multiple namespaces with different owners. That's why changing the existing signatures is restricted.
This could be done. I'm however reluctant to allow removal of existing signatures while creating images using However, I don't consider For this purpose, I'd rather add a new subresource Any signature removal of existing image should be done through the unnamespaced
👍 |
I'm not sure whether I'd expect the first person to push an image to be able to surface their signatures into any other namespace they want. @smarterclayton, was that what you expected? |
@liggitt shall we rather allow for per-project image signatures? And allow to pin a signature to an image by a cluster image-signer. I don't disagree. My only concern is signature redundancy and possible complexity. |
|
With pull through present, it's not sufficient to say "first pusher gets to On Wed, Jun 8, 2016 at 9:41 AM, Michal Minar notifications@github.com
|
Yeah, let's get this merged and then figure out the per-namespace aspect; it does need to be figured out eventually. |
fa3fa4b to
9ff4bf4
Compare
|
Rebased. Removed an option to set signatures during We can add imagestream-scoped modification of iimage signatures (additions only) in a follow-up PR. |
|
Let's hold off on adding user focused signing until we have a design On Mon, Jun 13, 2016 at 4:38 AM, OpenShift Bot notifications@github.com
|
| OpenshiftExposedGroupName: {BuildGroupName, ImageGroupName, DeploymentGroupName, TemplateGroupName, "routes"}, | ||
| OpenshiftAllGroupName: {OpenshiftExposedGroupName, UserGroupName, OAuthGroupName, PolicyOwnerGroupName, SDNGroupName, PermissionGrantingGroupName, OpenshiftStatusGroupName, "projects", | ||
| "clusterroles", "clusterrolebindings", "clusterpolicies", "clusterpolicybindings", "images" /* cluster scoped*/, "projectrequests", "builds/details", "imagestreams/secrets", | ||
| "clusterroles", "clusterrolebindings", "clusterpolicies", "clusterpolicybindings", "images", "images/signatures" /* cluster scoped*/, "projectrequests", "builds/details", "imagestreams/secrets", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add anything else to this file. See line 7.
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6704/) |
|
lgtm [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6704/) (Image: devenv-rhel7_4649) |
|
Evaluated for origin merge up to cf163c2 |
This reverts commit 7f9c56a.
This can only work against the image-signatures-rest branch for openshift/origin#9181 . Note the need for openshiftCluster.relaxImageSignerPermissions.
This reverts commit 7f9c56a. Also fixes build with updated OpenShift hack/common.ss: The computation of OS_GIT_MAJOR and OS_GIT_MINOR was failing because miminar/origin didn’t carry the expected recent tags.
This can only work against the image-signatures-rest branch for openshift/origin#9181 . Note the need for openshiftCluster.relaxImageSignerPermissions.
This reverts commit 7f9c56a. Also fixes build with updated OpenShift hack/common.sh: The computation of OS_GIT_MAJOR and OS_GIT_MINOR was failing because miminar/origin didn’t carry the expected recent tags.
This reverts commit 7f9c56a. Also fixes build with updated OpenShift hack/common.sh: The computation of OS_GIT_MAJOR and OS_GIT_MINOR was failing because miminar/origin didn’t carry the expected recent tags.
This reverts commit 7f9c56a. Also fixes build with updated OpenShift hack/common.sh: The computation of OS_GIT_MAJOR and OS_GIT_MINOR was failing because miminar/origin didn’t carry the expected recent tags.
This reverts commit 7f9c56a. Also fixes build with updated OpenShift hack/common.sh: The computation of OS_GIT_MAJOR and OS_GIT_MINOR was failing because miminar/origin didn’t carry the expected recent tags.
Uses a tag created after merging that PR. (git clone -b …) does not work with commit IDs, and we like to use a released version anyway.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
This builds from the image-signatures-rest branch for openshift/origin#9181 . Testing push, pull, streaming. Does not test working with the other Docker registries built in Dockerfile; I will leave that to the author of that code :) Note that this relies on an internet connection for pulling from the Docker Hub (which is incidentally tested by that); pushing to no Docker Registry, neither local nor Hub, is tested by this. The tests only run in a container because the (oc login) / (docker login)-like code modifies files in a home directory; the new SKOPEO_CONTAINER_TESTS environment variable should protect against accidental non-container runs.
The new
images/signaturesresource allows to update image' signatures. There's a new images API client callimages.UpdateSignatures()for this purpose.A cluster-wide role
system:image-signeris necessary to add/remove/modify signatures.A follow-up for #8371