Information
DVD or CD Sharing allows users to remotely access the system's optical drive. While Apple does not ship Macs with built-in optical drives any longer, external optical drives are still recognized when they are connected. In testing the sharing of an external optical drive persists when a drive is reconnected.
Rationale:
Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data.
Impact:
Many Apple devices are now sold without optical drives and drive sharing may be needed for legacy optical media. The media should be explicitly re-shared as needed rather than using a persistent share. Necessary data from optical drives should be copied or images so that the original optical drives are for long term storage only.
Solution
Perform the following to disable DVD or CD sharing:
Graphical Method:
Open System Preferences
Select Sharing
Uncheck DVD or CD sharing
Terminal Method:
Run the following command to disable DVD or CD sharing:
$ sudo launchctl disable system/com.apple.ODSAgent
Note: If using the Terminal method, the GUI will still show the service checked until after a reboot.