MS-102 GĐ7 Module 47

Message Encryption & Mail Flow Rules

Microsoft Purview Message Encryption (OME v2): Encrypt-Only, Do Not Forward, branded templates và mail flow rules tự động mã hoá email theo điều kiện.

Tình huống – VinaCorp

HR cần gửi file hợp đồng lao động (PDF chứa CCCD, lương) qua email cho nhân viên mới. Legal cần gửi tài liệu "Mật" cho đối tác bên ngoài mà không cho phép forward. IT phải tự động mã hoá tất cả email chứa từ khoá "Confidential".

Purview Message Encryption (OME v2)

OME v2 dựa trên Azure Rights Management (Azure RMS). Người nhận bên ngoài (Gmail, Yahoo...) xem email qua portal hoặc OTP — không cần cài phần mềm.

Protection TypeEncryptForwardPrint/CopyExpiry
Encrypt-Only✅ (người nhận có thể forward)Không
Do Not ForwardKhông
Confidential (custom)Tuỳ chọnTuỳ chọnTuỳ chọn (ngày)
Do Not Reply All❌ Reply AllKhông
Yêu cầu: Azure RMS phải được kích hoạt (mặc định bật trong M365). Kiểm tra: Get-AipServiceConfiguration | Select-Object FunctionalState

Lab A – Branded OME Template

Connect-ExchangeOnline -UserPrincipalName [email protected] # Tạo branded OME configuration New-OMEConfiguration -Identity "VinaCorp-Confidential" ` -EmailText "Email này được mã hoá và bảo vệ bởi VinaCorp. Vui lòng không chia sẻ." ` -PortalText "Bạn đã nhận được email được mã hoá từ VinaCorp." ` -DisclaimerText "Nội dung này là tài sản của VinaCorp. © 2026" ` -OTPEnabled $true ` -SocialIdSignIn $false ` -BackgroundColor "#0f172a" ` -IntroductionText "VinaCorp - Email Bảo Mật" Write-Host "Branded OME template created" # Xem các OME configurations Get-OMEConfiguration | Select-Object Identity, OTPEnabled, SocialIdSignIn
Branded OME template created: VinaCorp-Confidential Identity OTPEnabled SocialIdSignIn -------- ---------- -------------- OME Configuration True True VinaCorp-Confidential True False

Lab B – Mail Flow Rules tự động mã hoá

Rule 1: Auto-encrypt khi subject chứa [Confidential]

# Auto-encrypt email có [Confidential] trong subject New-TransportRule -Name "Auto-Encrypt-Confidential" ` -SubjectContainsWords "[Confidential]","[Mật]","[Bí mật]" ` -SentToScope NotInOrganization ` -ApplyOMETemplate "VinaCorp-Confidential" ` -ApplyRightsProtectionTemplate "Encrypt" ` -Priority 1 Write-Host "Rule 1 created: auto-encrypt [Confidential] emails"
Rule 1 created: auto-encrypt [Confidential] emails to external recipients

Rule 2: Do Not Forward cho HR email gửi ngoài

# HR emails gửi ra ngoài: Do Not Forward $hrGroupId = (Get-MgGroup -Filter "displayName eq 'GRP_HR'").Id New-TransportRule -Name "HR-DoNotForward-External" ` -SentToScope NotInOrganization ` -FromMemberOf "GRP_HR" ` -ApplyOMETemplate "VinaCorp-Confidential" ` -ApplyRightsProtectionTemplate "Do Not Forward" ` -Priority 2 Write-Host "Rule 2: HR external emails → Do Not Forward"
Rule 2 created: HR → external: Do Not Forward protection applied

Rule 3: Auto-encrypt khi detect CCCD/Passport numbers

# Tự động encrypt khi email chứa số CCCD hoặc passport New-TransportRule -Name "Auto-Encrypt-PII" ` -SentToScope NotInOrganization ` -MessageContainsDataClassifications @( @{Name="Vietnam National Identification Number"; minCount=1}, @{Name="Passport Number"; minCount=1} ) ` -ApplyOMETemplate "VinaCorp-Confidential" ` -ApplyRightsProtectionTemplate "Encrypt" ` -Priority 3 ` -SetAuditSeverity High Write-Host "Rule 3: auto-encrypt PII data in outbound emails"
Rule 3 created: auto-encrypt outbound emails with PII (CCCD/Passport)

Trải nghiệm người nhận bên ngoài

1Người nhận (Gmail) nhận email thông thường với attachment message.html — không thể đọc trực tiếp
2Mở message.html → redirect đến OME portal — đăng nhập bằng Google hoặc nhận OTP qua email
3Xem nội dung email gốc trong portal — nếu Do Not Forward: nút Reply, Forward, Print bị disable
4Nếu email có expiry: portal hiển thị countdown và từ chối truy cập sau ngày hết hạn

Revoke encrypted email đã gửi

# Chỉ email với Encrypt-Only có thể revoke # Lấy Message ID từ Exchange audit log $msgId = "" # Revoke qua portal: Purview → Message Encryption → Revoke # Hoặc PowerShell: Set-OMEMessageRevocation -MessageId $msgId Write-Host "Encrypted email revoked — recipient can no longer access"
Encrypted email revoked. Recipient will see: "This message has been revoked by the sender."

Tổng kết M47

Kiến thức cốt lõi
  • ✅ Encrypt-Only: mã hoá nhưng cho phép forward
  • ✅ Do Not Forward: không forward, không print, không copy
  • ✅ Branded template: logo + màu sắc + OTP cho external users
  • ✅ Mail flow rules: auto-encrypt theo subject/SIT/sender group
  • ✅ Revoke chỉ hoạt động với Encrypt-Only (không áp dụng Do Not Forward)
Lab đã thực hành
  • 🔬 Lab A: Branded OME template VinaCorp-Confidential
  • 🔬 Lab B Rule 1: Auto-encrypt [Confidential] subject
  • 🔬 Lab B Rule 2: HR → external = Do Not Forward
  • 🔬 Lab B Rule 3: Auto-encrypt khi detect CCCD/Passport SIT