Identity Bytes // IB-ENTRA-SEC Track
Intermediate Lab 05 of 12 Est. 90 minutes

Self-Service Password Reset and the Domain-Takeover Risk

Self-service password reset removes helpdesk load, but a reset flow is only as trustworthy as the domain and DNS underneath it. This lab configures SSPR correctly, then confronts the risk the specialist brief names directly: recovery and verified domains that depend on email, DNS or federation you may not fully control, and how an expired or externally held domain becomes an account-takeover path.

Section 1

Lab Metadata

Lab ID
IB-ENTRA-SEC-05
Difficulty
Intermediate
Scenario Org
Northgate Financial
Estimated Time
90 minutes

Core technologies

Self-service password reset Combined registration Password writeback Verified domains Federation configuration Microsoft Graph PowerShell
Section 2

Scenario and Description

IN PLAIN TERMS A reset-my-password service is only as trustworthy as the address it posts the spare key to. Imagine a company let the lease lapse on an old office, someone else moved in, and they kept receiving the company's post. They could quietly collect every spare key that was ever posted there. Expired or externally controlled domains are that abandoned office. This lab makes the reset process demand strong proof of who you are, and audits every address, every domain, that the company still trusts, to confirm you genuinely own it.

Northgate wants staff to reset their own passwords without ringing the service desk. Self-service password reset (SSPR) does that, and because registration is now combined with MFA, the methods a user proves themselves with for a reset are the same strong methods you deployed in Labs 02 to 04. Configured well, SSPR reduces cost and improves security at once. Configured carelessly, it becomes a self-service account-takeover portal.

The subtle risk, and the one the brief singles out, is not the SSPR settings screen. It is the trust anchors underneath identity recovery: the domains your tenant has verified, the DNS that proves you own them, the email addresses recovery codes are sent to, and any federation that lets an external identity provider issue tokens for your users. If a verified domain's registration lapses and an attacker re-registers it, if a recovery email points at a domain you no longer control, or if a federated domain trusts a signing key held elsewhere, then password reset and sign-in can be subverted without touching a single Northgate system.

You will baseline SSPR registration and enumerate the tenant's domains, configure SSPR with a strong, appropriate method mix, address hybrid password writeback, then run a domain-takeover risk assessment: flagging unverified, federated, stale and externally exposed domains, and applying the registrar and DNS hygiene that removes the exposure.

Section 3

Prerequisites

Prior labs

Labs 01 to 04 recommended. SSPR shares the combined registration and strong methods you configured earlier, so a user who registered Authenticator or a key in those labs is already SSPR-capable. Domain assessment needs only the tenant from Lab 01.

Graph scopes introduced

ScopeWhy it is needed
Domain.Read.AllEnumerate verified domains and their federation configuration
Directory.Read.All, User.Read.AllCorrelate domains with the users that actually depend on them
AuditLog.Read.AllRead SSPR registration status from the registration report
INFO: where SSPR settings live The core SSPR properties (scope, methods, registration, notifications, writeback) are configured in the Microsoft Entra admin center under Protection > Password reset, not through a single Graph policy object. This lab uses precise portal steps for those settings and Graph for the assessment and domain work.
Section 4

Real-World Problem Statement

Identity recovery is a deliberate, controlled weakening of authentication: you let someone back in when they have lost their credential. If the proof required to do that rests on infrastructure outside your control, recovery becomes the attacker's easiest route. The problem spans two layers, the SSPR method mix, and the domain and DNS trust anchors beneath it.

DimensionWhy this matters
RiskAn expired or externally controlled domain can let an attacker receive recovery codes or forge federated tokens for your users.
ComplianceFinancial-sector expectations require demonstrable control of identity recovery and of the domains that anchor it.
ProductivityWell-configured SSPR removes a large share of helpdesk password tickets, freeing the service desk for real incidents.
Security postureRemoving stale and unnecessary federated domains shrinks the tenant's trust surface measurably.

Concrete scenario: Northgate acquired a smaller firm two years ago and inherited three custom domains. Nobody is sure which are still registered, which are federated to a decommissioned identity provider, or whether any recovery emails still point at them. Your job is to turn SSPR on safely and to prove that every domain the tenant trusts is one Northgate genuinely controls.

Section 5

Skills Mapped to Production Solutions

