mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
rules[refactor] Updated check/fix for nfsd
This commit is contained in:
@@ -3,13 +3,19 @@ title: Disable Network File System Service
|
||||
discussion: |
|
||||
Support for Network File Systems (NFS) services is non-essential and, therefore, _MUST_ be disabled.
|
||||
check: |
|
||||
/bin/launchctl print-disabled system | /usr/bin/grep -c '"com.apple.nfsd" => disabled'
|
||||
isDisabled=$(/sbin/nfsd status | /usr/bin/awk '/nfsd service/ {print $NF}')
|
||||
if [[ "$isDisabled" == "disabled" ]] && [[ -z $(/usr/bin/pgrep nfsd) ]]; then
|
||||
echo "pass"
|
||||
else
|
||||
echo "fail"
|
||||
fi
|
||||
result:
|
||||
integer: 1
|
||||
string: "pass"
|
||||
fix: |
|
||||
[source,bash]
|
||||
----
|
||||
/bin/launchctl disable system/com.apple.nfsd
|
||||
/bin/rm -rf /etc/exports
|
||||
----
|
||||
The system may need to be restarted for the update to take effect.
|
||||
references:
|
||||
|
||||
Reference in New Issue
Block a user