> 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-user-managed-service-account-keys-are-not-rotated-for-90-days.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP User managed service account keys are not rotated for 90 days

### Synopsis

| Field               | Value                                                             |
| ------------------- | ----------------------------------------------------------------- |
| Rule Type           | Detection                                                         |
| Finding Type        | GCP User managed service account keys are not rotated for 90 days |
| Finding ID          | 60000153                                                          |
| Generates a Finding | This detection rule also generates a finding                      |
| Severity            | Low                                                               |
| Category            | CONFIGURATION                                                     |
| Cloud Providers     | GCP                                                               |
| Platform Module     | CSPM                                                              |
| Asset Types         | GOOGLE\_CLOUD\_IAM\_SERVICE\_ACCOUNT\_KEY                         |
| ATT\&CK Tactic      | TA0006 (TA0006)                                                   |
| ATT\&CK Technique   | T1552 (T1552)                                                     |

### Description

Google Cloud Platform (GCP) user-managed service account keys older than 90 days pose a significant security risk. These keys, if compromised, allow unauthorized access to resources even after an employee leaves or credentials are stolen.

User-managed service accounts provide access to GCP resources. Failure to rotate keys regularly leaves a large attack window. A compromised or leaked key, even an old one, could be used for malicious activities such as data exfiltration, unauthorized resource modification, or even complete account takeover.

The impact of unrotated keys can be severe, resulting in data breaches, service disruptions, and regulatory non-compliance. Regular key rotation significantly reduces the likelihood of successful attacks by limiting the timeframe a compromised key remains active. This best practice ensures that even if a key is compromised, its validity is short-lived.

To mitigate this risk, implement automated key rotation for all user-managed service accounts. Configure a schedule that rotates keys at least every 90 days. Use the GCP console or command-line tools to enforce this rotation policy. Regular audits should verify the policy's effectiveness and identify any accounts lacking proper rotation.

### Remediation

**Manual steps:**

Google Cloud IAM Service Account Key - Manual remediation steps:

To fix this alert, delete the old key which is older than 90 or more days, and Create a new key for that particular service account. To delete user-managed Service Account Key older than 90 days:

1. Login to GCP Portal
2. Go to APIs & Services (Left Panel)
3. Select 'Credentials' and Under section 'Service Accounts', select the service account for which we need to delete the key
4. On the page 'Service account details' select the tab 'KEYS'
5. Click on the delete icon for the listed key after confirming the creation date is older than 90

To Create a new user-managed Service Account Key for a Service Account:

1. Login to GCP Portal
2. Go to APIs & Services (Left Panel)
3. Select 'Credentials' and Under the section 'Service Accounts', select the service account for which we need a key
4. On the page 'Service account details' select the tab 'KEYS'
5. Under 'ADD KEY' dropdown, select 'Create new key'
6. Select desired key type format among JSON or P12
7. Click on CREATE button, It will download the private key. Keep it safe.
8. Click on CLOSE if promptedIt will redirect to the APIs & Services Credentials page. Make a note of the New ID displayed in the section Service account keys with the new creation date.

NOTE: Rotating the service account key might break communication for depending applications. Dependent applications need to configure manually with a new key id.


---

# 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-user-managed-service-account-keys-are-not-rotated-for-90-days.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.
