Skip to content

Commit 14e7189

Browse files
committed
Update macos_list_firewall_rules.yml
1 parent f8eac47 commit 14e7189

File tree

1 file changed

+70
-37
lines changed

1 file changed

+70
-37
lines changed

detections/endpoint/macos_list_firewall_rules.yml

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,81 @@ date: '2025-09-08'
55
author: Jamie Windley, Splunk
66
status: production
77
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
914
data_source:
1015
- 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\
18-
\ Processes.dest Processes.process Processes.process_hash Processes.process_id Processes.process_name\
19-
\ Processes.process_path Processes.user Processes.vendor_product \n| `drop_dm_object_name(Processes)`\
20-
\ \n| `security_content_ctime(firstTime)` \n| `security_content_ctime(lastTime)`\n\
21-
| `macos_list_firewall_rules_filter`\n | `macos_list_firewall_rules_filter`"
22-
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
25+
min(_time) as firstTime
26+
max(_time) as lastTime
27+
28+
from datamodel=Endpoint.Processes where
29+
(
30+
Processes.process_name = "defaults"
31+
Processes.process = "* read *",
32+
Processes.process = "*/Library/Preferences/com.apple.alf*"
33+
)
34+
OR
35+
(
36+
Processes.process_name = "socketfilterfw"
37+
Processes.process = "*--getglobalstate*"
38+
)
39+
40+
by Processes.action Processes.dest Processes.process Processes.process_hash
41+
Processes.process_id Processes.process_name Processes.process_path
42+
Processes.user Processes.vendor_product
43+
44+
| `drop_dm_object_name(Processes)`
45+
| `security_content_ctime(firstTime)`
46+
| `security_content_ctime(lastTime)`
47+
| `macos_list_firewall_rules_filter`
48+
how_to_implement: |
49+
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
2555
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$",
32-
"$dest$") starthoursago=168 | stats count min(_time)
33-
as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message)
34-
as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all)
35-
as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics"
36-
by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
37-
earliest_offset: $info_min_time$
38-
latest_offset: $info_max_time$
56+
- name: View the detection results for - "$user$" and "$dest$"
57+
search: '%original_detection_search% | search user = "$user$" AND dest = "$dest$"'
58+
earliest_offset: $info_min_time$
59+
latest_offset: $info_max_time$
60+
- name: View risk events for the last 7 days for - "$user$" and "$dest$"
61+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$",
62+
"$dest$") starthoursago=168 | stats count min(_time)
63+
as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message)
64+
as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all)
65+
as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics"
66+
by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
67+
earliest_offset: $info_min_time$
68+
latest_offset: $info_max_time$
3969
rba:
4070
message: MacOS firewall rules listed
4171
risk_objects:
42-
- field: dest
43-
type: system
44-
score: 6
45-
- field: user
46-
type: user
47-
score: 6
48-
threat_objects: []
72+
- field: dest
73+
type: system
74+
score: 6
75+
- field: user
76+
type: user
77+
score: 6
78+
threat_objects:
79+
- field: parent_process_name
80+
type: parent_process_name
81+
- field: process_name
82+
type: process_name
4983
tags:
5084
analytic_story:
5185
- Network Discovery
@@ -57,10 +91,9 @@ tags:
5791
- Splunk Enterprise Security
5892
- Splunk Cloud
5993
security_domain: endpoint
60-
cve: []
6194
tests:
6295
- name: True Positive Test
6396
attack_data:
6497
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1016/atomic_red_team/macos_net_discovery/macos_network_discovery.log
6598
sourcetype: osquery:results
66-
source: local_vm
99+
source: osquery

0 commit comments

Comments
 (0)