TMAegis
更多 macos 规则

TMA-MACOS-2.2.2

Ensure Firewall Stealth Mode Is Enabled

高级别 1自动化macos

说明

While in Stealth mode, the computer will not respond to unsolicited probes, dropping that traffic. Audit: Passes when EnableStealthMode is true in a profile or socketfilterfw reports stealth mode on.

检查方式

审计方法: Shell 命令

shell
[ -x /usr/bin/osascript ] || exit 1
p=$(/usr/bin/osascript -l JavaScript <<'EOS'
$.NSUserDefaults.alloc.initWithSuiteName('com.apple.security.firewall').objectForKey('EnableStealthMode').js
EOS
)
s=$(/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode 2>/dev/null)
if [ "$p" = true ] || printf '%s' "$s" | /usr/bin/grep -q 'stealth mode is on'; then echo compliant; else echo "EnableStealthMode=${p:-unset}; $s"; fi
预期输出
compliant

修复方式

修复方法: 操作指南或基础设施补丁

Profile (preferred): com.apple.security.firewall EnableStealthMode = <true/>. Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on. GUI: System Settings > Network > Firewall > Options > Set Enabled stealth mode to enabled.

属性

操作系统
macos-26
标签
macossystem-settings
参考
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 2.2.2 Ensure Firewall Stealth Mode Is Enabled

检查本机

请在您有权审计的机器上运行此命令。扫描为只读操作。

shell
tmaegis scan --target macos