id: os_nfsd_disable
title: Disable Network File System Service
discussion: |
  Support for Network File Systems (NFS) services is non-essential and, therefore, _MUST_ be disabled.
check: |
  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:
  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:
  cce:
    - CCE-94235-9
  cci:
    - CCI-000213
  800-53r5:
    - AC-3
    - AC-17
  800-53r4:
    - AC-3
  srg:
    - SRG-OS-000080-GPOS-00048
  disa_stig:
    - APPL-15-002003
  800-171r3:
    - 03.01.02
    - 03.04.06
  cis:
    benchmark:
      - 4.3 (level 1)
    controls v8:
      - 4.1
      - 4.8
  cmmc:
    - AC.L1-3.1.1
  bio:
    - 8.27.01
macOS:
  - '15.0'
tags:
  - 800-53r5_low
  - 800-53r5_moderate
  - 800-53r5_high
  - 800-53r4_low
  - 800-53r4_moderate
  - 800-53r4_high
  - 800-171
  - cis_lvl1
  - cis_lvl2
  - cisv8
  - cnssi-1253_low
  - cnssi-1253_high
  - cmmc_lvl2
  - cmmc_lvl1
  - stig
  - cnssi-1253_moderate
  - nlmapgov_plus
severity: medium
mobileconfig: false
mobileconfig_info:
