π‘οΈ Google KMS Crypto Key is anonymously or publicly accessibleπ π’βͺ
- Contextual name: π‘οΈ Crypto Key is anonymously or publicly accessibleπ π’βͺ
- ID:
/ce/ca/google/kms/kms-cryptokey-access - Tags:
- βͺ Impossible policy
- π’ Policy with categories
- π Policy with internal.md
- π’ Policy with type
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Similar Policiesβ
- Cloud Conformity: Check for Publicly Accessible Cloud KMS Keys
Internal Notes π β
Relationship type: many-to-many
IAM Policy Binding.Name = CryptoKey.CA10__name__c
We cannot do this check automatically.
List all Cloud KMS Cryptokeys.
gcloud kms keys list --keyring=[key_ring_name] --location=global --format=json | jq '.[].name'Remove IAM policy binding for a KMS key to remove access to allUsers and allAuthenticatedUsers using the below command.
gcloud kms keys remove-iam-policy-binding [key_name] --keyring=[key_ring_name] --location=global --member='allAuthenticatedUsers' --role='[role]' gcloud kms keys remove-iam-policy-binding [key_name] --keyring=[key_ring_name] --location=global --member='allUsers' --role='[role]'
Descriptionβ
Descriptionβ
It is recommended that the IAM policy on Cloud KMS
cryptokeysshould restrict anonymous and/or public access.Rationaleβ
Granting permissions to
allUsersorallAuthenticatedUsersallows anyone to access the dataset. Such access might not be desirable if sensitive data is stored at the location. In this case, ensure that anonymous and/or public access to a Cloud KMScryptokeyis not allowed.Impactβ
Removing the binding for
allUsersandallAuthenticatedUsersmembers denies accessingcryptokeysto anonymous or public users.Auditβ
From Google Cloud CLIβ
List all Cloud KMS
Cryptokeys.gcloud kms keys list --keyring=[key_ring_name] --location=global --format=json | jq '.[].name'
Ensure the below command's output does not contain
allUsersorallAuthenticatedUsers.gcloud kms keys get-iam-policy [key_name] --keyring=[key_ring_name] --location=global --format=json | jq '.bindings[].members[]'
Default Valueβ
By default Cloud KMS does not allow access to
allUsersorallAuthenticatedUsers.... see more
Remediationβ
Remediationβ
From Google Cloud CLIβ
List all Cloud KMS
Cryptokeys.gcloud kms keys list --keyring=[key_ring_name] --location=global --format=json | jq '.[].name'
Remove IAM policy binding for a KMS key to remove access to
allUsersandallAuthenticatedUsersusing the below command.gcloud kms keys remove-iam-policy-binding [key_name] --keyring=[key_ring_name] --location=global --member='allAuthenticatedUsers' --role='[role]'
gcloud kms keys remove-iam-policy-binding [key_name] --keyring=[key_ring_name] --location=global --member='allUsers' --role='[role]'