Disable Bluetooth on macOS endpoints when no peripherals are connected to reduce attack surface
This Automox Worklet™ checks whether any Bluetooth endpoints are actively connected to the macOS endpoint and disables the Bluetooth radio if no endpoints are in use. The Worklet uses system_profiler to count connected Bluetooth peripherals and reads the ControllerPowerState from Bluetooth preferences to determine the current radio status.
When Bluetooth is enabled but no endpoints are connected, the Worklet writes a new power state to disable the radio and terminates the bluetoothd process to apply the change immediately.
apple.Bluetooth".
Bluetooth is susceptible to various attacks including BlueBorne, KNOB, and BIAS vulnerabilities that allow remote code execution, man-in-the-middle attacks, and unauthorized endpoint pairing. An enabled Bluetooth radio presents an attack surface even when no endpoints are paired.
Endpoints that do not actively use Bluetooth peripherals have no legitimate need for an enabled radio. Disabling Bluetooth on these systems eliminates the wireless attack vector without impacting user productivity.
Security frameworks including CIS Benchmarks recommend disabling Bluetooth when not required. This Worklet provides automated compliance with this control while accommodating users who rely on Bluetooth keyboards, mice, or headsets.
Evaluation phase: The Worklet queries system_profiler SPBluetoothDataType to count endpoints with "Connected: Yes" status. It also reads ControllerPowerState from /Library/Preferences/com.apple.Bluetooth to check if the radio is powered on. If Bluetooth is disabled or endpoints are connected, the endpoint is compliant. If Bluetooth is enabled with no connected endpoints, remediation is triggered.
Remediation phase: The Worklet uses defaults write to set ControllerPowerState to 0 (disabled) in the Bluetooth preferences. It then executes killall -9 bluetoothd to terminate the Bluetooth daemon and apply the new power state immediately without requiring a restart.
macOS endpoint (workstation or server)
Administrative privileges for modifying Bluetooth preferences and terminating system processes
No active Bluetooth endpoint connections at the time of remediation
After running on endpoints without connected endpoints, the Bluetooth radio is disabled. The Bluetooth menu bar icon (if visible) shows the disabled state. Users can manually re-enable Bluetooth through System Preferences if they connect a Bluetooth endpoint. You can verify this change through the Automox Activity Log or by checking the endpoint configuration directly.
Endpoints with connected Bluetooth endpoints remain unchanged. Users relying on Bluetooth peripherals experience no disruption. Schedule this Worklet to run periodically to catch endpoints where users have disabled but later re-enabled Bluetooth without connecting endpoints.
Run this Worklet on a pilot macOS endpoint and review evaluation output for disable bluetooth.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as exit, elif, else.
Validate remediation effects from script operations such as set, elif, else, then rerun evaluation for compliance.
For technical validation, compare endpoint state to the Worklet evaluation logic and remediation flow for disable bluetooth. 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, elif, else and remediation operations such as set, elif, else. 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