/
defense_evasion_google_workspace_new_oauth_login_from_third_party_application.toml
96 lines (83 loc) · 3.61 KB
/
defense_evasion_google_workspace_new_oauth_login_from_third_party_application.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
[metadata]
creation_date = "2023/03/30"
integration = ["google_workspace"]
maturity = "production"
updated_date = "2024/05/21"
[rule]
author = ["Elastic"]
description = """
Detects the first time a third-party application logs in and authenticated with OAuth. OAuth is used to grant
permissions to specific resources and services in Google Workspace. Compromised credentials or service accounts could
allow an adversary to authenticate to Google Workspace as a valid user and inherit their privileges.
"""
false_positives = [
"""
Developers may leverage third-party applications for legitimate purposes in Google Workspace such as for
administrative tasks.
""",
]
from = "now-130m"
index = ["filebeat-*", "logs-google_workspace*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "First Time Seen Google Workspace OAuth Login from Third-Party Application"
note = """## Setup
The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
### Important Information Regarding Google Workspace Event Lag Times
- As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
- To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
- See the following references for further information:
- https://support.google.com/a/answer/7061566
- https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
references = [
"https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
"https://developers.google.com/apps-script/guides/bound",
"https://developers.google.com/identity/protocols/oauth2",
]
risk_score = 47
rule_id = "21bafdf0-cf17-11ed-bd57-f661ea17fbcc"
severity = "medium"
tags = ["Domain: Cloud", "Data Source: Google Workspace", "Tactic: Defense Evasion", "Tactic: Initial Access"]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
event.dataset: "google_workspace.token" and event.action: "authorize" and
google_workspace.token.scope.data.scope_name: *Login and google_workspace.token.client.id: *apps.googleusercontent.com
'''
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"
[[rule.threat.technique.subtechnique]]
id = "T1550.001"
name = "Application Access Token"
reference = "https://attack.mitre.org/techniques/T1550/001/"
[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"
[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"
[rule.new_terms]
field = "new_terms_fields"
value = ["google_workspace.token.client.id"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-15d"