You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: detections/endpoint/macos_list_firewall_rules.yml
+70-37Lines changed: 70 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -5,47 +5,81 @@ date: '2025-09-08'
5
5
author: Jamie Windley, Splunk
6
6
status: production
7
7
type: Anomaly
8
-
description: This analytic detects attempts to enumerate or verify the configuration of the macOS application firewall. Specifically, it monitors executions of `defaults read /Library/Preferences/com.apple.alf` and `/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate`. These commands provide insight into firewall status, allowed applications, and explicit authorization rules. While they are legitimate administrative operations, adversaries may leverage them to identify potential attack surfaces, determine whether the firewall is active, or enumerate allowed network flows. Monitoring for these commands, particularly when executed by non-administrative users or at unusual times, can provide early indication of reconnaissance activity on macOS endpoints
8
+
description: |
9
+
This analytic detects attempts to enumerate or verify the configuration of the macOS application firewall.
10
+
Specifically, it monitors executions of `defaults read /Library/Preferences/com.apple.alf` and `/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate`.
11
+
These commands provide insight into firewall status, allowed applications, and explicit authorization rules.
12
+
While they are legitimate administrative operations, adversaries may leverage them to identify potential attack surfaces, determine whether the firewall is active, or enumerate allowed network flows.
13
+
Monitoring for these commands, particularly when executed by non-administrative users or at unusual times, can provide early indication of reconnaissance activity on macOS endpoints
9
14
data_source:
10
15
- osquery
11
-
search: "| tstats `security_content_summariesonly` values(Processes.process) as process\
12
-
\ values(Processes.parent_process) AS parent_process values(Processes.parent_process_exec)\
13
-
\ AS parent_process_exec values(Processes.parent_process_id) AS parent_process_id\
14
-
\ values(Processes.parent_process_name) AS parent_process_name values(Processes.parent_process_path)\
15
-
\ AS parent_process_path min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes\
16
-
\ where Processes.process IN (\"*defaults read /Library/Preferences/com.apple.alf*\"\
17
-
\ \"*/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate*\") by Processes.action\
how_to_implement: Collection of process execution events from macOS endpoints is required. This can be achieved using osquery’s `es_process_events` table, EndpointSecurity framework integrations, or an EDR platform capable of recording process command lines. Ensure that captured events include at least the process path, full command line, user context, and timestamp.
23
-
known_false_positives: These commands are frequently executed by system administrators or IT personnel during routine configuration checks, troubleshooting, or automated maintenance scripts. Security tools or monitoring agents may also query firewall status for inventory or compliance purposes. To reduce false positives, consider excluding events from known administrative accounts, trusted management systems, or scheduled maintenance jobs.
24
-
references: []
16
+
search: |
17
+
| tstats `security_content_summariesonly`
18
+
count
19
+
values(Processes.process) as process
20
+
values(Processes.parent_process) AS parent_process
21
+
values(Processes.parent_process_exec) AS parent_process_exec
22
+
values(Processes.parent_process_id) AS parent_process_id
23
+
values(Processes.parent_process_name) AS parent_process_name
24
+
values(Processes.parent_process_path) AS parent_process_path
Collection of process execution events from macOS endpoints is required. This can be achieved using osquery's `es_process_events` table, EndpointSecurity framework integrations, or an EDR platform capable of recording process command lines. Ensure that captured events include at least the process path, full command line, user context, and timestamp.
50
+
known_false_positives: |
51
+
These commands are frequently executed by system administrators or IT personnel during routine configuration checks, troubleshooting, or automated maintenance scripts. Security tools or monitoring agents may also query firewall status for inventory or compliance purposes. To reduce false positives, consider excluding events from known administrative accounts, trusted management systems, or scheduled maintenance jobs.
52
+
references:
53
+
- https://www.manpagez.com/man/8/socketfilterfw/
54
+
- https://ss64.com/mac/defaults.html
25
55
drilldown_searches:
26
-
- name: View the detection results for - "$user$" and "$dest$"
27
-
search: '%original_detection_search% | search user = "$user$" AND dest = "$dest$"'
28
-
earliest_offset: $info_min_time$
29
-
latest_offset: $info_max_time$
30
-
- name: View risk events for the last 7 days for - "$user$" and "$dest$"
31
-
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$",
0 commit comments