Prevent end users from disabling or disconnecting a Packet Tunnel VPN on macOS

Hi,

My enterprise VPN application uses a Packet Tunnel Network Extension (NEPacketTunnelProvider) on macOS.

Currently, macOS displays the VPN configuration under System Settings → VPN → My VPN. End users can manually disconnect the VPN using the toggle provided by macOS.

For enterprise security and compliance requirements, we would like to prevent end users from manually disconnecting or disabling the VPN through macOS System Settings. The VPN connection should be controlled exclusively by our application or enterprise administrator policies.

I have the following questions:

  1. Is there an MDM configuration or restriction that prevents end users from manually disconnecting the Packet Tunnel VPN?
  2. Is there any supported Network Extension API that allows the VPN application to disable or restrict the VPN toggle in System Settings?
  3. If such functionality is available, does it require the macOS device to be MDM-managed or supervised?
  4. If neither option is supported, is there any Apple-recommended approach to enforce a mandatory VPN connection on macOS using a custom Packet Tunnel Network Extension?

Our primary objective is to prevent user-initiated VPN disconnection, rather than simply preventing the removal of the VPN configuration or automatically reconnecting after disconnection.

Any guidance or relevant Apple documentation would be appreciated.

Thanks!

Answered by DTS Engineer in 919820022

I can answer the API side of this:

  1. Is there any supported Network Extension API that allows the VPN application to disable or restrict the VPN toggle in System Settings?

No.

I can’t really help you from the MDM perspective. It’s possible that someone else might chime in here but, if not, my advice is that you reach out to Apple Support.

Having said all that, my experience is that most folks who ask questions like this are working at the wrong layer. We see this a lot on iOS, which is why one of my erstwhile colleagues wrote TN3120 Expected use cases for Network Extension packet tunnel providers.

So, you might be better off with a content filter or a transparent proxy. Or if you’re primarily concerned about specific apps and websites, go with per-app VPN.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I can answer the API side of this:

  1. Is there any supported Network Extension API that allows the VPN application to disable or restrict the VPN toggle in System Settings?

No.

I can’t really help you from the MDM perspective. It’s possible that someone else might chime in here but, if not, my advice is that you reach out to Apple Support.

Having said all that, my experience is that most folks who ask questions like this are working at the wrong layer. We see this a lot on iOS, which is why one of my erstwhile colleagues wrote TN3120 Expected use cases for Network Extension packet tunnel providers.

So, you might be better off with a content filter or a transparent proxy. Or if you’re primarily concerned about specific apps and websites, go with per-app VPN.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"