From 2e3c27f643c89586972fb39925829ea1bf907fa2 Mon Sep 17 00:00:00 2001
From: Tim H <6026716+tho@users.noreply.github.com>
Date: Tue, 26 Feb 2019 11:40:29 -0500
Subject: [PATCH] Add catch-all VPN On Demand Rule (#739)
If a user is not connected to a trusted Wi-Fi network or if the
URLStringProbe fails none of the existing dictionaries match.
According to the Apple Configuration Profile Reference[1] section "VPN
Payload > On Demand Rules Dictionary Keys" a default behavior for
unknown networks with no matching criteria should always be set as the
last dictionary in the array. The current default behavior is to allow a
connection to occur, but this behavior is not guaranteed.
Tear down the VPN connection and do not reconnect on demand as long as
the catch-all dictionary matches to guarantee the default behavior and
more specifically allow users to access captive portals.
[1]: https://developer.apple.com/library/content/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html
---
roles/vpn/templates/mobileconfig.j2 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/roles/vpn/templates/mobileconfig.j2 b/roles/vpn/templates/mobileconfig.j2
index b48500c2..686ed7e8 100644
--- a/roles/vpn/templates/mobileconfig.j2
+++ b/roles/vpn/templates/mobileconfig.j2
@@ -52,6 +52,10 @@
URLStringProbe
http://captive.apple.com/hotspot-detect.html
+
+ Action
+ Disconnect
+
{% else %}
{% endif %}