我在 Google Cloud KMS 中有 key 环和 key 。我想使用 key 通过 Helm Secrets enc 加密 Secrets.yml 文件
我是 GCP 项目所有者,我还为自己指定了特定的加密/解密 IAM 角色,鉴于我是所有者,我认为不需要该角色,但值得一试。
尝试运行 helm Secrets enc Secrets.yml 时,出现以下权限被拒绝错误:
Could not generate data key: [failed to encrypt new data key with master key "projects/myproject-266813/locations/global/keyRings/myKeyRing/cryptoKeys/myKey": Failed to call GCP KMS encryption service: googleapi: Error 403: Permission 'cloudkms.cryptoKeyVersions.useToEncrypt' denied on resource 'projects/myproject-266813/locations/global/keyRings/myKeyRing/cryptoKeys/myKey' (or it may not exist)., forbidden]
我的 .sops.yml 文件:
creation_rules:
- gcp_kms: projects/mirkwood-266813/locations/global/keyRings/lotr/cryptoKeys/cdlkey
我使用正确的 GCP 帐户进行了身份验证,那么我缺少什么?
最佳答案
这个问题的答案其实很简单:
gcloud auth application-default login
或
使用服务帐户
gcloud auth login
单独使用没有效果
关于encryption - 使用 helm 和 gcp_kms 加密 Secrets.yml 文件时 key 权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60006141/