Skip to content

Commit d0225c3

Browse files
[Rule Tuning] Tuning 'Unusual Instance Metadata Service (IMDS) API Request' (#4169)
* tuning 'Unusual Instance Metadata Service (IMDS) API Request' * added missing bracket * linted * Update rules/linux/credential_access_unusual_instance_metadata_service_api_request.toml * removed intelephense whitelisting --------- Co-authored-by: Ruben Groenewoud <[email protected]>
1 parent 42f6c8f commit d0225c3

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

rules/linux/credential_access_unusual_instance_metadata_service_api_request.toml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
creation_date = "2024/08/22"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2024/08/28"
5+
updated_date = "2024/10/17"
66

77
[rule]
88
author = ["Elastic"]
99
description = """
1010
This rule identifies potentially malicious processes attempting to access the cloud service provider's instance metadata
11-
service (IMDS) API endpoint, which can be used to retrieve sensitive instance-specific information such as
12-
instance ID, public IP address, and even temporary security credentials if role's are assumed by that instance. The rule
13-
monitors for various tools and scripts like curl, wget, python, and perl that might be used to interact with the
14-
metadata API.
11+
service (IMDS) API endpoint, which can be used to retrieve sensitive instance-specific information such as instance ID,
12+
public IP address, and even temporary security credentials if role's are assumed by that instance. The rule monitors for
13+
various tools and scripts like curl, wget, python, and perl that might be used to interact with the metadata API.
1514
"""
1615
from = "now-9m"
1716
index = ["logs-endpoint.events.*"]
@@ -42,14 +41,26 @@ sequence by host.id, process.parent.entity_id with maxspan=1s
4241
"/etc/cron*", "/etc/update-motd.d/*", "/boot/*", "/srv/*", "/run/*", "/etc/rc.local"
4342
) or
4443
process.command_line: "*169.254.169.254*" and
45-
not process.working_directory: (
46-
"/opt/rapid7*",
47-
"/opt/nessus*",
48-
"/snap/amazon-ssm-agent*",
49-
"/srv/snp/docker/overlay2*",
50-
"/var/log/amazon/ssm*"
51-
)]
52-
[network where host.os.type == "linux" and event.action == "connection_attempted" and destination.ip == "169.254.169.254"]
44+
not (process.working_directory: (
45+
"/opt/rapid7*",
46+
"/opt/nessus*",
47+
"/snap/amazon-ssm-agent*",
48+
"/var/snap/amazon-ssm-agent/*",
49+
"/var/log/amazon/ssm/*",
50+
"/srv/snp/docker/overlay2*",
51+
"/opt/nessus_agent/var/nessus/*") or
52+
process.executable: (
53+
"/opt/rumble/bin/rumble-agent*",
54+
"/opt/aws/inspector/bin/inspectorssmplugin") or
55+
process.parent.executable: (
56+
"/usr/bin/setup-policy-routes",
57+
"/usr/share/ec2-instance-connect/*",
58+
"/var/lib/amazon/ssm/*")
59+
)
60+
]
61+
[network where host.os.type == "linux"
62+
and event.action == "connection_attempted"
63+
and destination.ip == "169.254.169.254"]
5364
'''
5465

5566

0 commit comments

Comments
 (0)