id: system_settings_location_services_enable
title: Enable Location Services
discussion: |
  Location Services _MUST_ be enabled.
references:
  nist:
    cce:
      macos_27:
        - CCE-XXXXX-X
      macos_26:
        - CCE-95384-4
      macos_15:
        - CCE-94377-9
      macos_14:
        - CCE-92973-7
  cis:
    benchmark:
      macos_26:
        - 2.6.1.1 (level 2)
      macos_15:
        - 2.6.1.1 (level 2)
      macos_14:
        - 2.6.1.1 (level 2)
    controls_v8:
      - 4.1
      - 4.8
platforms:
  macOS:
    '27.0': {}
    '26.0':
      benchmarks:
        - name: cis_lvl2
      enforcement_info:
        fix:
          shell: |-
            /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -bool true;
            pid=$(/bin/launchctl print system | /usr/bin/awk '/\tcom.apple.locationd/ {print $1}')
            kill -9 $pid
    '15.0':
      benchmarks:
        - name: cis_lvl2
    enforcement_info:
      check:
        shell: |-
          /usr/bin/sudo -u _locationd /usr/bin/osascript -l JavaScript << EOS
          $.NSUserDefaults.alloc.initWithSuiteName('com.apple.locationd')\
          .objectForKey('LocationServicesEnabled').js
          EOS
        result:
          string: 'true'
      fix:
        shell: |-
          /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -bool true;
          pid=$(/bin/launchctl list | /usr/bin/awk '/com.apple.locationd/ { print $1 }')
          kill -9 $pid
tags:
  - cisv8
