MS-102 Giai đoạn 5 – Hybrid Identity Module 34
34

Hybrid Identity Models

Password Hash Sync • Pass-through Auth • AD FS • Seamless SSO • Hybrid Identity Architecture

Entra ID Active Directory MS-102 GĐ5

01 · Lý thuyết

Hybrid Identity – Tại sao cần?

Hybrid Identity cho phép tổ chức dùng cả on-premises Active Directory (AD DS)Microsoft Entra ID cùng lúc. Nhân viên chỉ cần 1 tài khoản duy nhất để đăng nhập máy tính domain và các cloud service như M365, Azure, SaaS apps.

Đây là thực tế phổ biến tại Việt Nam: các doanh nghiệp vừa và lớn đều có AD DS on-premises đã vận hành nhiều năm, không thể migrate hoàn toàn lên cloud ngay. Hybrid identity là bước chuyển đổi tất yếu.

3 Phương thức xác thực Hybrid – So sánh chi tiết

Tiêu chíPassword Hash Sync (PHS)Pass-through Auth (PTA)AD FS
Cơ chếĐồng bộ hash password lên Entra ID (hash của hash)Proxy xác thực về AD DS on-premFederate trust, token từ AD FS server
Password validationTrong Entra ID cloudTrong AD DS on-premisesTrong AD FS on-premises
Hoạt động khi AD offlineCó (cloud validate)Không (cần on-prem)Không (cần on-prem)
Phức tạp triển khaiThấp nhấtTrung bìnhCao nhất (PKI, certs, WAP)
Leaked credentials detectionCó (Microsoft theo dõi dark web)KhôngKhông
Smart Lockout tích hợpCần cấu hình riêng
Password policyAD DS policy (Entra chỉ enforce expiry)AD DS hoàn toànAD DS hoàn toàn
Phù hợp vớiHầu hết doanh nghiệp – Microsoft khuyến nghịCần password validate on-prem vì complianceComplex federation, multi-forest, third-party IdP
Hạ tầng cần thêmKhông (Entra Connect đủ)PTA agent on-prem (lightweight)AD FS server + WAP (tốn kém)

Seamless Single Sign-On (Seamless SSO)

Seamless SSO kết hợp với PHS hoặc PTA cho phép user đã đăng nhập vào máy tính domain truy cập M365/Azure mà không cần nhập password thêm lần nào. Cơ chế dùng Kerberos ticket.

  • Máy tính phải là Hybrid Entra Joined hoặc Entra Joined
  • Browser phải là Edge, Chrome (với Entra extension), hoặc IE
  • Seamless SSO không hoạt động từ mobile devices hay non-domain machines

Password Hash Sync – Chi tiết kỹ thuật

PHS không sync password plaintext. Quy trình:

Bước 1

AD DS lưu NTLM hash của password

Bước 2

Entra Connect lấy MD4 hash của NTLM hash

Bước 3

Thêm salt + PBKDF2 hash 1000 lần

Bước 4

Upload lên Entra ID qua TLS (sync mỗi 2 phút)

Microsoft khuyến nghị PHS cho hầu hết tổ chức vì đơn giản, bền vững (hoạt động kể cả khi on-prem down), và có tính năng phát hiện leaked credentials. PTA và AD FS chỉ dùng khi có yêu cầu compliance đặc biệt.

02 · Thực hành

Lab A: Kiểm tra Authentication Method hiện tại

Connect-MgGraph -Scopes "Organization.Read.All" # Xem authentication method của tenant $org = Get-MgOrganization $org | Select-Object DisplayName, OnPremisesSyncEnabled, OnPremisesLastSyncDateTime # Kiểm tra chi tiết authentication configuration Connect-AzureAD # Xem domain federation status Get-AzureADDomain | Select-Object Name, AuthenticationType, IsVerified, IsDefault # Kiểm tra PHS enabled không $authPolicy = Get-AzureADPolicy | Where-Object { $_.Type -eq "AuthorizationPolicy" } Write-Host "Auth Policy: $($authPolicy.DisplayName)"
DisplayName OnPremisesSyncEnabled OnPremisesLastSyncDateTime ----------- --------------------- -------------------------- VietTech Corporation True 2024-03-15T06:15:00Z # Domain authentication types: Name AuthenticationType IsVerified IsDefault ---- ------------------ ---------- --------- viettech.vn Managed True True corp.viettech.local Managed False False # AuthenticationType = "Managed" = PHS/PTA # AuthenticationType = "Federated" = AD FS

