TMAegis
Thêm quy tắc cho macos

TMA-MACOS-2.2.1

Ensure Firewall Is Enabled

CaoCấp 1Tự độngmacos

Mô tả

A firewall is a piece of software that blocks unwanted incoming connections to a system. The socketfilter Firewall is what is used when the Firewall is turned on in the Security & Privacy Preference Pane. Logging is required to appropriately monitor what access is allowed and denied. The logs can be viewed in the macOS Unified Logs. Audit: Passes when the com.apple.security.firewall EnableFirewall key is true or socketfilterfw reports State = 1 or 2.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
[ -x /usr/bin/osascript ] || exit 1
p=$(/usr/bin/osascript -l JavaScript <<'EOS'
$.NSUserDefaults.alloc.initWithSuiteName('com.apple.security.firewall').objectForKey('EnableFirewall').js
EOS
)
s=$(/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate 2>/dev/null)
if [ "$p" = true ] || printf '%s' "$s" | /usr/bin/grep -qE 'State = [12]'; then echo compliant; else echo "EnableFirewall=${p:-unset}; $s"; fi
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Profile (preferred): com.apple.security.firewall EnableFirewall = <true/>. Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on. GUI: System Settings > Network > Firewall > Set Firewall to enabled.

Thuộc tính

Hệ điều hành
macos-26
Thẻ
macossystem-settings
Tham chiếu
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 2.2.1 Ensure Firewall Is Enabled

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target macos