id: system_settings_media_sharing_disabled
title: Disable Media Sharing
discussion: |
  Media sharing _MUST_ be disabled.

  When Media Sharing is enabled, the computer starts a network listening service that shares the contents of the user's music collection with other users in the same subnet.

  The information system _MUST_ be configured to provide only essential capabilities. Disabling Media Sharing helps prevent the unauthorized connection of devices and the unauthorized transfer of information. Disabling Media Sharing mitigates this risk.
check: |
  /usr/bin/osascript -l JavaScript << EOS
  function run() {
    let pref1 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess')\
  .objectForKey('allowMediaSharing'))
    let pref2 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess')\
  .objectForKey('allowMediaSharingModification'))
    if ( pref1 == false && pref2 == false ) {
      return("true")
    } else {
      return("false")
    }
  }
  EOS
result:
  string: 'true'
fix: |
  This is implemented by a Configuration Profile.
references:
  cce:
    - CCE-95388-5
  cci:
    - CCI-000213
  800-53r5:
    - AC-3
    - AC-17
  800-53r4:
    - AC-3
  srg:
    - SRG-OS-000080-GPOS-00048
  disa_stig:
    - APPL-26-002100
  800-171r3:
    - 03.01.02
    - 03.04.06
  cis:
    benchmark:
      - 2.3.3.9 (level 2)
    controls v8:
      - 4.1
      - 4.8
  cmmc:
    - AC.L1-3.1.1
  bio:
    - 8.27.01
macOS:
  - '26.0'
tags:
  - 800-53r5_low
  - 800-53r5_moderate
  - 800-53r5_high
  - 800-53r4_low
  - 800-53r4_moderate
  - 800-53r4_high
  - 800-171
  - cis_lvl2
  - cisv8
  - cnssi-1253_low
  - cnssi-1253_high
  - cmmc_lvl2
  - cmmc_lvl1
  - stig
  - cnssi-1253_moderate
  - nlmapgov_plus
severity: medium
mobileconfig: true
mobileconfig_info:
  com.apple.applicationaccess:
    allowMediaSharing: false
    allowMediaSharingModification: false
