> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-api-key-is-created-for-a-project.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP API key is created for a project

### Synopsis

| Field               | Value                                        |
| ------------------- | -------------------------------------------- |
| Rule Type           | Detection                                    |
| Finding Type        | GCP API key is created for a project         |
| Finding ID          | 60000737                                     |
| Generates a Finding | This detection rule also generates a finding |
| Severity            | Medium                                       |
| Category            | CONFIGURATION                                |
| Cloud Providers     | GCP                                          |
| Platform Module     | CSPM                                         |
| Asset Types         | GOOGLE\_API\_KEYS                            |

### Description

The creation of API keys for a project presents a security concern due to their public visibility and potential for unauthorized access, bypassing robust authentication mechanisms.

API keys, when used in a project, act as credentials for accessing various services. Unlike standard authentication flows that involve dynamic tokens and user context, API keys are static and can be embedded directly into client-side code or applications. This setup significantly increases the risk of the key being exposed through source code inspection, network traffic interception, or compromised client devices. An exposed API key can be leveraged by malicious actors to make unauthorized calls to associated APIs, potentially leading to data exfiltration or service abuse.

The misconfiguration of relying solely on API keys can result in significant financial penalties from unexpected service usage, data breaches, and reputational damage. An attacker with a compromised API key could impersonate the application or user, accessing sensitive data or consuming resources at the organization's expense. The best practice is to adopt stronger, more dynamic authentication methods to ensure credentials are not easily discoverable or reusable, limiting the attack surface.

To mitigate this risk, prioritize standard authentication flows such as OAuth 2.0, which provide secure token-based access without exposing long-lived secrets. If API keys are absolutely necessary for specific use cases, implement strict API restrictions, limiting their scope to only the required APIs and IP addresses. Additionally, enforce API key rotation policies and monitor their usage for any anomalous activity.

### Remediation

Use of API keys is generally considered as less secure authentication mechanism and should be avoided. A secure authentication mechanism should be used. Follow the below mentioned URL to evaluate an alternate, suitable authentication mechanism:

<https://cloud.google.com/endpoints/docs/openapi/authentication-method>

To delete an API Key:

1. Log in to google cloud console
2. Navigate to section 'Credentials', under 'APIs & Services'.
3. To delete API Key, go to 'API Keys' section, click the Actions button (three dots) in front of key name.
4. Click on ‘Delete API key’ button.
5. In the 'Delete credential' dialog, click 'DELETE' button.

Note: Deleting API keys might break dependent applications. It is recommended to thoroughly review and evaluate the impact of API key before deletion.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-api-key-is-created-for-a-project.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
