LAB 06 AZ-500 ~40 phút Chương 02 Identity & Access

Cấu Hình Authentication Methods

Quản lý chính sách phương thức xác thực: bật Microsoft Authenticator cho nhóm chỉ định, tắt SMS cho admin (phương thức yếu), bật Temporary Access Pass để onboard user mới an toàn không cần mật khẩu tạm.

🎯 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ị

Yêu cầu:
  • 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
Kiến thức nền:
  • 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

1

Truy Cập Authentication Methods Policy

Cách 1 — Portal (chính)
  1. 1.1Vào Microsoft Entra ID → Security → Authentication methods
  2. 1.2Quan sát danh sách methods: Microsoft Authenticator, SMS, Voice call, FIDO2, TAP, Email OTP…
  3. 1.3Lưu ý tab Policies — đây là nơi quản lý Authentication Methods Policy mới (thay per-user MFA cũ)
Cách 2 — Microsoft Graph PowerShell
Microsoft Graph PowerShell
# 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
2

Bật Microsoft Authenticator cho Nhóm Admin

Cách 1 — Portal
  1. 2.1Authentication methods → click Microsoft Authenticator
  2. 2.2Enable: Yes → Target: Select users/groups
  3. 2.3Add groups → chọn GRP-AZ500-PrivilegedAdmins
  4. 2.4Authentication mode: Any (cho phép push notification và passwordless)
  5. 2.5Save
Cách 2 — Microsoft Graph PowerShell
Microsoft Graph PowerShell
# 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"
3

Tắt SMS cho Nhóm Admin (Chặn Phương Thức Yếu)

Cách 1 — Portal
  1. 3.1Authentication methods → click SMS
  2. 3.2Enable: Yes → Target: Select users/groups → Add groups → GRP-AZ500-PrivilegedAdmins
  3. 3.3Chọn group → bên phải click icon "Exclude" (dấu trừ) → group chuyển sang màu đỏ = Excluded
  4. 3.4Điều này có nghĩa: SMS bật cho toàn tenant trừ nhóm PrivilegedAdmins → Save
Cách 2 — Microsoft Graph PowerShell
Microsoft Graph PowerShell
# 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"
Lý do bảo mật: SMS dễ bị tấn công SIM-swapping — kẻ tấn công liên lạc nhà mạng để chuyển số điện thoại sang SIM mới rồi nhận OTP. Nhóm admin có đặc quyền cao KHÔNG được phép dùng SMS làm MFA.
4

Bật Temporary Access Pass (TAP)

Cách 1 — Portal
  1. 4.1Authentication methods → Temporary Access Pass
  2. 4.2Enable: Yes → Target: All users → Save
  3. 4.3Minimum lifetime: 60 phút, Maximum: 480 phút, Default: 60 phút
  4. 4.4Allow one-time use: Yes (TAP chỉ dùng 1 lần → an toàn hơn)
  5. 4.5Tạo TAP cho user: Entra ID → Users → az500-dev01 → Authentication methods → Add authentication method → Temporary Access Pass
Cách 2 — Microsoft Graph PowerShell
Microsoft Graph PowerShell
# 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))"
Kết quả bước 4: TAP được tạo thành công, hiển thị mã 8 ký tự. User dùng TAP này để đăng nhập lần đầu và đăng ký Microsoft Authenticator mà không cần mật khẩu tạm thời.
5

Kiểm Tra Trải Nghiệm Đăng Ký MFA của User

Cách 1 — Portal
  1. 5.1Mở trình duyệt InPrivate → vào aka.ms/mysecurityinfo
  2. 5.2Đăng nhập bằng az500-dev01 + TAP vừa tạo
  3. 5.3Chọn Add sign-in method → Microsoft Authenticator → quét QR bằng app
  4. 5.4Xác nhận user không thấy tùy chọn SMS nếu đang trong nhóm bị exclude
  5. 5.5Kiểm tra: Entra ID → Users → az500-dev01 → Authentication methods → thấy Microsoft Authenticator đã đăng ký

📊 Kết Quả Đầu Ra

Authenticator bật cho nhóm admin

Authentication Methods → Microsoft Authenticator → Enabled, scoped to GRP-AZ500-PrivilegedAdmins

SMS bị tắt cho nhóm admin

Admin không thấy tùy chọn SMS khi đăng ký MFA tại mysecurityinfo

TAP feature enabled

Temporary Access Pass bật, isUsableOnce = true, lifetime 60 phút

User đăng ký Authenticator thành công

az500-dev01 đăng ký Authenticator bằng TAP, không cần mật khẩu tạm

🧹 Dọn Dẹp

Microsoft Graph PowerShell
# 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

Lab 05: MFA Admin Thư viện Labs Lab 07: Named Location
Zalo