Blog Post

Microsoft Entra Blog
3 MIN READ

Public Preview: Token Protection for Sign-In Sessions

paulgarn's avatar
paulgarn
Former Employee
May 10, 2023

At the recent https://secure.microsoft.com/en-US/sessions/6ab7d30b-6322-483e-a3f3-34856e51bb15?source=sessions, we announced a new feature called Token Protection for sign-in sessions. This is the first in a series of Microsoft Entra features designed to combat token theft and replay attacks. 

 

As you may know, attacks involving token theft are becoming more frequent. To address this, we at Microsoft are making comprehensive investments to allow you to use Azure AD Conditional Access to better protect your critical resources. 

 

Our solutions aim to provide better security characteristics than previous approaches to combat token theft. This includes resistance to malware attacks on user devices that steal tokens and malicious insider activity. Additionally, our solutions provide fine-grained control over policy enforcement using Conditional Access. 

 

Token Protection ensures that tokens can only be used on the intended device. When enforced through Conditional Access policies, tokens authorizing access to resources must come from the device where the user originally signed in. This provides the best available protection for your high-value users and data against breaches involving token theft. 

 

The first preview of this feature allows you to protect Office 365 resources such as Exchange mailboxes and SharePoint sites from illegitimate access using stolen Windows native client Refresh Tokens. We’re targeting Refresh Tokens for protection first as they tend to be longer-lived and more broadly scoped than other types of tokens and are therefore more valuable for an attacker to steal. Future releases will extend this protection to more applications and data, other client platforms, and other types of tokens. 

 

I'll give you a brief overview of how you can enable this.  

 

Conditional Access enforcement of token protection for sign-in sessions (preview) 

 

 

By selecting “Require token protection for sign-in sessions” under Conditional Access Session Controls, sessions used to access resources defined in the scope of the policy will be required to be bound to the device the user signed in to using proof-of-possession. Proof-of-possession requires that the client can show it has access to a private key on the device. If access is attempted using a Refresh Token stolen from a user’s device and moved to a device an attacker controls, the proof-of-possession can’t be accomplished, and access will be blocked by the policy.  

 

Here are some configuration notes specifically for this initial preview: Supported resources are Exchange and SharePoint. Support for Teams is coming soon, and other services will be added soon.  

 

Registered Windows 10 or 11 devices and currently only native desktop applications are supported. To avoid blocking legitimate access from web apps and other client platforms: under the Conditions, Device platforms tab, you should select just ‘Windows’, and under the Conditions, Client apps tab, you should select Mobile clients and desktop apps only, leaving ‘browser’ unselected.  

 

 

 

 

As with other policies, you should scope it to specific users or groups, and ensure you have specific accounts excluded to ensure there is always management access to your tenant. Please read the https://learn.microsoft.com/en-us/azure/active-directory/conditional-access/concept-token-protection carefully before planning to deploy an enforcement policy. For legitimate access, the policy requires that users have compliant OS and app versions that can perform the proof-of-possession steps. We highly recommend using Conditional Access report-only mode to evaluate the impact of the policy in your environment before turning it on. Also, please remember that protecting tokens using proof-of-possession should be regarded as one part of a Zero Trust defense-in-depth strategy, which should include device management and compliance, and the use of cloud-based phishing-resistant authentication. 

 

Upcoming releases on the Token Protection roadmap include: 

 

  • More resources and access scenarios. 
  • The addition of web applications to improve defense-in-depth capabilities for web applications using MSAL.js.   
  • Sign-in session token protection to address refresh token theft scenarios on Mac, iOS, Android, and Linux clients. 
  • App session token protection, using Compliant network check enforcement with Entra Global Secure Access which limits theft and replay of access tokens and application cookies on the data plane.

 

We’re looking forward to sharing more about these. Look out for future blog posts for details. 

 

 

Learn more about Microsoft identity: 

  • Get to know Microsoft Entra – a comprehensive identity and access product family 
  • Return to the Microsoft Entra (Azure AD) blog home 
  • Join the conversation on https://twitter.com/azuread/status/1278418103903363074 and https://www.linkedin.com/showcase/microsoft-security/ 
  • Share product suggestions on the https://feedback.azure.com/d365community/forum/22920db1-ad25-ec11-b6e6-000d3a4f0789 
Updated Sep 30, 2024
Version 2.0

17 Comments

  • Hi Tom-irp 

    This is not the expected behavior, I'm guessing this is related to Outlook version.  Can you please share Outlook version , is it a professional plus distribution  ? 

  • Tom-irp's avatar
    Tom-irp
    Brass Contributor

    We are testing this out, and have applied it to Exchange Online and SharePoint online only as per the document. One user cannot completely open the outlook app as it says, "you must register or enroll device."  This device is AD joined and appears in Intune.  Azure Portal Sign-in logs show something confusing.

     

    He has success using a private window in Edge, 114.0.1823. Office 365 Exchange Online, he can get mail though the browser.

    When he opens Outlook, we get the registration message above. The failing application is Microsoft Office Desktop Apps and Client.

    Browser
    Edge 18.19045  *** note this is different that the browser.
    Operating System  Windows 10
    Compliant  Yes
    Managed Yes
    Join Type Azure AD joined
     
    Access has been blocked due to condition access policies    
    Require token protection for sign-in sessions (Preview) - Failure
  • paulgarn's avatar
    paulgarn
    Former Employee

    Hi testuser7 

     

    Apologies for the late reply.  Yes, MSAL.js apps will be able to request tokens via the broker and benefit from using bound token flows and being compliant with Token Protection enforcement CA policies.   We're still working on support in Windows to enable it, so look out for announcements. 

  • testuser7's avatar
    testuser7
    Brass Contributor

    Perfect !!! Thanks paulgarn for quick confirmation.

    On that note, the last line in your blog says that  Token Protection roadmap include following 

    "The addition of web applications to improve defense-in-depth capabilities for web applications using MSAL.js.  "

     

    Does that mean that msal.js from browser will be able to talk with broker/WAM  ??  This means that SPAs can be part of the discussion. Am I right ?

     

    thanks.

  • paulgarn's avatar
    paulgarn
    Former Employee

    Hi testuser7   

    Thanks for your question.   Yes, that is correct.   On a registered Windows device WAM manages a device PRT tied to the device registration which can only be used with access to key material stored in a TPM if present.  The PRT is the "bound refresh token" and to comply with the Conditional Access Policy for a resource an application must request Access Tokens for that resource via WAM and using the PRT rather than a bearer refresh token.   Supported Microsoft Applications such as Office apps already do that, and others are on the way.   

    Other applications can support this by using the latest MSALs, most of which now enable requests to be directed through WAM.  Eventually they will do so by default.

    Look out for further content with more details on how it works in the near future.

  • testuser7's avatar
    testuser7
    Brass Contributor

    Thanks paulgarn for this blog as it is a good starting point in token protection/zero-trust use-cases.

     

    I have one quick tech point to confirm with you.   As we know this feature makes sure that we are using Refresh-token from the device which originally got it.

    For that the app to uses the  Web-Account-Manager (WAM)  which is integral part of Windows and uses the  Cloud-AP  to collect the new Refresh-token.

    During that flow, WAM has to use the device-cert for attestation.

     

    Is it correct to say that,  with the help this CA-policy,   we enforce and compel the app to  take  WAM-route and NOT go directly i.e., without broker  to fetch the access-token  ??

     

    Thanks.