Open dnwake opened 5 years ago
Hi @dnwake can you please share more details on your setup and how you distribute keys to your jenkins machines. I have a similar use case where I have multiple clients (not jenkins) that need to push and sign different tags of the same image. I have tried to configure trust_pinning and disable_tofu but nothing works. I am still seeing that first client will generate target keys for the GUN image and other clients are rejected because of missing the target key. I would be grateful if you can share your knowledge here.
@MohamedTalhaoui
We distribute two keypairs (a delegation keypair and a trust-pinning keypair) to all our Jenkins machines via Puppet.
When creating a new GUN on one of the Jenkins machines:
The trust-pinning keypair is used to stop the TOFU loophole.
The problem described in this thread arose because we discarded the generated root keypairs, the delegation keypairs eventually expired, and because we no longer had the root keypairs we weren't able to extend / renew the delegation.
Hi @dnwake
thanks a lot for your reply. Could you also please share how these steps translates to notary/docker trust commands ?
My setup is based on Harbor deployed on a K8S cluster. I have deployed some pods running a docker daemon and having notary cli installed. These pods are created and destroyed dynamically to sign images. The root and delegate keys are mounted to the pods. Each time a pod is created, it does the following:
# login to docker registry
docker login -u $USERNAME -p $PASSWORD $HARBOR"
# load root key
docker trust key load signer-root.key --name root
# load delegate key
docker trust key load signer-delegate.key --name signer
# add delegate, this command will fail unless the pod has initiated the GUN
docker trust signer add --key signer-delegate.crt signer $HARBOR/$DST_REPO
# sign image
DOCKER_CONTENT_TRUST=1 docker push $HARBOR/$DST_REPO:$DST_TAG"
So far it is woking but I am facing the following limitations:
Is there a way to provide the keys to use for GUNs. I was expecting it was possible with trust_pinning but I am either wrong or missing something.
Any help is welcome.
Our setup is:
We need some way to either
Is it possible to do either of these things without the original signing keys?
Thanks!
Command line output with debugging enabled: