🎯 Mục Tiêu Lab
Truy cập và hiểu giao diện Authentication Methods Policy trong Entra ID
Bật Microsoft Authenticator cho nhóm GRP-AZ500-PrivilegedAdmins
Tắt SMS/Voice call cho nhóm admin (tránh SIM-swapping attack)
Bật Temporary Access Pass và tạo TAP cho user mới
Kiểm tra trải nghiệm đăng ký phương thức xác thực của user
Phân biệt Authentication Methods Policy với legacy MFA settings
📋 Chuẩn Bị
- Quyền Authentication Policy Administrator hoặc Global Admin
- Đã hoàn thành Lab 05 (có group GRP-AZ500-PrivilegedAdmins)
- Thiết bị có cài Microsoft Authenticator app để test
- Entra ID P1/P2 license cho TAP feature
- SMS là phương thức MFA yếu nhất, dễ bị SIM-swap
- TAP = time-limited passcode dùng 1 lần để đăng ký passwordless
- Authentication Methods Policy thay thế legacy per-user MFA settings
- Scope: có thể bật/tắt theo group — không cần apply toàn tenant
🏗️ Kịch Bản
Sau khi bật CA policy MFA cho admin (Lab 05), Security team nhận ra một số admin đang dùng SMS làm phương thức MFA — đây là rủi ro SIM-swapping. Yêu cầu: bắt buộc dùng Microsoft Authenticator cho nhóm admin, tắt SMS cho họ. Đồng thời bật Temporary Access Pass để Security team có thể onboard admin mới hoặc cấp phát lại MFA mà không cần biết mật khẩu tạm thời.
🧪 Các Bước Thực Hiện
Truy Cập Authentication Methods Policy
- 1.1Vào Microsoft Entra ID → Security → Authentication methods
- 1.2Quan sát danh sách methods: Microsoft Authenticator, SMS, Voice call, FIDO2, TAP, Email OTP…
- 1.3Lưu ý tab Policies — đây là nơi quản lý Authentication Methods Policy mới (thay per-user MFA cũ)
# Kết nối Graph
Connect-MgGraph -Scopes "Policy.ReadWrite.AuthenticationMethod","Policy.Read.All"
# Xem trạng thái hiện tại của các authentication methods
Get-MgPolicyAuthenticationMethodPolicy | Select-Object -ExpandProperty AuthenticationMethodConfigurations |
Select-Object Id, State | Format-Table -AutoSize
Bật Microsoft Authenticator cho Nhóm Admin
- 2.1Authentication methods → click Microsoft Authenticator
- 2.2Enable: Yes → Target: Select users/groups
- 2.3Add groups → chọn
GRP-AZ500-PrivilegedAdmins - 2.4Authentication mode: Any (cho phép push notification và passwordless)
- 2.5Save
# Lấy group ID
$groupId = (Get-MgGroup -Filter "DisplayName eq 'GRP-AZ500-PrivilegedAdmins'").Id
# Cập nhật Microsoft Authenticator — bật cho group chỉ định
$params = @{
"@odata.type" = "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration"
state = "enabled"
includeTargets = @(
@{
targetType = "group"
id = $groupId
authenticationMode = "any"
}
)
}
Update-MgPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
-AuthenticationMethodConfigurationId "MicrosoftAuthenticator" `
-BodyParameter $params
Write-Host "Microsoft Authenticator enabled for GRP-AZ500-PrivilegedAdmins"
Tắt SMS cho Nhóm Admin (Chặn Phương Thức Yếu)
- 3.1Authentication methods → click SMS
- 3.2Enable: Yes → Target: Select users/groups → Add groups →
GRP-AZ500-PrivilegedAdmins - 3.3Chọn group → bên phải click icon "Exclude" (dấu trừ) → group chuyển sang màu đỏ = Excluded
- 3.4Điều này có nghĩa: SMS bật cho toàn tenant trừ nhóm PrivilegedAdmins → Save
# Loại trừ nhóm admin khỏi SMS method
$params = @{
"@odata.type" = "#microsoft.graph.smsAuthenticationMethodConfiguration"
state = "enabled"
includeTargets = @(
@{ targetType = "group"; id = "all_users" } # Bật cho all users...
)
excludeTargets = @(
@{ targetType = "group"; id = $groupId } # ...trừ PrivilegedAdmins
)
}
Update-MgPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
-AuthenticationMethodConfigurationId "Sms" `
-BodyParameter $params
Write-Host "SMS disabled for GRP-AZ500-PrivilegedAdmins"
Bật Temporary Access Pass (TAP)
- 4.1Authentication methods → Temporary Access Pass
- 4.2Enable: Yes → Target: All users → Save
- 4.3Minimum lifetime: 60 phút, Maximum: 480 phút, Default: 60 phút
- 4.4Allow one-time use: Yes (TAP chỉ dùng 1 lần → an toàn hơn)
- 4.5Tạo TAP cho user: Entra ID → Users → az500-dev01 → Authentication methods → Add authentication method → Temporary Access Pass
# Bật TAP feature
$tapConfig = @{
"@odata.type" = "#microsoft.graph.temporaryAccessPassAuthenticationMethodConfiguration"
state = "enabled"
defaultLifetimeInMinutes = 60
defaultLength = 8
minimumLifetimeInMinutes = 60
maximumLifetimeInMinutes = 480
isUsableOnce = $true
includeTargets = @(@{ targetType = "group"; id = "all_users" })
}
Update-MgPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
-AuthenticationMethodConfigurationId "TemporaryAccessPass" `
-BodyParameter $tapConfig
# Tạo TAP cho user az500-dev01
Connect-MgGraph -Scopes "UserAuthenticationMethod.ReadWrite.All"
$userId = (Get-MgUser -Filter "UserPrincipalName eq '[email protected]'").Id
$tap = New-MgUserAuthenticationTemporaryAccessPassMethod `
-UserId $userId `
-IsUsableOnce:$true `
-LifetimeInMinutes 60
Write-Host "TAP created: $($tap.TemporaryAccessPass)"
Write-Host "Expires: $($tap.StartDateTime.AddMinutes(60))"
Kiểm Tra Trải Nghiệm Đăng Ký MFA của User
- 5.1Mở trình duyệt InPrivate → vào aka.ms/mysecurityinfo
- 5.2Đăng nhập bằng
az500-dev01+ TAP vừa tạo - 5.3Chọn Add sign-in method → Microsoft Authenticator → quét QR bằng app
- 5.4Xác nhận user không thấy tùy chọn SMS nếu đang trong nhóm bị exclude
- 5.5Kiểm tra: Entra ID → Users → az500-dev01 → Authentication methods → thấy Microsoft Authenticator đã đăng ký
📊 Kết Quả Đầu Ra
Authentication Methods → Microsoft Authenticator → Enabled, scoped to GRP-AZ500-PrivilegedAdmins
Admin không thấy tùy chọn SMS khi đăng ký MFA tại mysecurityinfo
Temporary Access Pass bật, isUsableOnce = true, lifetime 60 phút
az500-dev01 đăng ký Authenticator bằng TAP, không cần mật khẩu tạm
🧹 Dọn Dẹp
# TAP tự hết hạn sau 60 phút (isUsableOnce = true)
# Nếu muốn xóa thủ công:
$tapMethods = Get-MgUserAuthenticationTemporaryAccessPassMethod -UserId $userId
foreach ($tap in $tapMethods) {
Remove-MgUserAuthenticationTemporaryAccessPassMethod `
-UserId $userId `
-TemporaryAccessPassAuthenticationMethodId $tap.Id
Write-Host "TAP removed"
}
# Giữ lại Authentication Methods Policy — dùng cho lab tiếp theo
❓ Câu Hỏi Ôn Tập
1. Tại sao SMS được coi là phương thức MFA yếu hơn Microsoft Authenticator?
Gợi ý: SIM-swapping attack — kẻ tấn công có thể chuyển số điện thoại sang SIM khác và nhận OTP SMS
2. Temporary Access Pass (TAP) dùng trong tình huống nào?
Gợi ý: Onboard user mới (chưa có MFA), reset MFA khi mất thiết bị, cấp phát passwordless credential lần đầu
3. Authentication Methods Policy khác gì so với per-user MFA settings cũ?
Gợi ý: Policy mới dùng group-based scope, quản lý tập trung, hỗ trợ passwordless. Per-user MFA là tính năng legacy, Microsoft đang deprecate
4. isUsableOnce = true trong TAP có ý nghĩa gì về mặt bảo mật?
Gợi ý: TAP chỉ dùng được 1 lần duy nhất — sau khi user đăng nhập thành công, TAP bị vô hiệu hóa ngay cả khi chưa hết hạn