Google Cloud KMS CryptoKeys provide cryptographic functionality for encrypting and decrypting sensitive data in Google Cloud. When KMS CryptoKey IAM policies include allUsers or allAuthenticatedUsers, they become publicly accessible, creating a serious security vulnerability that could lead to unauthorized access to encryption capabilities, data breaches, or compromised encrypted information.
Insecure configuration example:
data "google_iam_policy" {
binding {
role = "roles/cloudkms.cryptoKeyEncrypter"
members = ["allUsers"]
}
}
Secure configuration with specific user access:
data "google_iam_policy" {
binding {
role = "roles/cloudkms.cryptoKeyEncrypter"
members = [
"user:jane@example.com",
]
}
}