Skip to content

Make it possible to use this library with only roles/cloudkms.signerVerifier permissions #45

@stanhu

Description

@stanhu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or requestv2 candidateFeatures that would be good to include in the next major PKCS#11 library version.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions