Disable DVD and CD sharing on macOS to prevent remote optical drive access by unauthorized users
This Automox Worklet™ disables the DVD and CD sharing service on macOS endpoints. DVD/CD sharing allows other computers on the network to access the optical drive remotely, which was designed for Macs without built-in optical drives to share drives with Macs that have them.
The Worklet disables the com.apple.ODSAgent service using launchctl, preventing remote access to the optical drive while leaving local DVD/CD use unaffected.
DVD and CD sharing services allow remote macOS systems to access optical drives over the network. Attackers who compromise one endpoint can use this feature to mount optical drives from other endpoints, potentially accessing sensitive data stored on physical media or exploiting the sharing service for lateral movement within your network.
Organizations that prohibit unauthorized network file sharing should disable DVD/CD sharing as part of their endpoint security configuration. Even though optical drives are less common in modern endpoints, legacy systems may still have this service enabled by default, creating an unnecessary attack vector for network-based exploitation.
Disabling unused network services reduces your attack surface and simplifies endpoint security management. Endpoints with DVD/CD sharing disabled present fewer targets for network reconnaissance and reduce the complexity of firewall rules needed to protect your macOS fleet.
Evaluation phase: The Worklet runs launchctl print-disabled system and searches for the com.apple.ODSAgent service in the disabled state. If the service is not marked as disabled (true), the endpoint is flagged for remediation.
Remediation phase: The Worklet executes launchctl disable system/com.apple.ODSAgent to disable the DVD/CD sharing service. The GUI in System Preferences may still show the checkbox as selected until after a reboot, but the service is immediately disabled.
macOS endpoint (workstation or server)
Administrative privileges for modifying launchd services
Reboot may be required for GUI to reflect the change in System Preferences
After remediation, macOS endpoints no longer advertise DVD or CD sharing services on the network. Remote systems cannot access the endpoint's optical drive even if one is connected. The local user can still use optical drives normally for their own purposes.
The Worklet confirms successful remediation through its evaluation check. You can verify DVD/CD sharing is disabled by reviewing System Preferences or checking Worklet execution results in the Automox console.
Run this Worklet on a pilot macOS endpoint and review evaluation output for disable dvd/cd sharing.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as exit, else.
Validate remediation effects from script operations such as launchctl, else, exit, then rerun evaluation for compliance.
For technical validation, compare endpoint state to the Worklet evaluation logic and remediation flow for disable dvd/cd sharing. This supports repeatable security workflows, faster change control review, and auditable compliance evidence.
Useful script references for this Worklet include evaluation operations such as exit, else and remediation operations such as launchctl, else, exit. Use these indicators to verify that endpoint changes match intended policy outcomes.


By submitting this form you agree to our Master Services Agreement and Privacy Policy.
Already have an account? Log in
Consider Worklets your easy button
A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

AUTOMOX + WORKLETS™
Uncover new possibilities with simple, powerful automation.
By submitting this form you agree to our Master Services Agreement and Privacy Policy