Skill learned in this labReal-world enterprise application
Configuring SSPR scope, methods and registrationReducing helpdesk load while keeping recovery strong
Choosing a safe SSPR method mixRemoving weak recovery factors such as security questions
Enabling and reasoning about password writebackConsistent hybrid recovery across cloud and on-premises
Enumerating and classifying verified domains via GraphAttack-surface reduction and domain governance
Assessing federation and DNS controlPreventing domain-takeover and token-forgery paths
Section 6

Architecture Overview

An SSPR event depends on a chain of trust: the user proves themselves with registered methods, and the tenant trusts those methods, the domains the account lives in, and the DNS that verified those domains. A break anywhere in that chain, an expired domain, a lapsed DNS record, a stale federation, undermines the whole flow.

User resets via SSPR portal Proof of identity Authenticator / key / email two methods required Verified domain account UPN suffix proven by DNS TXT DNS control registrar + records Break the chain = takeover path expired domain, lapsed DNS, or stale federation trust
PRODUCTION CONSIDERATION Treat your domain registrar and DNS as tier-zero identity infrastructure. Whoever controls the DNS for a verified domain can, in effect, influence who Entra will trust in that domain. Registrar account compromise or an expired renewal is an identity incident, not merely an IT housekeeping issue.
Section 7

Step-by-Step Implementation

Phase A - Baseline SSPR readiness and domains

REAL WORLD ANALOGYSelf-service password reset is the 'lost your key?' desk in the lobby. Done well, it saves the caretaker hundreds of callouts. Done carelessly, it is a desk that hands out spare keys to anyone with a convincing story. Baselining first tells you how many staff could actually use the desk today, and lists every address the desk is allowed to post spare keys to.

1Read SSPR registration and list every domain

Purpose: know who can already self-serve, and what domains the tenant trusts, before changing anything.

Assess SSPR registration and enumerate domains
Connect-MgGraph -Scopes 'Domain.Read.All','Directory.Read.All',
  'User.Read.All','AuditLog.Read.All' -NoWelcome

# SSPR readiness from the registration report (reused from Lab 01).
$reg = Get-MgReportAuthenticationMethodUserRegistrationDetail -All
$ssprCapable    = $reg | Where-Object { $_.IsSsprCapable }
$ssprRegistered = $reg | Where-Object { $_.IsSsprRegistered }
"SSPR-capable   : $($ssprCapable.Count)"
"SSPR-registered: $($ssprRegistered.Count)"

# Every domain the tenant knows about.
Get-MgDomain -All |
  Select-Object Id, IsVerified, IsDefault, IsAdminManaged, AuthenticationType |
  Sort-Object AuthenticationType | Format-Table -AutoSize
VERIFICATION You get an SSPR-capable count and a domain table. In a fresh trial tenant you will see one onmicrosoft.com domain, verified, managed and default. In a real tenant you will see custom domains, and possibly federated ones, which are the focus of Phase D.

What just happened? You captured the starting point on both fronts. The SSPR numbers tell you how much helpdesk load self-service can absorb. The domain list is the raw material for your takeover risk assessment.

Phase B - Configure SSPR correctly

REAL WORLD ANALOGYRequiring two strong proofs for a reset is the bank asking for both your card and your PIN before reissuing anything. Security questions are excluded because they are the equivalent of asking your mother's maiden name, which half of social media already knows. The notification setting is the bank texting you 'your PIN was changed', an early warning that someone else may be doing the changing.

2Set SSPR scope, methods and registration in the portal

Purpose: turn on self-service reset with a strong, appropriate configuration.

Context: these settings live in the Entra admin center. The exact values below are chosen deliberately, each is explained.

Exact portal settings for Protection > Password reset
# Microsoft Entra admin center (entra.microsoft.com)
# Protection > Password reset > Properties
#   Self service password reset enabled = Selected
#   Select a pilot group first (for example 'SSPR-Pilot'), widen to All after validation.
#   Rationale: staged rollout mirrors the report-only discipline from Lab 03.

# Password reset > Authentication methods
#   Number of methods required to reset = 2
#   Methods available to users (tick):
#     - Microsoft Authenticator (push/passwordless)  [strong]
#     - Mobile app code                              [strong]
#     - Email                                        [use with care, see Phase D]
#   Leave UNTICKED:
#     - Security questions   (knowledge-based, weak, phishable/guessable)
#   Rationale: two strong methods raise the bar for takeover via reset.

