-
Notifications
You must be signed in to change notification settings - Fork 139
(atomic sign) and (skopeo copy) are inconsistent WRT Docker sigstore configuration #594
Description
Per #539 (comment) , the sigstore configuration is done differently in atomic sign and skopeo copy, i.e. skopeo copy won't see signatures created by atomic sign.
We need to make these consistent; it is not as important how, but we do need to do that.
Currently, AFAICS:
atomicreads a single variable nameddefault-sigstore-path, and defaults to/var/lib/sigstore(https://github.com/projectatomic/atomic/blob/master/Atomic/sign.py#L14)skopeo, via containers/image, (all of https://github.com/mtrmac/image/blob/docker-lookaside/docker/lookaside.go ) does a scoped lookup; givenhostname/ns1/ns2/ns3/repo:tag, it will look in aregistriesdictionary for the first match of:hostname/ns1/ns2/ns3/repo:taghostname/ns1/ns2/ns3/repohostname/ns1/ns2/ns3hostname/ns1/ns2hostname/ns1hostname""
Within the first match (only), which should be a dictionary, it uses the field sigstore-write if writing and it is defined, or sigstore (for either reading or writing). The value of the field is an URL to the top directory for the sigstore to be used for these images (which still uses the standard layout, i.e. $sigstore_dir/hostname/ns1/ns2/...).
If nothing matches, the default is no sigstore
See https://github.com/mtrmac/skopeo/blob/integrate-all-the-things/integration/fixtures/atomic.conf for an example of such a configuration.
Rationale for the more complex containers/image design:
- Supports HTTP: we can configure to use remote signatures directly, without fetching them to a local directory first.
- Allows a separate sigstore-write location for staging new signatures to be published (i.e. the read path can use the public HTTP version which public users see, and the write path is company-private; the company can of course use the same local path for reading and writing instead)
- Allows different signature stores for different repositories, i.e.
docker.io/redhatanddocker.io/coreoscan publish HTTP sigstores and we can use both of them at the same time (i.e. federation model, not a Notary-like single point of distribution) - The default for repositories which have not been specifically configured is to refuse to store signatures (though the user can use
""if they really want to); if nobody has configured a sigstore
for a repo, they very likely haven’t thought about a publishing workflow for the signatures, so we shouldn’t be storing them somewhere in/varand pretending to suceed signing when the signatures are invisible to consumers of that image and the user pushing the image has no idea they are invisible.