> [!NOTE]
> Premium and Enterprise (Deprecated) [service tiers](https://docs.cloud.google.com/security-command-center/docs/service-tiers.md.txt)

> [!CAUTION]
> The Security Command Center Enterprise service tier will shut down on May 21, 2027. If your organization uses the Enterprise service tier, then the organization will automatically move to the Premium service tier on or after May 21, 2027. Contact your account representative or a [Google Cloud sales specialist](https://cloud.google.com/contact) if you have questions.

This document describes a threat finding type in Security Command Center. Threat findings are generated by
[threat detectors](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources.md.txt#threats) when they detect
a potential threat in your cloud resources. For a full list of available threat findings, see [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).

## Overview

A dormant [user-managed service
account](https://docs.cloud.google.com/iam/docs/service-account-types#user-managed) key was created. In this context, a service account is
considered dormant if it has been inactive for more than 180 days.

[Event Threat Detection](https://docs.cloud.google.com/security-command-center/docs/concepts-event-threat-detection-overview.md.txt) is the source of
this finding.

## How to respond

To respond to this finding, do the following:

### Step 1: Review finding details

1. Open the `Initial Access: Dormant Service Account Key Created` finding, as directed in [Reviewing findings](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats.md.txt#reviewing_findings).
2. In the finding details, on the **Summary** tab, note the values of
   following fields.

   Under **What was detected**:
   - **Principal email**: the user who created the service account key

   Under **Affected resource**:
   - **Resource display name**: the newly created dormant service account key
   - **Project full name**: the project where that dormant service account resides

### Step 2: Research attack and response methods

1. Use [service account
   tools](https://docs.cloud.google.com/policy-intelligence/docs/service-account-usage-tools), like [Activity
   Analyzer](https://docs.cloud.google.com/policy-intelligence/docs/activity-analyzer-service-account-authentication), to investigate the activity of the dormant service account.
2. Contact the owner of the **Principal email** field. Confirm whether the legitimate owner conducted the action.

### Step 3: Implement your response


The following response plan might be appropriate for this finding, but might also impact operations.
Carefully evaluate the information you gather in your investigation to determine the best way to
resolve findings.

- Contact the owner of the project where the action was taken.
- Remove the access of the owner of the **Principal email** if it is compromised.
- Invalidate the newly created service account key in the [Service Accounts Page](https://console.cloud.google.com/iam-admin/serviceaccounts).
- Consider [deleting the potentially compromised service account](https://docs.cloud.google.com/iam/docs/service-accounts-delete-undelete.md.txt#deleting) and rotate and delete all service account access keys for the potentially compromised project. After deletion, applications that use the service account for authentication lose access. Before proceeding, your security team should identify all impacted applications and work with application owners to ensure business continuity.
- Work with your security team to identify unfamiliar resources, including Compute Engine instances, snapshots, service accounts, and IAM users. Delete resources not created with authorized accounts.
- Respond to any notifications from Cloud Customer Care.
- To limit who can create service accounts, use the [Organization Policy Service](https://docs.cloud.google.com/resource-manager/docs/organization-policy/overview).
- To identify and fix overly permissive roles, use [IAM
  recommender](https://docs.cloud.google.com/iam/docs/recommender-overview).

## Example finding JSON

The following is an example of the finding JSON.

```json
{
 "findings": {
   "access": {
     "principalEmail": "PRINCIPAL_EMAIL",
     "callerIp": "IP_ADDRESS",
     "callerIpGeo": {
        "regionCode": "US"
      },
     "serviceName": "iam.googleapis.com",
     "methodName": "google.iam.admin.v1.CreateServiceAccountKey"
   },
   "assetDisplayName": "ASSET_DISPLAY_NAME",
   "assetId": "organizations/ORGANIZATION_NUMBER/assets/ASSET_ID",
   "canonicalName": "projects/PROJECT_NUMBER/sources/SOURCE_ID/findings/FINDING_ID",
   "category": "Initial Access: Dormant Service Account Key Created",
   "contacts": {
     "security": {
       "contacts": [
         {
           "email": "EMAIL_ADDRESS"
         },
         {
           "email": "EMAIL_ADDRESS"
         },
         {
           "email": "EMAIL_ADDRESS"
         }
       ]
     },
     "technical": {
       "contacts": [
         {
           "email": "EMAIL_ADDRESS"
         },
         {
           "email": "EMAIL_ADDRESS"
         },
         {
           "email": "EMAIL_ADDRESS"
         }
       ]
     }
   },
   "createTime": "2023-01-12T10:35:47.381Z",
   "database": {},
   "eventTime": "2023-01-12T10:35:47.270Z",
   "exfiltration": {},
   "findingClass": "THREAT",
   "findingProviderId": "organizations/ORGANIZATION_NUMBER/firstPartyFindingProviders/etd",
   "indicator": {},
   "kernelRootkit": {},
   "kubernetes": {},
   "mitreAttack": {
    "primaryTactic": "INITIAL_ACCESS",
    "primaryTechniques": [
      "VALID_ACCOUNTS",
      "CLOUD_ACCOUNTS"
      ]
   },
   "mute": "UNDEFINED",
   "name": "organizations/ORGANIZATION_NUMBER/sources/SOURCE_ID/findings/FINDING_ID",
   "parent": "organizations/ORGANIZATION_NUMBER/sources/SOURCE_ID",
   "parentDisplayName": "Event Threat Detection",
   "resourceName": "//iam.googleapis.com/projects/PROJECT_ID/serviceAccounts/DORMANT_SERVICE_ACCOUNT_ID/keys/SERVICE_ACCOUNT_KEY_ID",
   "severity": "HIGH",
   "sourceDisplayName": "Event Threat Detection",
   "state": "ACTIVE",
   "vulnerability": {},
   "workflowState": "NEW"
 },
 "resource": {
   "name": "//iam.googleapis.com/projects/PROJECT_ID/serviceAccounts/DORMANT_SERVICE_ACCOUNT_ID/keys/SERVICE_ACCOUNT_KEY_ID",
   "display_name": "projects/PROJECT_ID/serviceAccounts/DORMANT_SERVICE_ACCOUNT_EMAIL/keys/SERVICE_ACCOUNT_KEY_ID",
   "project_name": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
   "project_display_name": "PROJECT_ID",
   "parent_name": "//iam.googleapis.com/projects/PROJECT_ID/serviceAccounts/DORMANT_SERVICE_ACCOUNT_ID",
   "parent_display_name": "projects/PROJECT_ID/serviceAccounts/DORMANT_SERVICE_ACCOUNT_EMAIL",
   "type": "google.iam.ServiceAccountKey",
   "folders": [
     {
       "resourceFolderDisplayName": "FOLDER_NAME",
       "resourceFolder": "//cloudresourcemanager.googleapis.com/folders/FOLDER_NUMBER"
     }
   ]
 },
 "sourceProperties": {
   "sourceId": {
     "projectNumber": "PROJECT_NUMBER",
     "customerOrganizationNumber": "ORGANIZATION_NUMBER"
   },
   "detectionCategory": {
     "ruleName": "key_created_on_dormant_sa"
   },
   "detectionPriority": "HIGH",
   "affectedResources": [
     {
       "gcpResourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER"
     }
   ],
   "evidence": [
     {
       "sourceLogId": {
         "projectId": "PROJECT_ID",
         "resourceContainer": "projects/PROJECT_ID",
         "timestamp": {
           "seconds": "1673519681",
           "nanos": 728289000
         },
         "insertId": "INSERT_ID"
       }
     }
   ],
   "properties": {},
   "findingId": "FINDING_ID",
   "contextUris": {
     "mitreUri": {
       "displayName": "MITRE Link",
       "url": "https://attack.mitre.org/tactics/TA0003/"
     }
   }
 }
}
```

## What's next

- Learn [how to work with threat
  findings in Security Command Center](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats).
- Refer to the [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).
- Learn how to [review a
  finding](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats#reviewing_findings) through the Google Cloud console.
- Learn about the [services that
  generate threat findings](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources#threats).