TMAegisBeta
更多 macos 規則

macOS

TMA-MACOS15-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-15
標籤
macossystem-settings
參考資料
CIS Apple macOS 15.0 Sequoia Benchmark v2.1.0 - 2.2.2 Ensure Firewall Stealth Mode Is Enabled

檢查此主機

請在您有權稽核的機器上執行此指令。掃描為唯讀操作。

shell
tmaegis scan --target macos