id: system_settings_location_services_disable
title: Disable Location Services
discussion: |
  Location Services _MUST_ be disabled.

  The information system _MUST_ be configured to provide only essential capabilities.  Disabling Location Services helps prevent the unauthorized connection of devices, unauthorized transfer of information, and unauthorized tunneling.
check: |
  /usr/bin/sudo -u _locationd /usr/bin/osascript -l JavaScript << EOS
  $.NSUserDefaults.alloc.initWithSuiteName('com.apple.locationd')\
  .objectForKey('LocationServicesEnabled').js
  EOS
result:
  string: 'false'
fix: |
  [source,bash]
  ----
  /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -bool false; 
  pid=$(/bin/launchctl print system | /usr/bin/awk '/\tcom.apple.locationd/ {print $1}')
  kill -9 $pid
  ----
references:
  cce:
    - CCE-95383-6
  cci:
    - CCI-000381
  800-53r5:
    - CM-7
    - CM-7(1)
    - SC-7(10)
  800-53r4:
    - CM-7
    - CM-7(1)
  srg:
    - SRG-OS-000095-GPOS-00049
  disa_stig:
    - APPL-26-002004
  800-171r3:
    - 03.04.06
  cmmc:
    - CM.L2-3.4.6
    - CM.L2-3.4.7
macOS:
  - '26.0'
tags:
  - 800-53r5_low
  - 800-53r5_moderate
  - 800-53r5_high
  - 800-53r4_low
  - 800-53r4_moderate
  - 800-53r4_high
  - 800-171
  - cnssi-1253_low
  - cnssi-1253_high
  - cmmc_lvl2
  - stig
  - cnssi-1253_moderate
severity: medium
mobileconfig: false
mobileconfig_info:
