MD-102 Giai đoạn 2 – Network Security Module 12
12

VPN & Network Security với Intune

VPN Profiles • Always On VPN • Per-App VPN • Wi-Fi Profiles • Network Boundary • Trusted Network Detection

Microsoft Intune Network Security MD-102 GĐ2

01 · Lý thuyết

VPN trong Intune – Các loại VPN Profile

Intune quản lý VPN thông qua Device Configuration Profiles loại VPN. Có nhiều loại VPN kết nối được hỗ trợ:

Loại VPNMô tảPhù hợpProtocol
IKEv2Native Windows VPN, tự reconnect sau mất mạngAlways On VPN doanh nghiệpIKEv2/IPsec
L2TPLayer 2, cần cấu hình thêm pre-shared keyLegacy compatibilityL2TP/IPsec
SSTPVPN qua HTTPS port 443, vượt firewall dễMôi trường restrictiveSSTP/TLS
Check PointVPN client của Check PointCheck Point infrastructureSSL/IPsec
Cisco AnyConnectCisco VPN phổ biến tại Việt NamCisco ASA/FTD gatewaySSL/TLS
GlobalProtectPalo Alto Networks VPNPalo Alto infrastructureIPsec/SSL
Pulse SecureIvanti/Pulse VPN clientPulse gatewaySSL/TLS

Always On VPN vs Traditional VPN

Tiêu chíTraditional VPNAlways On VPN
Kết nốiUser phải bấm Connect thủ côngTự động kết nối khi ra khỏi mạng công ty
Loại tunnelUser tunnel (sau khi login)Device tunnel + User tunnel
Domain joinKhó quản lý máy out-of-officeMachine luôn tiếp cận được DC
Split tunnelingThường all-traffic qua VPNHỗ trợ split tunneling (M365 ra thẳng internet)
AuthenticationPassword / 2FACertificate-based (no password)
Intune supportVPN Profile thông thườngAlways On VPN profile (Windows 10+)

Per-App VPN – VPN chỉ cho ứng dụng cụ thể

Per-App VPN cho phép chỉ những ứng dụng được chỉ định mới đi qua VPN tunnel, còn lại dùng kết nối internet bình thường (split tunneling ở cấp app). Lợi ích:

  • Giảm tải VPN gateway — chỉ traffic quan trọng đi qua
  • Tốc độ internet cá nhân không bị ảnh hưởng bởi VPN
  • Hữu ích cho BYOD: chỉ app công ty dùng VPN, app cá nhân không

Wi-Fi Profiles – Cấu hình Wi-Fi tự động

Cài đặtTùy chọnMô tả
SSIDTên Wi-FiSSID của mạng Wi-Fi công ty
Security typeWPA2/WPA3 EnterpriseDùng certificate để xác thực (không cần password)
EAP typeEAP-TLS / PEAPEAP-TLS: dùng client certificate; PEAP: username/password qua TLS
Root certificateUpload CA certMáy tin server Wi-Fi là hợp lệ
Client certificateSCEP / PKCS profileMáy chứng minh danh tính với Wi-Fi controller
Connect automaticallyYes / NoTự kết nối khi trong range
Trusted Network Detection: Always On VPN có tính năng này — khi thiết bị ở mạng nội bộ công ty (trusted network), VPN không kết nối để tiết kiệm băng thông. Khi ra ngoài, VPN tự động bật.

02 · Thực hành

Lab A: Tạo VPN Profile (IKEv2) qua Intune Portal

Thực hành tại: intune.microsoft.com → Devices → Configuration → Create → Windows → VPN

  1. Vào DevicesConfigurationCreateNew policy
  2. Platform: Windows 10 and later, Profile type: TemplatesVPN
  3. Name: VPN-Corp-IKEv2-AlwaysOn
  4. Tab Configuration settings:
    • Connection name: VietTech VPN
    • Servers: vpn.viettech.vn
    • Connection type: IKEv2
    • Always On: Enable
    • Remember credentials: Enable
  5. Authentication:
    • Authentication method: EAP
    • EAP XML: (copy từ rasphone.pbk sau khi tạo VPN thủ công lần đầu)
  6. Trusted Network Detection:
    • DNS suffixes: viettech.vn, corp.viettech.local
    → VPN sẽ không kết nối khi ở mạng công ty
  7. Split Tunneling: Enable
    • Routes: thêm 10.0.0.0/8 (only internal traffic goes through VPN)
  8. Assign to group GRP-Remote-Workers → Create

Lab B: Tạo Wi-Fi Profile với WPA2 Enterprise (EAP-TLS)

