Implementing Microsoft Tunnel for MAM
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 10 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Implementing Microsoft Tunnel for MAM: A Comprehensive Guide
Introduction: Bridging the Gap Between Security and Accessibility
In the modern enterprise environment, the perimeter has dissolved. Employees no longer work exclusively from behind a corporate firewall; they operate from coffee shops, home offices, and transit hubs, often using mobile devices that hold sensitive company data. While Mobile Application Management (MAM) allows organizations to secure corporate data within specific applications without requiring full device enrollment, a significant challenge remains: how do these managed applications access on-premises resources that are not exposed to the public internet?
This is where Microsoft Tunnel for Mobile Application Management (MAM) comes into play. Microsoft Tunnel provides a secure, encrypted gateway that allows applications managed by Intune to access internal corporate resources—such as private web servers, internal APIs, or file shares—without requiring the device to be fully enrolled in a Mobile Device Management (MDM) solution. This capability is particularly critical for organizations supporting "Bring Your Own Device" (BYOD) scenarios, where users want access to work resources but are justifiably hesitant to grant the company full administrative control over their personal phones.
By implementing Microsoft Tunnel for MAM, you provide a path for your mobile apps to reach internal data while maintaining the strict privacy boundaries required for personal devices. This lesson will walk you through the architecture, deployment, configuration, and maintenance of the Microsoft Tunnel solution, ensuring you have the knowledge to deploy this gateway effectively and securely.
Not read yet
Understanding the Architecture of Microsoft Tunnel
To effectively implement Microsoft Tunnel, you must first understand how the components interact. At its core, the Microsoft Tunnel gateway is a Linux-based containerized application that runs on a server within your corporate network. It acts as a secure proxy between your mobile applications and your internal network resources.
The Core Components
- The Microsoft Tunnel Gateway: This is the server-side component. It is a Linux machine (typically running on Ubuntu or RHEL) that hosts the Docker-based tunnel gateway. It sits in your internal network and maintains a connection to the Microsoft Intune service.
- The Intune Service: This acts as the management plane. You define the configuration profiles in the Intune admin center, which are then pushed to the Gateway server and the mobile clients.
- The MAM-Enabled Application: These are the client-side apps, such as Microsoft Edge, Outlook, or custom line-of-business (LOB) apps, that have the Intune App SDK integrated. When the app attempts to reach an internal URL, the SDK intercepts the request and routes it through the Tunnel gateway.
Callout: MDM vs. MAM Tunneling It is important to distinguish between Tunnel for MDM and Tunnel for MAM. Tunnel for MDM requires the device to be enrolled in Intune, allowing the entire device's network traffic (or specific app traffic) to be routed through the gateway. Tunnel for MAM is designed specifically for unmanaged (personal) devices. It creates a secure tunnel only for the specific managed applications, ensuring that personal traffic on the device remains completely private and untouched by the corporate gateway.
Not read yet
Prerequisites for Deployment
Before you begin the technical implementation, you must ensure your environment meets specific requirements. Skipping these will lead to connection failures that are notoriously difficult to debug later.
Infrastructure Requirements
- Operating System: A supported Linux distribution, primarily Ubuntu 20.04/22.04 LTS or RHEL 8.x/9.x.
- Networking: The server must have access to the public internet to communicate with Intune, and it must have access to the internal resources you intend to expose.
- Public IP/DNS: You need a public-facing IP address and a corresponding DNS name (e.g.,
tunnel.yourcompany.com) that points to your gateway server. - SSL/TLS Certificates: You must have a publicly trusted SSL certificate for the gateway's public endpoint. Self-signed certificates are not supported for production deployments.
Intune Configuration Requirements
- Intune License: You or your organization must have the Microsoft Intune Suite or the standalone Intune add-on licenses.
- Role-Based Access Control: You need Global Administrator or Intune Administrator permissions to create the Tunnel configuration profiles.
Note: Ensure your firewall rules are configured to allow inbound traffic on port 443 from the internet to your gateway server. Additionally, ensure the gateway server can reach your internal resources on the ports required (e.g., 80, 443, or custom ports for internal APIs).
Not read yet
Step-by-Step Implementation Guide
Implementing Microsoft Tunnel is a multi-stage process involving server preparation, gateway installation, and Intune policy configuration.
Phase 1: Preparing the Gateway Server
Start by provisioning a Linux server. A standard virtual machine with 2 vCPUs and 4GB of RAM is usually sufficient for entry-level deployments, but you should scale based on expected concurrent connection volume.
- Update the OS: Ensure all packages are up to date.
- Install Docker: Microsoft Tunnel runs inside Docker. Install the community edition of Docker on your server.
- Verify Networking: Confirm the server can resolve internal hostnames and reach the specific internal services that mobile apps will need to access.
Phase 2: Installing the Tunnel Gateway
Once the server is ready, you will use the Microsoft-provided installation script to set up the gateway.
- Download the
mstunnel-setupscript from the Microsoft Intune portal. - Run the script with elevated privileges:
sudo ./mstunnel-setup. - The script will prompt you for your Intune tenant credentials. Authenticate when prompted.
- Follow the prompts to select your network interface and configure the server's public-facing address.
- The script will automatically pull the necessary Docker images and configure the gateway service.
Phase 3: Configuring the Intune Admin Center
After the server is live and registered, you must tell Intune how to use it.
- Create a Tunnel Configuration: Navigate to Endpoint Security > VPN > Microsoft Tunnel Gateway. Create a new configuration.
- Define Site Settings: You must create a "Site" that groups your gateway servers. Assign your server to a site.
- Create the MAM Tunnel Profile: Navigate to Apps > App configuration policies. Select "Managed apps" as the platform. Choose the applications you want to enable (e.g., Microsoft Edge).
- Configure Connection Settings: In the policy, select "Microsoft Tunnel" as the connection type. Link this to the site you created in step 2.
Tip: When defining the "Server URL" in your configuration, always use the Fully Qualified Domain Name (FQDN) rather than an IP address. This makes it easier to update certificates or migrate to a new server in the future without breaking existing client configurations.
Not read yet
Advanced Configuration and Site Management
A single server is a single point of failure. In a production environment, you should always deploy multiple servers behind a load balancer.
Load Balancing the Tunnel
Microsoft Tunnel supports high availability by allowing you to register multiple servers under the same "Site." You can place these servers behind a standard Layer 4 load balancer (like F5 BIG-IP, Citrix ADC, or an Azure Load Balancer).
- Load Balancer Configuration: Configure the load balancer to perform health checks on the gateway. The gateway exposes a health check endpoint that you can query to ensure the service is responsive.
- Persistence: Ensure your load balancer is configured to handle long-lived TCP connections, as the tunnel protocol maintains a persistent state.
Managing Internal DNS
One of the most common hurdles is DNS resolution. When a mobile app tries to reach internal.company.local, it needs to resolve that name to an internal IP.
- Split-Brain DNS: You can configure the Tunnel gateway to act as a DNS forwarder. In the Intune Tunnel configuration, you can specify DNS suffixes. When the mobile app requests a domain ending in those suffixes, the request is sent through the tunnel to the internal DNS server rather than being resolved by the mobile device's carrier network.
Not read yet
Best Practices for Security and Performance
Securing your tunnel gateway is as critical as securing your primary corporate infrastructure. Because this server has a foot in both the public internet and your private network, it is a high-value target.
1. Hardening the Linux Host
- Minimal Install: Only install the packages required for the tunnel service and Docker. Remove unnecessary software like compilers, debuggers, or web servers that aren't part of the gateway function.
- SSH Access: Disable root SSH login and use SSH keys rather than passwords. If possible, restrict SSH access to a specific management subnet or a jump box.
- Firewalling: Use
iptablesorufwto restrict inbound traffic to only port 443 (the tunnel port) and your management port (e.g., 22).
2. Monitoring and Logging
- Log Forwarding: Use a log aggregator (like Azure Monitor, Splunk, or ELK) to ingest logs from the gateway. Monitoring for authentication failures and unauthorized connection attempts is essential.
- Health Alerts: Configure alerts in the Intune portal for "Gateway Disconnected" events. If a server goes offline, you need to know immediately to prevent user productivity loss.
3. Certificate Management
- Renewal Automation: Ensure your SSL certificates are monitored for expiration. Manually updating certificates on multiple gateway servers is error-prone. Use tools like
certbotif you are using Let's Encrypt, or integrate your certificate management system with the Linux host.
Warning: Never store production private keys in insecure locations on the server. Ensure that the file permissions for your certificate files are set to
600or400so only the root user can read them.
Not read yet
Comparison of Connectivity Methods
To understand why Microsoft Tunnel is preferred for MAM, it helps to compare it against other common connectivity methods.
| Feature | Microsoft Tunnel for MAM | Per-App VPN (MDM) | Always-On VPN |
|---|---|---|---|
| Enrollment Required | No | Yes | Yes |
| Privacy | High (App-specific) | Medium (Device-wide) | Low (All traffic) |
| Ease of Setup | Moderate | Moderate | Complex |
| Platform Support | iOS/Android | iOS/Android | Desktop/Mobile |
| Resource Access | Internal Web/API | Full Network | Full Network |
As shown in the table, Microsoft Tunnel for MAM offers the best balance for BYOD scenarios. It provides the necessary access to corporate data while respecting the user's privacy by not touching their personal app data or internet browsing history.
Troubleshooting Common Pitfalls
Even with a perfect setup, you will eventually encounter issues. Being prepared to troubleshoot is what separates a junior administrator from an expert.
Issue 1: Apps Cannot Reach Internal Resources
- Check DNS: The most common cause is that the mobile device cannot resolve the internal hostname. Verify that the "DNS Suffixes" are correctly configured in the Intune Tunnel profile.
- Check Firewall: Use
tcpdumpornmapfrom the gateway server to see if the server itself can reach the internal resource. If the server cannot reach the resource, the mobile app certainly cannot. - Check Certificates: If the SSL handshake fails, the app will refuse to connect. Use a tool like
openssl s_client -connect <your-tunnel-fqdn>:443to verify the certificate chain from a client machine.
Issue 2: Gateway Server Shows "Disconnected" in Intune
- Network Interruption: Check if the server's public IP changed or if the firewall is blocking the outbound connection to the Intune service.
- Docker Service: Sometimes the Docker daemon crashes or fails to restart after a server reboot. Check the status with
systemctl status docker. - Time Synchronization: Ensure your server is using NTP. If the server clock drifts significantly from the Intune service clock, authentication tokens will fail, and the gateway will disconnect.
Issue 3: High Latency for Users
- Geographic Proximity: If your users are in Europe but your gateway is in a US-based datacenter, latency will be high. Consider deploying regional gateway sites.
- MTU Issues: Sometimes, the Maximum Transmission Unit (MTU) size causes packet fragmentation over the tunnel. You may need to adjust the MTU settings in the gateway configuration to accommodate your specific network environment.
Callout: The Importance of Logging When troubleshooting, the
mstunnellog files are your best friend. They are located in/var/log/microsoft/mstunnel/. When opening a support ticket with Microsoft, always include the output of the support script, which can be generated by runningmstunnel-supporton the gateway server. This script bundles all relevant logs and configuration files, saving hours of back-and-forth communication.
Not read yet
Implementing Security Policies for Tunnel Access
Simply having the tunnel is not enough; you must also define who is allowed to use it. This is handled through Intune's Conditional Access policies.
Integrating with Conditional Access
You should create a Conditional Access policy that requires specific conditions before granting access to the resources behind the tunnel.
- User Assignment: Target the policy to the group of users who need access to internal apps.
- Cloud Apps: Select the internal resources or the managed applications that utilize the tunnel.
- Conditions: You might require "Managed Apps" or "App Protection Policies" to be in place.
- Grant Controls: Require a "compliant" device or "approved client app" (MAM-enabled).
By linking the Tunnel usage to Conditional Access, you ensure that even if a user manages to install the managed app, they cannot access the internal data unless their device satisfies your organization's security posture (e.g., the app is up to date, the user has passed Multi-Factor Authentication, etc.).
Not read yet
Best Practices for Ongoing Maintenance
Maintenance is not a one-time event. A secure gateway requires a lifecycle management plan.
1. Patch Management
- Linux Updates: Set up a schedule to apply security patches to the underlying OS. Use a tool like
unattended-upgradesto automatically handle security-critical updates. - Gateway Updates: Microsoft frequently releases updates to the Tunnel gateway software. Keep track of the release notes. When an update is available, follow the documented upgrade path to ensure you are running the latest version with the most recent security fixes.
2. Capacity Planning
- Monitoring Trends: Watch the CPU and memory usage on your gateway servers. As you onboard more users or add more applications, you may find that you need to scale up your VM resources or add more nodes to your site.
- Session Limits: Be aware of the connection limits for a single gateway instance. While the software is designed to be high-performance, there is a physical limit to the number of concurrent TLS connections a single server can manage before performance degrades.
3. Disaster Recovery
- Configuration Backups: While the configuration is stored in Intune, keep a record of your server-side configurations (like custom network settings or firewall rules).
- Site Redundancy: Always have at least two servers in a site. If one server fails, the load balancer should automatically route traffic to the healthy node, and the Intune service will continue to manage the remaining gateway.
Not read yet
Key Takeaways for Implementing Microsoft Tunnel
As you wrap up this module, keep these core principles at the forefront of your deployment strategy:
- Privacy First: Microsoft Tunnel for MAM is the premier solution for BYOD environments because it maintains a strict separation between personal and work data, ensuring user privacy while meeting corporate security needs.
- Infrastructure Matters: The gateway server is the foundation of your connectivity. Invest time in hardening the Linux host, ensuring robust network connectivity, and implementing a proper high-availability strategy with load balancers.
- Complexity is in the Details: Most implementation issues stem from DNS resolution, certificate mismatches, or firewall misconfigurations. Validate these three areas first when troubleshooting.
- Security is Integrated: Do not treat the tunnel as an isolated component. Integrate it with your Conditional Access policies to ensure that only authorized users on compliant, protected applications can traverse the gateway.
- Lifecycle Management: Treat your gateway servers as production infrastructure. This means having a plan for patching, monitoring, log analysis, and certificate renewal. Neglecting these areas will eventually lead to service disruptions.
- Use the Tools: Microsoft provides excellent diagnostic scripts (
mstunnel-support). Always use them to gather data before attempting manual deep-dives into logs; they are designed to catch the most common configuration errors automatically. - Scalability: Start with a pilot group to validate your network and application behavior before rolling out to the entire organization. Monitor performance metrics during this phase to determine your long-term scaling requirements.
By following these guidelines, you will be able to implement a robust, secure, and user-friendly mobile connectivity solution that empowers your employees to work from anywhere without compromising your organization's security posture. Remember, the goal is to make the technology "disappear" for the end-user—they should simply open their app and find their work data available, while the heavy lifting of encryption, routing, and policy enforcement happens silently in the background.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Choosing Device Join Types
- Choosing Device Join Types Quiz5q
- Joining Devices to Microsoft Entra ID
- Joining Devices to Microsoft Entra ID Quiz5q
- Registering Devices to Microsoft Entra ID
- Registering Devices to Microsoft Entra ID Quiz5q
- Planning Device Groups in Microsoft Entra ID
- Planning Device Groups in Microsoft Entra ID Quiz5q
- Implementing Dynamic Device Groups
- Implementing Dynamic Device Groups Quiz5q
- Configuring Enrollment Settings
- Configuring Enrollment Settings Quiz5q
- Configuring Automatic Enrollment for Windows
- Configuring Automatic Enrollment for Windows Quiz5q
- Configuring Bulk Enrollment for iOS and Android
- Configuring Bulk Enrollment for iOS and Android Quiz5q
- Configuring Android Enrollment Profiles
- Configuring Android Enrollment Profiles Quiz5q
- Configuring Android Enterprise Work Profiles
- Configuring Android Enterprise Work Profiles Quiz5q
- Managing Roles in Intune
- Managing Roles in Intune Quiz5q
- Implementing Compliance Policies
- Implementing Compliance Policies Quiz5q
- Implementing Conditional Access with Compliance
- Implementing Conditional Access with Compliance Quiz5q
- Configuring Windows Hello for Business
- Configuring Windows Hello for Business Quiz5q
- Implementing Windows LAPS
- Implementing Windows LAPS Quiz5q
- Managing Local Groups Membership
- Managing Local Groups Membership Quiz5q
- Choosing Between Autopilot and Provisioning Packages
- Choosing Between Autopilot and Provisioning Packages Quiz5q
- Choosing Windows Autopilot Deployment Modes
- Choosing Windows Autopilot Deployment Modes Quiz5q
- Applying Device Name Templates
- Applying Device Name Templates Quiz5q
- Implementing Windows Autopilot Deployment
- Implementing Windows Autopilot Deployment Quiz5q
- Creating Enrollment Status Pages
- Creating Enrollment Status Pages Quiz5q
- Implementing Provisioning Packages
- Implementing Provisioning Packages Quiz5q
- Planning Windows 11 Upgrades
- Planning Windows 11 Upgrades Quiz5q
- Implementing Windows 365 Cloud PC
- Implementing Windows 365 Cloud PC Quiz5q
- Configuring Autopilot Device Preparation
- Configuring Autopilot Device Preparation Quiz5q
- Creating Windows Device Configuration Profiles
- Creating Windows Device Configuration Profiles Quiz5q
- Importing ADMX Files
- Importing ADMX Files Quiz5q
- Creating Android Device Profiles
- Creating Android Device Profiles Quiz5q
- Creating iOS and iPadOS Device Profiles
- Creating iOS and iPadOS Device Profiles Quiz5q
- Creating macOS Device Profiles
- Creating macOS Device Profiles Quiz5q
- Targeting Profiles Using Filters
- Targeting Profiles Using Filters Quiz5q
- Creating Windows 11 Enterprise Multi-Session Profiles
- Creating Windows 11 Enterprise Multi-Session Profiles Quiz5q
- Configuring Endpoint Privilege Management
- Configuring Endpoint Privilege Management Quiz5q
- Using Enterprise App Catalog
- Using Enterprise App Catalog Quiz5q
- Implementing Advanced Analytics
- Implementing Advanced Analytics Quiz5q
- Configuring Remote Help
- Configuring Remote Help Quiz5q
- Implementing Microsoft Tunnel for MAM
- Implementing Microsoft Tunnel for MAM Quiz5q
- Understanding Microsoft Cloud PKI
- Understanding Microsoft Cloud PKI Quiz5q
- Syncing and Restarting Devices
- Syncing and Restarting Devices Quiz5q
- Retiring and Wiping Devices
- Retiring and Wiping Devices Quiz5q
- Performing Bulk Remote Actions
- Performing Bulk Remote Actions Quiz5q
- Rotating BitLocker Recovery Keys
- Rotating BitLocker Recovery Keys Quiz5q
- Running Device Queries with KQL
- Running Device Queries with KQL Quiz5q
- Updating Defender Antivirus Definitions
- Updating Defender Antivirus Definitions Quiz5q
- Preparing Applications for Deployment
- Preparing Applications for Deployment Quiz5q
- Deploying Apps Using Intune
- Deploying Apps Using Intune Quiz5q
- Deploying Microsoft 365 Apps
- Deploying Microsoft 365 Apps Quiz5q
- Configuring Policies for Office Apps
- Configuring Policies for Office Apps Quiz5q
- Using Office Deployment Tool with Autopilot
- Using Office Deployment Tool with Autopilot Quiz5q
- Managing Apps in Microsoft 365 Admin Center
- Managing Apps in Microsoft 365 Admin Center Quiz5q
- Deploying Apps from Platform App Stores
- Deploying Apps from Platform App Stores Quiz5q
- Managing Win32 App Dependencies
- Managing Win32 App Dependencies Quiz5q
- Planning App Protection Policies
- Planning App Protection Policies Quiz5q
- Implementing App Protection Policies
- Implementing App Protection Policies Quiz5q
- Implementing Conditional Access for Apps
- Implementing Conditional Access for Apps Quiz5q
- Planning App Configuration Policies
- Planning App Configuration Policies Quiz5q
- Implementing App Configuration Policies
- Implementing App Configuration Policies Quiz5q
- Configuring Selective Wipe for Apps
- Configuring Selective Wipe for Apps Quiz5q
- Creating Antivirus Policies
- Creating Antivirus Policies Quiz5q
- Creating Disk Encryption Policies
- Creating Disk Encryption Policies Quiz5q
- Creating Firewall Policies
- Creating Firewall Policies Quiz5q
- Configuring Attack Surface Reduction
- Configuring Attack Surface Reduction Quiz5q
- Implementing Security Baselines
- Implementing Security Baselines Quiz5q
- Integrating with Defender for Endpoint
- Integrating with Defender for Endpoint Quiz5q
- Onboarding Devices to Defender for Endpoint
- Onboarding Devices to Defender for Endpoint Quiz5q
- Configuring Endpoint Detection and Response
- Configuring Endpoint Detection and Response Quiz5q
- Planning Device Updates
- Planning Device Updates Quiz5q
- Creating Windows Update Rings
- Creating Windows Update Rings Quiz5q
- Managing iOS and macOS Updates
- Managing iOS and macOS Updates Quiz5q
- Managing Android Updates
- Managing Android Updates Quiz5q
- Configuring Delivery Optimization
- Configuring Delivery Optimization Quiz5q
- Monitoring Update Deployments
- Monitoring Update Deployments Quiz5q
- Creating Feature Update Policies
- Creating Feature Update Policies Quiz5q
- Managing Quality Update Expedites
- Managing Quality Update Expedites Quiz5q
- Using Windows Update for Business Reports
- Using Windows Update for Business Reports Quiz5q
Spend your points to unlock exam-style practice questions
Spend points to unlock MD-102 exam-style practice questions.
Practice for MD-102