Ensure that the usage of your Google Cloud API keys is restricted to specific APIs such as Cloud Key Management Service (KMS) API, Cloud Storage API, Cloud Monitoring API and/or Cloud Logging API. All Google Cloud API keys that are being used for production applications should use API restrictions.
This rule resolution is part of the Conformity Security & Compliance tool for GCP.
Google Cloud Platform (GCP) API keys are simple encrypted strings that don't identify the user or the application that performs the API request. GCP API keys are typically accessible to clients, as they can be viewed publicly from within a browser, making it easy to discover and capture API keys. In order to follow cloud security best practices and reduce the attack surface, Google Cloud API keys should be restricted to call only those APIs required by your application.
Audit
To determine if your Google Cloud API key usage is restricted to specific APIs only, perform the following operations:
Remediation / Resolution
To enable and configure API restrictions for your Google Cloud API keys, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- Authentication overview
- Using API keys
- CIS Security Documentation
- Securing Google Cloud Computing Platform
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud alpha services api-keys list
- gcloud alpha services api-keys describe
- gcloud alpha services api-keys update