GCP IAM Service Account Key Deletion

Identifies the deletion of an Identity and Access Management (IAM) service account key in Google Cloud Platform (GCP). Each service account is associated with two sets of public/private RSA key pairs that are used to authenticate. If a key is deleted, the application will no longer be able to access Google Cloud resources using that key. A security best practice is to rotate your service account keys regularly.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/09/21"
 3integration = ["gcp"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/06/22"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies the deletion of an Identity and Access Management (IAM) service account key in Google Cloud Platform (GCP).
13Each service account is associated with two sets of public/private RSA key pairs that are used to authenticate. If a key
14is deleted, the application will no longer be able to access Google Cloud resources using that key. A security best
15practice is to rotate your service account keys regularly.
16"""
17false_positives = [
18    """
19    Service account key deletions may be done by a system or network administrator. Verify whether the user email,
20    resource name, and/or hostname should be making changes in your environment. Key deletions by unfamiliar users or
21    hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
22    """,
23]
24index = ["filebeat-*", "logs-gcp*"]
25language = "kuery"
26license = "Elastic License v2"
27name = "GCP IAM Service Account Key Deletion"
28note = """## Setup
29
30The GCP Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
31references = [
32    "https://cloud.google.com/iam/docs/service-accounts",
33    "https://cloud.google.com/iam/docs/creating-managing-service-account-keys",
34]
35risk_score = 21
36rule_id = "9890ee61-d061-403d-9bf6-64934c51f638"
37severity = "low"
38tags = ["Domain: Cloud", "Data Source: GCP", "Data Source: Google Cloud Platform", "Use Case: Identity and Access Audit", "Tactic: Persistence"]
39timestamp_override = "event.ingested"
40type = "query"
41
42query = '''
43event.dataset:gcp.audit and event.action:google.iam.admin.v*.DeleteServiceAccountKey and event.outcome:success
44'''
45
46
47[[rule.threat]]
48framework = "MITRE ATT&CK"
49[[rule.threat.technique]]
50id = "T1098"
51name = "Account Manipulation"
52reference = "https://attack.mitre.org/techniques/T1098/"
53
54
55[rule.threat.tactic]
56id = "TA0003"
57name = "Persistence"
58reference = "https://attack.mitre.org/tactics/TA0003/"

Setup

The GCP Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.

References

Related rules

to-top