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