Conditional Access Policy User Risk and Sign-In Policies

Rico 0 Reputation points
2026-11-16T23:24:32.4066667+00:00

Several weeks ago, a user account was compromised through a device code authentication phishing attack. The compromise was detected by Microsoft Entra ID Protection, and our user-risk Conditional Access policy successfully blocked access. We remediated the account by resetting the user’s password and addressing the original compromise.

Since then, however, we have observed repeated authentication attempts against the same user account from the malicious IP address associated with the original incident. These attempts have continued for approximately a week. The source IP has already been blocked from accessing tenant resources, and the attacker appears to be using the user’s old credentials, so the authentication attempts consistently fail.

The problem is that each malicious failed authentication attempt appears to trigger a new user-risk event for the legitimate user. Our user-risk policy then blocks the user from accessing Microsoft 365 resources, requiring administrative intervention even though the attacker does not possess the user’s current credentials and the authentication attempt itself is unsuccessful.

Is there a supported way to prevent these known malicious, failed authentication attempts from repeatedly elevating the user’s overall risk state, without disabling or significantly weakening the user-risk policy?

Ideally, we would like to continue detecting and logging the hostile authentication attempts while preventing them from repeatedly locking out a user whose account has already been remediated.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-11-16T23:25:46.3266667+00:00

    Microsoft Entra ID Protection does not provide a supported exclusion that suppresses user-risk detections for a particular malicious IP while retaining those events, so first identify the exact detection raising user risk and then replace the user-risk Block control with supported self-remediation where appropriate.

    1. Verify what is actually raising user risk

    A failed authentication appearing at the same time as a risk change does not establish that the failed attempt caused it. Some detections are calculated offline and can appear later.

    1. Go to Microsoft Entra admin center → Protection → Identity Protection → Risk detections.
    2. Filter by the affected user and incident period.
    3. Open each new detection and record:
      • Detection type
      • Risk level and state
      • Detection time and last updated
      • IP address
      • Associated risky sign-in
    4. Open Entra ID → Monitoring & health → Sign-in logs, select the corresponding event, and inspect:
      • Authentication details
      • Status/error code
      • Risk details
      • Conditional Access tab and applied policy

    The Risk detections report exposes the detection type, attack type, source, risk state, and associated sign-ins.^1^ The sign-in log’s Conditional Access tab identifies exactly which policy interrupted the legitimate user.^2^

    This distinction matters because:

    • Password spray detection requires a successful credential match; unsuccessful spray attempts do not generate that detection.^3^
    • Malicious IP address is an offline detection based partly on high invalid-credential failure rates or other reputation data, and can reflect previous malicious activity.^4^
    • Offline detections can take up to 48 hours to surface and unremediated sign-in risks can contribute to aggregate user risk.^5^

    If the report genuinely shows a new Password spray detection generated solely by an invalid old password, preserve the request/correlation IDs and timestamps and open a Microsoft support case; that behavior conflicts with the documented detection semantics.

    2. Avoid administrative lockouts through self-remediation

    If the legitimate user is currently blocked because the user-risk policy uses Block access, change that policy to a self-remediating grant control:

    1. Open Entra ID → Conditional Access → Policies.
    2. Select the policy whose condition is User risk.
    3. Under Access controls → Grant, replace Block access with:
      • Require risk remediation, where available and appropriate; or
      • Require password change for password-based users.
    4. Validate the change in report-only mode or against a controlled pilot group before broad deployment.

    Require risk remediation lets ID Protection choose the appropriate remediation flow for password-based and passwordless authentication. A secure password change remediates user risk; for passwordless scenarios, remediation can revoke sessions and require another sign-in. Block overrides other grant controls, so the same users should not simultaneously be targeted by another user-risk policy that blocks access.^6^

    For sign-in risk, use a separate policy requiring MFA rather than applying the user-wide block. Successful MFA can remediate that risky sign-in before it contributes further to user risk.^7^

    3. Do not suppress or misclassify the hostile activity

    • Do not mark the attacker’s IP as a trusted named location. Trusted locations lower sign-in risk and are intended for organization-controlled networks.
    • Do not select Confirm sign-in safe for a known hostile attempt. That action identifies a false positive and tells the system that similar sign-ins should not be considered risky.
    • Do not use Dismiss sign-in risk for this activity; it is intended for a benign true positive, such as approved penetration testing.
    • Confirm sign-in compromised is accurate for a malicious true positive, but it immediately raises aggregate user and sign-in risk to high, so it is not a suppression mechanism.^8^

    Continue exporting and alerting on failed sign-ins independently of the user-risk enforcement decision. Microsoft recommends monitoring failure code 50126 for invalid credentials and 53003 for Conditional Access blocks, with thresholds adjusted to organizational baselines.^9^

    Blocking the source through Conditional Access does not prevent the initial authentication signal from being processed: Conditional Access location policies are enforced after first-factor authentication. Therefore, a location block can deny resource access while the attempt remains visible to sign-in logging and risk analysis.^10^


    References

    1. Microsoft Entra ID Protection risk reports
    2. Troubleshoot sign-in problems with Conditional Access
    3. How to investigate risk
    4. What are risk detections?
    5. Risk detection types and levels
    6. Risk-based access policies
    7. Remediate risks and unblock users
    8. How To: Give risk feedback in Microsoft Entra ID Protection
    9. Microsoft Entra security operations for user accounts
    10. Block access by location
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Vasileios Dionysopoulos 826 Reputation points
    2026-11-17T06:13:44.2433333+00:00

    Hi Rico,

    Before you tune the policy, I'd check one thing. With device code phishing, the attacker usually ends up with tokens, not just the password, and a password reset doesn't always cut off everything they obtained. If the attempts still raise user risk a week later, they may not be failing the way you think.

    1. Check the error code of the hostile attempts

    In Sign-in logs, filter by the attacker's IP and look at both Interactive and Non-interactive user sign-ins:

    What you see Meaning
    50126 (invalid username or password), interactive only The attacker really only has the old password, so this is the case the existing answer covers
    53003 / 530032 (blocked by Conditional Access) First-factor authentication succeeded. Your IP block stopped them, but they hold a valid credential or token
    Entries under Non-interactive with a refresh token They are replaying a token from the phishing session

    2. If it's anything other than 50126, finish the remediation

    Connect-MgGraph -Scopes "User.ReadWrite.All","Directory.ReadWrite.All","UserAuthenticationMethod.ReadWrite.All"
    $upn = "******@contoso.com"
    
    Get-MgUserRegisteredDevice -UserId $upn | ForEach-Object { Get-MgDevice -DeviceId $_.Id } |
      Select-Object DisplayName, OperatingSystem, RegistrationDateTime   # remove anything created after the phishing date
    Get-MgUserAuthenticationMethod -UserId $upn                          # remove methods the user doesn't recognise
    Revoke-MgUserSignInSession -UserId $upn                              # invalidate all refresh tokens
    

    Device code phishing campaigns often register a device to get a Primary Refresh Token, so the device list matters most. Also check Enterprise apps → User consents for apps the user didn't approve.

    3. Prevent it from happening again

    Create a Conditional Access policy for all users, with Conditions → Authentication flows → Device code flow and the grant Block. Exclude only the accounts that really need device code (for example, meeting room devices).

    Once the attacker's credentials and tokens are gone, the new risk events should stop. If they still show 50126 after this, open a support case with the correlation IDs, as the other answer suggests.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.