Connect-MgGraph -Scopes "DeviceManagementConfiguration.ReadWrite.All" # Tạo Wi-Fi profile với certificate-based authentication $wifiProfile = @{ "@odata.type" = "#microsoft.graph.windowsWifiConfiguration" displayName = "WiFi-Corp-WPA2-Enterprise" description = "Corporate Wi-Fi with certificate authentication" wifiSecurityType = "wpa2Enterprise" ssid = "VietTech-Corp" connectAutomatically = $true connectWhenNetworkNameIsHidden = $false eapType = "eapTls" rootCertificateForServerValidationId = "ROOT-CERT-ID-FROM-TRUSTED-CERT-PROFILE" identityCertificateForClientAuthentication = "SCEP-CERT-PROFILE-ID" } | ConvertTo-Json -Depth 5 Invoke-MgGraphRequest -Method POST ` -Uri "https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations" ` -Body $wifiProfile -ContentType "application/json"
id : wifi-cfg-abc123 displayName : WiFi-Corp-WPA2-Enterprise wifiSecurityType : wpa2Enterprise ssid : VietTech-Corp connectAutomat.. : True eapType : eapTls createdDateTime : 2024-03-15T09:00:00Z # Kết quả trên máy Windows sau khi nhận policy: # - Wi-Fi "VietTech-Corp" xuất hiện và tự kết nối # - Không cần nhập password (dùng certificate) # - Certificate được deploy bởi SCEP profile cùng lúc

Lab C: Kiểm tra VPN connection trên máy client

# Kiểm tra VPN profiles đã được deploy Get-VpnConnection | Select-Object Name, ServerAddress, TunnelType, ConnectionStatus, AuthenticationMethod # Kiểm tra Always On VPN device tunnel Get-VpnConnection -AllUserConnection | Select-Object Name, ConnectionStatus # Test kết nối VPN thủ công rasdial "VietTech VPN" # Kiểm tra routing sau khi VPN connected route print | Select-String "10\." # Kiểm tra DNS resolution qua VPN Resolve-DnsName "fileserver.corp.viettech.local"
Name ServerAddress TunnelType ConnectionStatus AuthenticationMethod ------- ----------- ---------- ---------------- -------------------- VietTech VPN vpn.viettech.vn Ikev2 Disconnected Eap # Sau rasdial: Connecting to VietTech VPN... CONNECT VietTech VPN connected. # Route: traffic đến 10.0.0.0/8 đi qua VPN interface (PPP adapter) # DNS: fileserver.corp.viettech.local → 10.0.1.50 (resolved successfully)

Lab D: Per-App VPN – Chỉ CRM App đi qua VPN

Thực hành tại: Devices → Configuration → VPN profile → Per-App VPN

# Trong VPN profile configuration, thêm Per-App VPN settings: # Associated Apps: chỉ định app nào dùng VPN # Lấy app ID của CRM app đã deploy $crmApp = Invoke-MgGraphRequest -Method GET ` -Uri "https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps?`$filter=displayName eq 'VietTech CRM'" $crmAppId = $crmApp.value[0].id Write-Host "CRM App ID: $crmAppId" # Trong portal: VPN Profile → Per-app VPN → Add apps → chọn CRM app # Kết quả: chỉ traffic từ VietTech CRM đi qua VPN tunnel # Outlook, Teams, Chrome... dùng internet trực tiếp

03 · Tình huống thực tế

Tập đoàn VinGroup – Kết nối 2.000 nhân viên làm việc từ xa

Sau COVID-19, VinGroup có 2.000 nhân viên làm việc hybrid (nhà + văn phòng). Họ cần truy cập hệ thống ERP nội bộ từ nhà nhưng VPN truyền thống làm chậm toàn bộ internet của nhân viên.

Giải pháp Always On VPN + Split Tunneling:

  • Always On VPN IKEv2: tự kết nối khi nhân viên rời văn phòng, không cần bấm Connect
  • Split Tunneling: chỉ traffic đến 10.0.0.0/8 (ERP, file server) đi qua VPN; M365, YouTube, Google đi thẳng internet
  • Trusted Network Detection: DNS suffix vingroup.local — VPN tự ngắt khi ở văn phòng
  • Certificate auth: Deploy SCEP certificates qua Intune, nhân viên không cần nhớ VPN password

Kết quả:

  • • Giảm 80% tải VPN gateway (split tunneling loại Teams/M365 traffic)
  • • Nhân viên không còn phàn nàn internet chậm khi bật VPN
  • • IT tiết kiệm: không cần nâng cấp VPN hardware thêm
  • • Zero Touch setup: laptop mới nhận profile, tự cấu hình VPN không cần IT can thiệp