I'm trying to use osslsigncode to sign a binary. On a Debian system this invocation looks like:
osslsigncode sign -h sha256 \
-pkcs11engine /usr/lib/x86_64-linux-gnu/engines-3/pkcs11.so \
-pkcs11module /usr/local/lib/libkmsp11.so \
-key "pkcs11:object=example-key" \
-certs test.crt -in test.bin -out test.signed.bin
I would expect that the roles/cloudkms.signerVerifier role would be sufficient here. However, it is not. https://cloud.google.com/kms/docs/reference/permissions-and-roles shows that roles/cloudkms.signerVerifier has the following IAM permissions:
cloudkms.cryptoKeyVersions.useToSign
cloudkms.cryptoKeyVersions.useToVerify
cloudkms.cryptoKeyVersions.viewPublicKey
cloudkms.locations.get
cloudkms.locations.list
resourcemanager.projects.get
As documented in https://github.com/GoogleCloudPlatform/kms-integrations/blob/6529ddfd020fa6655c153c0e66bed9176ab68e78/kmsp11/docs/user_guide.md#authentication-and-authorization, this library needs the IAM permissions cloudkms.cryptoKeys.list and cloudkms.cryptoKeyVersions.list.
https://github.com/GoogleCloudPlatform/kms-integrations/blob/6529ddfd020fa6655c153c0e66bed9176ab68e78/kmsp11/docs/user_guide.md#configuration says that at least 1 key_ring must be defined. It wasn't clear to me whether specifying CKA_LABEL or CKA_ID would skip the loading of the key ring.
I'm trying to use
osslsigncodeto sign a binary. On a Debian system this invocation looks like:I would expect that the
roles/cloudkms.signerVerifierrole would be sufficient here. However, it is not. https://cloud.google.com/kms/docs/reference/permissions-and-roles shows thatroles/cloudkms.signerVerifierhas the following IAM permissions:cloudkms.cryptoKeyVersions.useToSigncloudkms.cryptoKeyVersions.useToVerifycloudkms.cryptoKeyVersions.viewPublicKeycloudkms.locations.getcloudkms.locations.listresourcemanager.projects.getAs documented in https://github.com/GoogleCloudPlatform/kms-integrations/blob/6529ddfd020fa6655c153c0e66bed9176ab68e78/kmsp11/docs/user_guide.md#authentication-and-authorization, this library needs the IAM permissions
cloudkms.cryptoKeys.listandcloudkms.cryptoKeyVersions.list.https://github.com/GoogleCloudPlatform/kms-integrations/blob/6529ddfd020fa6655c153c0e66bed9176ab68e78/kmsp11/docs/user_guide.md#configuration says that at least 1
key_ringmust be defined. It wasn't clear to me whether specifyingCKA_LABELorCKA_IDwould skip the loading of the key ring.