TMAegisBeta
更多 macos 規則

macOS

TMA-MACOS-2.3.3.7

Ensure Internet Sharing Is Disabled

高等級 1自動化macos

說明

Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices. Audit: Passes when com.apple.nat has no "Enabled = 1" entry or a profile sets forceInternetSharingOff.

檢查方式

稽核方法: Shell 指令

shell
[ -x /usr/bin/defaults ] || exit 1
f=$(/usr/bin/osascript -l JavaScript <<'EOS'
$.NSUserDefaults.alloc.initWithSuiteName('com.apple.MCX').objectForKey('forceInternetSharingOff').js
EOS
)
n=$(/usr/bin/defaults read /Library/Preferences/SystemConfiguration/com.apple.nat 2>/dev/null | /usr/bin/grep -c "Enabled = 1;")
if [ "$f" = true ] || [ "${n:-0}" -eq 0 ]; then echo compliant; else echo "Internet Sharing enabled"; fi
預期輸出
compliant

修補方式

修補方法: 操作指南或基礎設施修補檔

Profile (preferred): com.apple.MCX forceInternetSharingOff = <true/>. Terminal: usr/bin/sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0. GUI: System Settings > General > Sharing > Set Internet Sharing to disabled.

屬性

作業系統
macos-26
標籤
macossystem-settings
參考資料
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 2.3.3.7 Ensure Internet Sharing Is Disabled

檢查此主機

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

shell
tmaegis scan --target macos