Skip to content

Commit cd3401a

Browse files
committed
[Rule Tuning] Potential Network Scan Detected
1 parent a9bdfaa commit cd3401a

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

rules/network/discovery_potential_port_scan_detected.toml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22
creation_date = "2023/05/17"
33
integration = ["network_traffic", "panw"]
44
maturity = "production"
5-
updated_date = "2025/02/28"
5+
updated_date = "2025/12/17"
66

77
[rule]
88
author = ["Elastic"]
99
description = """
10-
This rule identifies a potential port scan. A port scan is a method utilized by attackers to systematically scan a
11-
target system or network for open ports, allowing them to identify available services and potential vulnerabilities. By
12-
mapping out the open ports, attackers can gather critical information to plan and execute targeted attacks, gaining
13-
unauthorized access, compromising security, and potentially leading to data breaches, unauthorized control, or further
14-
exploitation of the targeted system or network. This rule defines a threshold-based approach to detect connection
15-
attempts from a single source to a wide range of destination ports.
10+
This rule identifies a potential port scan from an internal IP address. A port scan is a method utilized by attackers to
11+
systematically scan a target system for open ports, allowing them to identify available services and potential
12+
vulnerabilities. By mapping out the open ports, attackers can gather critical information to plan and execute targeted
13+
attacks, gaining unauthorized access, compromising security, and potentially leading to data breaches, unauthorized
14+
control, or further exploitation of the targeted system. This rule defines a threshold-based approach to detect
15+
connection attempts from a single internal source to a wide range of destination ports on a single destination.
1616
"""
1717
from = "now-9m"
18-
index = ["logs-network_traffic.*", "packetbeat-*", "filebeat-*", "logs-panw.panos*"]
19-
language = "kuery"
18+
language = "esql"
2019
license = "Elastic License v2"
21-
max_signals = 5
2220
name = "Potential Network Scan Detected"
2321
risk_score = 21
2422
rule_id = "0171f283-ade7-4f87-9521-ac346c68cc9b"
@@ -32,10 +30,19 @@ tags = [
3230
"Resources: Investigation Guide"
3331
]
3432
timestamp_override = "event.ingested"
35-
type = "threshold"
33+
type = "esql"
3634

3735
query = '''
38-
event.action:network_flow and destination.port:* and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)
36+
from logs-network_traffic.*, packetbeat-*, filebeat-*, logs-panw.panos*
37+
| mv_expand event.action
38+
| where event.action == "network_flow" and destination.port is not null and source.ip is not null and destination.ip is not null
39+
| where CIDR_MATCH(source.ip, "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16")
40+
| stats
41+
Esql.count_distinct_destination_ports = COUNT_DISTINCT(destination.port),
42+
Esql.values_destination_ports = VALUES(destination.port)
43+
by destination.ip, source.ip
44+
| where Esql.count_distinct_destination_ports >= 250
45+
| keep source.ip, destination.ip, Esql.*
3946
'''
4047
note = """## Triage and analysis
4148
@@ -103,11 +110,3 @@ reference = "https://attack.mitre.org/techniques/T1595/001/"
103110
id = "TA0043"
104111
name = "Reconnaissance"
105112
reference = "https://attack.mitre.org/tactics/TA0043/"
106-
107-
[rule.threshold]
108-
field = ["destination.ip", "source.ip"]
109-
value = 1
110-
111-
[[rule.threshold.cardinality]]
112-
field = "destination.port"
113-
value = 250

0 commit comments

Comments
 (0)