Disable Internet Sharing on macOS to prevent endpoints from acting as network routers or hotspots
This Automox Worklet™ disables the Internet Sharing feature on macOS endpoints. Internet Sharing allows a Mac to share its network connection with other endpoints via Wi-Fi, Bluetooth, Ethernet, or other interfaces, effectively turning the endpoint into a network router or hotspot.
The Worklet modifies the NAT configuration in com.apple.nat preferences to disable network address translation, which is the underlying technology that enables connection sharing.
apple.nat".
Internet Sharing creates a secondary network that may bypass corporate security controls including firewalls, web filters, and monitoring systems. Endpoints connecting through a shared connection appear to originate from the Mac rather than their actual source, complicating security logging and incident response.
An enabled Internet Sharing configuration could allow unauthorized endpoints to connect to your corporate network through an employee's endpoint. This creates both security and compliance risks, particularly in regulated environments.
Users who enable Wi-Fi hotspots using Internet Sharing may inadvertently expose network resources to nearby attackers. Disabling this feature eliminates the possibility of unauthorized hotspot creation on managed endpoints.
Evaluation phase: The Worklet reads the NAT configuration from /Library/Preferences/SystemConfiguration/com.apple.nat and checks the Enabled flag. If the value contains 1, Internet Sharing is enabled and the endpoint is flagged for remediation.
Remediation phase: The Worklet uses defaults write to set the NAT Enabled value to 0 in the system configuration preferences. This disables Internet Sharing and stops any active connection sharing immediately.
macOS endpoint (workstation or server)
Validated on macOS Monterey, Big Sur, and Apple Silicon (M1) systems
Administrative privileges for modifying system configuration
After running, Internet Sharing is disabled and any endpoints currently connected through the shared connection are disconnected. The endpoint can no longer act as a network router or Wi-Fi hotspot.
You can verify the setting in System Preferences > Sharing, where the Internet Sharing checkbox should be unchecked. The endpoint continues to use its own network connection normally but cannot share it with other endpoints.
Run this Worklet on a pilot macOS endpoint and review evaluation output for disable internet 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.
Validate remediation effects from script operations such as defaults, exit, then rerun evaluation for compliance.
For technical validation, compare endpoint state to the Worklet evaluation logic and remediation flow for disable internet 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 and remediation operations such as defaults, exit. Use these indicators to verify that endpoint changes match intended policy outcomes.
For technical validation, compare endpoint state to the Worklet evaluation logic and remediation flow for disable internet 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 and remediation operations such as defaults, 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