Lab B: Cấu hình Seamless SSO (sau khi đã có Entra Connect)

# Chạy trên Entra Connect server Import-Module "C:\Program Files\Microsoft Azure Active Directory Connect\AzureADSSO.psd1" # Bắt đầu Seamless SSO setup $creds = Get-Credential -Message "Nhập Entra ID Global Admin credentials" New-AzureADSSOAuthenticationContext -CloudCredentials $creds # Lấy danh sách AD forests $adForestCreds = Get-Credential -Message "Nhập Enterprise Admin credentials cho AD forest" Enable-AzureADSSOForest -DomainFqdn "corp.viettech.local" -AdfsCredential $adForestCreds # Verify Seamless SSO enabled Get-AzureADSSOStatus
Enabling Seamless SSO for forest: corp.viettech.local Creating AZUREADSSOACC$ computer account in domain... Setting SPN on AZUREADSSOACC$ account... Seamless SSO enabled successfully. # Get-AzureADSSOStatus: Domains where Seamless SSO is enabled: corp.viettech.local - ENABLED viettech.vn - ENABLED # Kết quả: User đăng nhập Windows domain → vào outlook.com # Không cần nhập password → Kerberos ticket tự động authenticate

Lab C: Test Seamless SSO trên máy client

# Kiểm tra trên máy client (domain joined) # 1. Verify AZUREADSSOACC$ account có trong AD Get-ADComputer -Filter { Name -eq "AZUREADSSOACC" } | Select-Object Name, ServicePrincipalNames # 2. Verify Kerberos ticket được tạo sau khi login klist # 3. Kiểm tra Internet Explorer/Edge trusted sites bao gồm: # https://autologon.microsoftazuread-sso.com # Nên được deploy qua GPO: # GPO path: User Config > Windows Settings > Internet Explorer Maintenance # Trusted Sites: https://autologon.microsoftazuread-sso.com # Nếu dùng registry: $regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\microsoftazuread-sso.com\autologon" New-Item -Path $regPath -Force Set-ItemProperty -Path $regPath -Name "https" -Value 1 -Type DWord
# AZUREADSSOACC$ computer account: Name ServicePrincipalNames ---- --------------------- AZUREADSSOACC {kerb/autologon.microsoftazuread-sso.com, ...} # klist output (sau khi login domain): Current LogonId is 0:0x2a3b4c Cached Tickets: (3) Server: krbtgt/CORP.VIETTECH.LOCAL @ CORP.VIETTECH.LOCAL Server: http/autologon.microsoftazuread-sso.com @ CORP.VIETTECH.LOCAL ← SSO ticket! # User vào portal.office.com → đăng nhập tự động, không cần nhập password

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

Tập đoàn TH True Milk – Migration từ AD DS sang Hybrid Identity

TH True Milk có 5.000 nhân viên, hệ thống AD DS đã hoạt động 10 năm với 3 domain controllers. Họ muốn triển khai M365 E3 cho toàn bộ nhân viên nhưng không muốn user phải có 2 password riêng.

Quyết định: PHS + Seamless SSO

  • PHS được chọn vì: đơn giản nhất, không cần thêm hạ tầng, hoạt động ngay cả khi DC bảo trì
  • Seamless SSO: nhân viên ngồi văn phòng, đăng nhập Windows xong vào Outlook/Teams luôn — không cần nhập thêm password
  • Password writeback: enable để user có thể tự reset password AD qua SSPR (Self-Service Password Reset) của Entra
  • Leaked credentials protection: Microsoft phát hiện 3 tài khoản TH có password bị leak trên dark web — alert ngay và force reset

Kết quả:

  • • Triển khai M365 cho 5.000 user trong 2 tuần — không cần migration AD accounts
  • • Helpdesk giảm 60% ticket "quên password M365" — nhờ Seamless SSO và SSPR
  • • 3 tài khoản bị leak được phát hiện và xử lý trước khi bị khai thác