GCP Cloud KMS IAM and Permissions
What You'll Learn
You'll master how to control who can access, use, and manage encryption keys in GCP Cloud KMS using IAM roles and service accounts.
Understanding Cloud KMS IAM
GCP Cloud KMS uses IAM (Identity and Access Management) to control access to keys at multiple levels: project, key ring, and individual key. This hierarchical permission model lets you grant broad organizational access or lock down specific keys to single applications.
Think of it like a building with floors (key rings) and rooms (keys). You might give someone a master key to the entire building, floor access, or just a single room key—each level of access serves different security needs.
Core IAM Roles for Cloud KMS
Predefined roles handle common scenarios:
roles/cloudkms.admin: Full control over keys and key ringsroles/cloudkms.cryptoKeyEncrypterDecrypter: Can encrypt and decrypt with keysroles/cloudkms.cryptoKeyEncrypter: Can only encrypt (useful for data ingestion)roles/cloudkms.cryptoKeyDecrypter: Can only decrypt (useful for data processing)roles/cloudkms.viewer: Read-only access to key metadata (not key material)
Applying Permissions
You bind IAM roles at the appropriate resource level:
- Project-level: Grants access to all key rings and keys
- Key ring-level: Grants access to all keys within that ring
- Key-level: Grants access to a single specific key (most restrictive)
Service accounts typically receive key-level permissions following least privilege. For example, an application encrypting customer data would get roles/cloudkms.cryptoKeyEncrypter on only the customer data key, preventing it from decrypting or accessing other keys.
Permission Inheritance
Permissions flow downward: a project-level grant applies to all key rings and keys within. You cannot "deny" at a lower level to override higher grants—plan your hierarchy carefully.
Key Takeaway: GCP Cloud KMS uses hierarchical IAM roles applied at project, key ring, or key level to control who can encrypt, decrypt, or manage keys—always grant the minimum permissions needed at the most specific resource level.