# Password reset > Registration
#   Require users to register when signing in = Yes
#   Number of days before users are asked to re-confirm = 180
#   Rationale: enforced registration means recovery is ready before it is needed.

# Password reset > Notifications
#   Notify users on password resets = Yes
#   Notify all admins when other admins reset their password = Yes
#   Rationale: a reset notification is an early tamper signal to the account owner.
INFO: admins get the strict policy automatically Administrators always have SSPR enabled, always require two methods, and cannot use security questions, regardless of the tenant setting. This administrator reset policy is enforced by Microsoft and is the standard you should aim to match for all users.

3Enable password writeback for hybrid accounts

Purpose: ensure a cloud reset flows back to on-premises Active Directory, so hybrid users have one consistent recovery path.

Context: password writeback is provided by Microsoft Entra Connect (or Cloud Sync). Without it, a hybrid user who resets in the cloud still has the old password on-premises, which breaks sign-in to domain-joined resources.

Enable writeback and confirm
# In Microsoft Entra Connect (on the sync server):
#   Entra Connect > Customize synchronization options >
#   Optional features > tick 'Password writeback' > complete the wizard.
#
# Then in the Entra admin center:
#   Protection > Password reset > On-premises integration
#     Write back passwords to your on-premises directory = Yes
#     Allow users to unlock accounts without resetting their password = Yes
#
# Cloud-only trial tenants have no on-prem directory, so this phase is
# conceptual here and becomes hands-on in Lab 09 (Hybrid identity).
PRODUCTION CONSIDERATION Password writeback needs the correct permissions delegated to the Entra Connect service account on the on-premises AD (Reset Password, plus write on lockoutTime and pwdLastSet). Get this wrong and resets appear to succeed in the cloud but silently fail to write back.

Phase C - Domain-takeover risk assessment

REAL WORLD ANALOGYThis assessment is a land registry audit: walking every address the company still legally claims and checking whether it genuinely still owns each one. Domain verification works like placing a sign in the garden that only the true owner could place, a DNS record. But if the lease lapses and someone else moves in, they can place their own sign, and the postal service will happily deliver your recovery letters to them.

4Classify every domain by verification, federation and use

Purpose: find domains that are unverified, federated, or stale, the three shapes that create takeover exposure.

Build a domain risk report
$domains = Get-MgDomain -All

# Count how many users actually use each domain as their UPN suffix.
$users   = Get-MgUser -All -Property userPrincipalName
$suffixUse = $users | Group-Object { ($_.UserPrincipalName -split '@')[1] } |
             ForEach-Object { @{ $_.Name = $_.Count } }
$useMap = @{}; $suffixUse | ForEach-Object { $useMap += $_ }

$domainRisk = foreach ($d in $domains) {
  $fed = $null
  if ($d.AuthenticationType -eq 'Federated') {
    $fed = Get-MgDomainFederationConfiguration -DomainId $d.Id -ErrorAction SilentlyContinue
  }
  $userCount = if ($useMap.ContainsKey($d.Id)) { $useMap[$d.Id] } else { 0 }
  $flags = @()
  if (-not $d.IsVerified)                    { $flags += 'UNVERIFIED' }
  if ($d.AuthenticationType -eq 'Federated') { $flags += 'FEDERATED-review-trust' }
  if ($d.IsVerified -and $userCount -eq 0 -and -not $d.IsDefault) { $flags += 'STALE-no-users' }

  [pscustomobject]@{
    Domain    = $d.Id
    Verified  = $d.IsVerified
    Default   = $d.IsDefault
    AuthType  = $d.AuthenticationType
    Users     = $userCount
    IssuerUri = $fed.IssuerUri
    Risk      = ($flags -join '; ')
  }
}

$domainRisk | Sort-Object Risk -Descending | Format-Table -AutoSize
$domainRisk | Export-Csv "domain-risk-$(Get-Date -f yyyyMMdd).csv" -NoTypeInformation
VERIFICATION Every domain is classified with a Risk column. Domains flagged STALE-no-users are removal candidates, FEDERATED-review-trust need their external identity provider validated, and UNVERIFIED should be verified or deleted. Keep the CSV as audit evidence.

5Remediate: remove stale domains and shrink the trust surface

Purpose: eliminate domains you do not need, and convert unnecessary federation to cloud-managed authentication.

