|
1 | 1 | { |
2 | 2 | "Provider": "gcp", |
3 | 3 | "CheckID": "apikeys_api_restrictions_configured", |
4 | | - "CheckTitle": "Ensure API Keys Are Restricted to Only APIs That Application Needs Access", |
| 4 | + "CheckTitle": "API key is restricted to specific Google APIs", |
5 | 5 | "CheckType": [], |
6 | 6 | "ServiceName": "apikeys", |
7 | 7 | "SubServiceName": "", |
8 | 8 | "ResourceIdTemplate": "", |
9 | | - "Severity": "medium", |
10 | | - "ResourceType": "API Key", |
11 | | - "ResourceGroup": "IAM", |
12 | | - "Description": "API Keys should only be used for services in cases where other authentication methods are unavailable. If they are in use it is recommended to rotate API keys every 90 days.", |
13 | | - "Risk": "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.", |
| 9 | + "Severity": "high", |
| 10 | + "ResourceType": "apikeys.googleapis.com/Key", |
| 11 | + "Description": "Google Cloud API keys have **API restrictions** limiting calls to specific services. The finding checks that keys are restricted to named Google APIs and do not include the broad `cloudapis.googleapis.com`, indicating keys are scoped only to intended use.", |
| 12 | + "Risk": "Unrestricted keys-or ones allowing `cloudapis.googleapis.com`-expand attack surface. A leaked key can call many APIs without identity, enabling data exposure, unintended changes on permissive endpoints, and **quota/billing exhaustion**, impacting confidentiality, integrity, and availability.", |
14 | 13 | "RelatedUrl": "", |
| 14 | + "AdditionalURLs": [ |
| 15 | + "https://cloud.google.com/docs/authentication/api-keys", |
| 16 | + "https://cloud.google.com/docs/authentication/api-keys-best-practices" |
| 17 | + ], |
15 | 18 | "Remediation": { |
16 | 19 | "Code": { |
17 | | - "CLI": "", |
| 20 | + "CLI": "gcloud services api-keys update <KEY_ID> --api-target=service=<SERVICE_NAME>", |
18 | 21 | "NativeIaC": "", |
19 | | - "Other": "https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudAPI/check-for-api-key-api-restrictions.html", |
20 | | - "Terraform": "" |
| 22 | + "Other": "1. In Google Cloud Console, go to APIs & Services > Credentials\n2. Click the API key name to edit it\n3. In API restrictions, select \"Restrict key\"\n4. Choose only the specific API(s) needed (do not select \"All Google APIs\")\n5. Click Save", |
| 23 | + "Terraform": "```hcl\nresource \"google_apikeys_key\" \"key\" {\n display_name = \"<example_resource_name>\"\n\n restrictions {\n api_targets {\n service = \"<SERVICE_NAME>\" # Critical: restricts the key to a specific API, removing any \"All Google APIs\" (cloudapis.googleapis.com)\n }\n }\n}\n```" |
21 | 24 | }, |
22 | 25 | "Recommendation": { |
23 | | - "Text": "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. 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.", |
24 | | - "Url": "https://cloud.google.com/docs/authentication/api-keys" |
| 26 | + "Text": "Apply **least privilege**: restrict each API key to only the specific APIs it must access and never include `cloudapis.googleapis.com`. Add **application restrictions** (referrers, IPs, app IDs), rotate keys, and monitor usage. Prefer **service accounts** or short-lived tokens for production as part of **defense in depth**.", |
| 27 | + "Url": "https://hub.prowler.com/check/apikeys_api_restrictions_configured" |
25 | 28 | } |
26 | 29 | }, |
27 | | - "Categories": [], |
| 30 | + "Categories": [ |
| 31 | + "secrets", |
| 32 | + "identity-access" |
| 33 | + ], |
28 | 34 | "DependsOn": [], |
29 | 35 | "RelatedTo": [], |
30 | 36 | "Notes": "" |
|
0 commit comments