TMAegisBeta
更多 macos 规则

macOS

TMA-MACOS14-4.3

Ensure NFS Server Is Disabled

中级别 1自动化macos

说明

macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end-user computer. The etc/exports file contains the list of NFS shared directories. If the file exists, it is likely that NFS sharing has been enabled in the past or may be available periodically. As an additional check, the audit verifies that there is no /etc/exports file. File serving should not be done from a user desktop. Dedicated servers should be used. Open ports make it easier to exploit the computer.

检查方式

审计方法: Shell 命令

shell
s=$(/sbin/nfsd status 2>/dev/null | /usr/bin/awk '/nfsd service/ { print $NF }') || exit 1
if [ "$s" = disabled ] && [ ! -e /etc/exports ]; then echo compliant; else echo "nfsd=${s:-unknown}; /etc/exports present or service enabled"; fi
预期输出
compliant

修复方式

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

Terminal Method: Run the following command to disable the nfsd fileserver services: % /usr/bin/sudo /bin/launchctl disable system/com.apple.nfsd Remove the exported Directory listing. % /usr/bin/sudo /bin/rm -rf /etc/exports Note: Removing /etc/exports also stops the NFS service if it was running.

属性

操作系统
macos-14
标签
macossonoma
参考
CIS Apple macOS 14.0 Sonoma Benchmark v3.1.0 - 4.3 Ensure NFS Server Is Disabled

检查本机

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

shell
tmaegis scan --target macos