Google Workspace Drive Encryption Key(s) Accessed from Anonymous User
Detects when an anonymous user views, copies, or downloads a private key or credential file from Google Drive via an anyone-with-the-link share. Adversaries who obtain or create open Drive links can harvest encryption keys and secrets stored in user drives, then use those materials to decrypt data, authenticate to services, or expand access beyond the initial compromise.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/03/21"
3integration = ["google_workspace"]
4maturity = "production"
5updated_date = "2026/09/18"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects when an anonymous user views, copies, or downloads a private key or credential file from Google Drive via an
11anyone-with-the-link share. Adversaries who obtain or create open Drive links can harvest encryption keys and secrets
12stored in user drives, then use those materials to decrypt data, authenticate to services, or expand access beyond the
13initial compromise.
14"""
15false_positives = [
16 """
17 A user may generate a shared access link to encryption key files to share with others. It is unlikely that the
18 intended recipient is an external or anonymous user.
19 """,
20]
21from = "now-130m"
22index = ["filebeat-*", "logs-google_workspace.drive-*"]
23interval = "10m"
24language = "eql"
25license = "Elastic License v2"
26name = "Google Workspace Drive Encryption Key(s) Accessed from Anonymous User"
27note = """## Triage and analysis
28
29### Investigating Google Workspace Drive Encryption Key(s) Accessed from Anonymous User
30
31Threat actors and opportunistic scanners frequently abuse Google Drive links set to "Anyone with the link" to access
32sensitive files without authenticating. Private keys, keystores, and token files stored in user drives are high-value
33targets. Possession of these files can enable decryption of protected data, signing or impersonation, and lateral
34movement into systems that trust the exposed material.
35
36This rule uses EQL to detect `view`, `copy`, or `download` activity in `google_workspace.drive` where
37`google_workspace.drive.visibility` is `people_with_link`, `source.user.email` is empty (anonymous access), and
38`file.extension` matches common key or credential file types.
39
40### Possible investigation steps
41
42- Identify the file accessed by reviewing `file.name` and `google_workspace.drive.file.type`, and note `event.action` (`view`, `copy`, or `download`) and `event.ingested`.
43- Identify the file owner by reviewing `google_workspace.drive.file.owner.email` and determine whether that user should store key material in Drive.
44- Review `source.user.id` and any available IP or user-agent context in the raw event to characterize the anonymous accessor.
45- Confirm sharing posture in Google Drive:
46 - Open the file in Drive as an administrator or the owner and review Share settings.
47 - Verify whether access is "Anyone with the link" and whether the link was intentionally published or may have been exposed after account compromise.
48- Search Kibana for related Drive activity for the same file or owner:
data_stream.dataset: "google_workspace.drive" and google_workspace.drive.file.owner.email: "<OWNER_EMAIL>" and file.name: "<FILE_NAME>"
1- Look for earlier `change_user_access`, `change_document_visibility`, or `rename` events that may indicate when the link was opened.
2- Search for other key-like files owned by the same user with `people_with_link` visibility.
3- Determine blast radius — identify which systems, applications, or cloud resources the key protects (VPN, TLS, code signing, service accounts, encrypted archives).
4- Contact the file owner and security stakeholders to confirm whether anonymous access was expected (for example, a documented external audit). Treat unexpected access as high priority.
5
6### False positive analysis
7
8- Legitimate use of link-based sharing for key files is rare; validate business justification before closing as benign.
9- Automated scanners or DLP tools may touch public links — correlate with known security tooling and owner intent.
10
11### Response and remediation
12
13- Initiate the incident response process based on triage findings.
14- Revoke the open link or restrict sharing to specific users; move key material out of broadly link-shared locations.
15- If access is unauthorized, rotate or replace the exposed keys and review dependent systems for abuse.
16- Review the file owner's account for signs of compromise (unusual logins, OAuth grants, or mass sharing changes).
17
18## Setup
19
20The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
21
22### Important Information Regarding Google Workspace Event Lag Times
23- 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.
24- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
25- 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.
26- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
27- See the following references for further information:
28- https://support.google.com/a/answer/7061566
29- https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
30references = [
31 "https://support.google.com/drive/answer/2494822",
32 "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
33 "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
34]
35risk_score = 73
36rule_id = "980b70a0-c820-11ed-8799-f661ea17fbcc"
37severity = "high"
38tags = [
39 "Domain: Cloud",
40 "Data Source: Google Workspace",
41 "Use Case: Configuration Audit",
42 "Tactic: Credential Access",
43 "Tactic: Collection",
44 "Resources: Investigation Guide",
45 "Noise: Low",
46 "Performance: Normal",
47 "Rule Type: Event Correlation (EQL)",
48 "Platform: Google Workspace",
49 "Domain: SaaS",
50]
51timestamp_override = "event.ingested"
52type = "eql"
53
54query = '''
55file where data_stream.dataset == "google_workspace.drive" and event.action : ("copy", "view", "download") and
56 google_workspace.drive.visibility: "people_with_link" and source.user.email == "" and
57 file.extension: (
58 "token","assig", "pssc", "keystore", "pub", "pgp.asc", "ps1xml", "pem", "gpg.sig", "der", "key",
59 "p7r", "p12", "asc", "jks", "p7b", "signature", "gpg", "pgp.sig", "sst", "pgp", "gpgz", "pfx", "crt",
60 "p8", "sig", "pkcs7", "jceks", "pkcs8", "psc1", "p7c", "csr", "cer", "spc", "ps2xml")
61'''
62
63[rule.investigation_fields]
64field_names = [
65 "source.user.id",
66 "event.action",
67 "file.name",
68 "google_workspace.drive.file.type",
69 "google_workspace.drive.file.owner.email",
70]
71
72[[rule.threat]]
73framework = "MITRE ATT&CK"
74
75[[rule.threat.technique]]
76id = "T1552"
77name = "Unsecured Credentials"
78reference = "https://attack.mitre.org/techniques/T1552/"
79
80[[rule.threat.technique.subtechnique]]
81id = "T1552.004"
82name = "Private Keys"
83reference = "https://attack.mitre.org/techniques/T1552/004/"
84
85[rule.threat.tactic]
86id = "TA0006"
87name = "Credential Access"
88reference = "https://attack.mitre.org/tactics/TA0006/"
89
90[[rule.threat]]
91framework = "MITRE ATT&CK"
92
93[[rule.threat.technique]]
94id = "T1530"
95name = "Data from Cloud Storage"
96reference = "https://attack.mitre.org/techniques/T1530/"
97
98[rule.threat.tactic]
99id = "TA0009"
100name = "Collection"
101reference = "https://attack.mitre.org/tactics/TA0009/"
Triage and analysis
Investigating Google Workspace Drive Encryption Key(s) Accessed from Anonymous User
Threat actors and opportunistic scanners frequently abuse Google Drive links set to "Anyone with the link" to access sensitive files without authenticating. Private keys, keystores, and token files stored in user drives are high-value targets. Possession of these files can enable decryption of protected data, signing or impersonation, and lateral movement into systems that trust the exposed material.
This rule uses EQL to detect view, copy, or download activity in google_workspace.drive where
google_workspace.drive.visibility is people_with_link, source.user.email is empty (anonymous access), and
file.extension matches common key or credential file types.
Possible investigation steps
- Identify the file accessed by reviewing
file.nameandgoogle_workspace.drive.file.type, and noteevent.action(view,copy, ordownload) andevent.ingested. - Identify the file owner by reviewing
google_workspace.drive.file.owner.emailand determine whether that user should store key material in Drive. - Review
source.user.idand any available IP or user-agent context in the raw event to characterize the anonymous accessor. - Confirm sharing posture in Google Drive:
- Open the file in Drive as an administrator or the owner and review Share settings.
- Verify whether access is "Anyone with the link" and whether the link was intentionally published or may have been exposed after account compromise.
- Search Kibana for related Drive activity for the same file or owner:
1data_stream.dataset: "google_workspace.drive" and google_workspace.drive.file.owner.email: "<OWNER_EMAIL>" and file.name: "<FILE_NAME>"- Look for earlier
change_user_access,change_document_visibility, orrenameevents that may indicate when the link was opened. - Search for other key-like files owned by the same user with
people_with_linkvisibility.
- Look for earlier
- Determine blast radius — identify which systems, applications, or cloud resources the key protects (VPN, TLS, code signing, service accounts, encrypted archives).
- Contact the file owner and security stakeholders to confirm whether anonymous access was expected (for example, a documented external audit). Treat unexpected access as high priority.
False positive analysis
- Legitimate use of link-based sharing for key files is rare; validate business justification before closing as benign.
- Automated scanners or DLP tools may touch public links — correlate with known security tooling and owner intent.
Response and remediation
- Initiate the incident response process based on triage findings.
- Revoke the open link or restrict sharing to specific users; move key material out of broadly link-shared locations.
- If access is unauthorized, rotate or replace the exposed keys and review dependent systems for abuse.
- Review the file owner's account for signs of compromise (unusual logins, OAuth grants, or mass sharing changes).
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.intervalis 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:
References
Related rules
- Domain Added to Google Workspace Trusted Domains
- Google Workspace MFA Enforcement Disabled For Organization
- Google Workspace Restrictions for Marketplace Modified to Allow Any App
- Application Added to Google Workspace Domain
- Application Removed from Blocklist in Google Workspace