Remove a stale verified domain and review federation
# Removing a stale, unused, verified domain (needs Domain.ReadWrite.All).
# A domain can only be removed once no objects reference it.
Connect-MgGraph -Scopes 'Domain.ReadWrite.All','Directory.ReadWrite.All' -NoWelcome

$stale = 'legacy-acquired-domain.example'   # from your STALE-no-users flags
# Confirm no users, groups or apps use it, then:
Remove-MgDomain -DomainId $stale

# For a federated domain you no longer trust, plan a conversion to managed
# (cloud) authentication. This is an impactful change: it moves those users'
# authentication from the external IdP to Entra, so schedule and communicate it.
#   Review with: Get-MgDomainFederationConfiguration -DomainId <domain>
#   Convert with the supported federation-to-managed process (Update-MgDomain
#   authenticationType, plus the documented cutover steps).
CRITICAL Never delete or convert a domain in a live tenant without confirming which users, guests, groups, service principals and mail flow depend on it. Removing an in-use domain breaks sign-in for every account that uses it as a UPN or email suffix. In the lab, only remove domains you created for the exercise.

6Apply registrar and DNS hygiene

Purpose: protect the DNS and registration that anchor every verified domain, the layer Entra cannot protect for you.

The registrar and DNS control checklist
# These are actions at your DNS registrar and DNS host, not in Entra.
# They close the 'expired or externally controlled domain' risk directly.
#
# 1. Enable auto-renew on every domain used by the tenant. An expired domain
#    can be re-registered by anyone, then re-verified into another tenant.
# 2. Enable registrar lock (clientTransferProhibited) to block unauthorised transfers.
# 3. Restrict and MFA-protect registrar and DNS host admin accounts (tier-zero).
# 4. Monitor domain expiry dates and alert well ahead of renewal.
# 5. Consider DNSSEC to protect the integrity of your DNS records.
# 6. Keep the Entra domain-verification TXT record only as long as needed,
#    and audit who at the registrar can change DNS.
# 7. For SSPR/recovery email, avoid alternate email addresses on domains you
#    do not control, an attacker who owns that domain can receive reset codes.
INFO: why this sits in an identity lab A password reset flow, a federated sign-in and a domain verification all ultimately trust DNS. That is why domain governance is an identity control, not a networking afterthought, and why the specialist brief lists it alongside SSPR.
Section 8

Testing and Validation

  1. SSPR end to end: as asmith, go to https://aka.ms/sspr, complete a reset using two registered strong methods, and confirm you receive the reset notification.
  2. Method mix: confirm security questions are not offered as a reset method.
  3. Domain report: re-run the Phase C script and confirm any stale domain you removed no longer appears, and no in-use domain was affected.
  4. Registration: re-run the Lab 01 baseline, the SSPR-registered count should rise as enforced registration takes effect.
SymptomCauseResolution
User cannot resetNot registered for the required number of methodsConfirm enforced registration is on and the user completed combined registration
Remove-MgDomain failsObjects still reference the domainReassign or remove dependent users, groups and apps first
Writeback resets fail silentlyEntra Connect permissions missing on-premDelegate Reset Password plus write on lockoutTime and pwdLastSet
Federated domain shows no configDomain is managed, not federatedExpected, only federated domains return a federation configuration
Section 9

Security Analysis

The domain-takeover attack chain, made concrete

Understanding the threat clarifies every control above. A takeover typically runs as follows: an organisation verifies a custom domain in its tenant, then over time lets the domain registration lapse or loses control of its DNS. An attacker registers the now-available domain, gains DNS control, and can then receive email sent to addresses at that domain, including any recovery or SSPR alternate-email codes. If the domain was federated and the trust was never removed, the exposure is worse, control of the domain can enable issuing or forging tokens for users in it. The fix is to never let a trusted domain fall out of your control, and to remove trust you no longer need.

What makes this configuration sound

Intentionally simplified for the lab

Production hardening

Section 10

Cleanup Instructions

INFO: preserve for the track Keep the SSPR configuration, later labs assume self-service recovery is available. The domain risk CSV is useful evidence to retain.
Optional: revert SSPR scope and disconnect
# To revert the pilot, set Protection > Password reset > Properties >
# 'Self service password reset enabled' back to None in the portal.
# Remove any test domains you created for this lab (Remove-MgDomain).
Disconnect-MgGraph
Section 12

Key Takeaways and Next Lab

Identity Bytes // IB-ENTRA-SEC Track // Lab 05 of 12. British English. For lab and training use against a disposable tenant only.