Type something to search...
Detect exposed passwords in plain text with Purview

Detect exposed passwords in plain text with Purview


Introduction

In a Microsoft 365 environment, data breaches aren’t limited to credit card numbers or personal information. A frequently underestimated risk is the sharing of passwords in plain text via emails, files, or Teams conversations.

Thanks to Microsoft Purview, it’s possible to detect this type of behavior using regular expressions (regex) and Sensitive Information Types (SIT).


Why is password detection so complex ?

Unlike a credit card number or an official ID, a password doesn’t follow any universal standard format. This makes it much more difficult to detect.

Sensitive Information Types rely on patterns that combine :

  • Regular expressions
  • Contextual keywords
  • And confidence levels

Problem : a password can be any string of characters, which greatly increases false positives if the detection system is misconfigured.


The Approach : Combining regex and context

The effective approach is to detect not just the password itself, but rather the context in which it appears.

Typical example : password = P@ssw0rd123

In this case, the strategy consists of :

  • Detecting keywords like “password”, “pwd”, “secret”
  • Associating these keywords with a regex that identifies a string resembling a password
  • Adding proximity rules to link the two elements

Regex allows us to define these detection patterns by analyzing the text.


Implementation in Microsoft Purview

With Microsoft Purview, you can implement Data Loss Prevention (DLP) policies to detect this content:

  1. Create a custom Sensitive Information Type (SIT)
    • A primary element (regex to detect a password-like string)
    • Secondary elements (keywords like “password”, “login”, etc.)
  2. Adjust the confidence level
    • Low (high detection rates, but more noise)
    • High (fewer false positives, but more restrictive)
  3. Integrate into a DLP policy
    • Block sharing
    • Display a user warning
    • Generate a security alert

SITs are used in several components : DLP, privacy labels, Insider Risk, etc.


Best practices

For effective detection :

  • Always combine regex with keywords
  • Avoid overly broad regex (otherwise, you’ll get a surge of false positives)
  • Test with different scenarios (Teams, Exchange, SharePoint)
  • Adjust the proximity between the keyword and the detected value

Concrete use case

Some typical scenarios where this approach is useful :

  • A user shares a password in Microsoft Teams
  • An Excel file contains credentials in plain text
  • An email contains a line like: “Here is the password : …”

In these cases, a well-configured DLP policy can :

  • Block the message
  • Notify the user
  • Alert the security team

Conclusion

Plain text password detection is an advanced but critical security feature in Microsoft 365. Thanks to Microsoft Purview’s customization capabilities, it’s possible to implement intelligent, context-based detection rather than simple brute-force filtering. When properly configured, this approach reduces the risk of credential leaks without penalizing users with excessive false positives.


Sources

Microsoft - Techcommunity


Did you enjoy this post ? If you have any questions, comments or suggestions, please feel free to send me a message from the contact form.

Don’t forget to follow us and share this post.

Related Posts

Email verification of external Teams participants

Email verification of external Teams participants

Introduction Microsoft Teams Premium introduces a new feature to enhance the security and reliability of your meetings: email verification for external participants. This feature allows mee

Read More
How to activate Microsoft 365 Passkey in Entra ID

How to activate Microsoft 365 Passkey in Entra ID

Introduction Microsoft 365 Passkey is an authentication method that replaces passwords with more secure options like facial recognition, fingerprint, or a PIN.Prerequisites **<

Read More
How to sign in with Passkey to Microsoft 365

How to sign in with Passkey to Microsoft 365

Introduction Microsoft 365 Passkey is an authentication method that replaces passwords with more secure options like facial recognition, fingerprint, or a PIN.Prerequisites **<

Read More
How to enable LAPS on the MTR Admin account via Intune

How to enable LAPS on the MTR Admin account via Intune

Introduction Microsoft's LAPS (Local Administrator Password Solution) is a free tool designed to improve password security for local administrator accounts on workstations, servers and

Read More
Microsoft Purview for Azure Data Lake and Blob Storage

Microsoft Purview for Azure Data Lake and Blob Storage

Introduction Microsoft announced that Microsoft Purview protection policies for Azure Data Lake and Blob Storage are now available in all regions. This advancement allows organization

Read More
Impact analysis of Entra ID conditional access policies

Impact analysis of Entra ID conditional access policies

Introduction Conditional access in Entra is a security policy that allows administrators to control access to applications and resources based on specific conditions. These conditions can i

Read More
How to create a Windows local admin account via Intune LAPS

How to create a Windows local admin account via Intune LAPS

Introduction I wrote an article last February on how to replace the password of your MTR's local account using LAPS (Local Administrator Password Solution) in Intune. I concluded my article

Read More
New security approach for non-compliant emails

New security approach for non-compliant emails

Introduction Microsoft has announced a major update to Defender for Office 365 that strengthens email security by improving the handling of non-RFC compliant emails. This initiative is

Read More
Blocking screenshots during Teams meetings

Blocking screenshots during Teams meetings

Introduction Microsoft Teams continues to strengthen the privacy and security of online meetings. Starting in July 2025, a new feature will be rolled out to prevent screenshots during meeti

Read More
"Anti-Tampering" certification for Defender for Endpoint (2025)

"Anti-Tampering" certification for Defender for Endpoint (2025)

Introduction Microsoft recently announced that Microsoft Defender for Endpoint has successfully passed the 2025 anti-tampering tests conducted by AV-Comparatives, a recognized independe

Read More
How to enable DLP for Teams with Purview

How to enable DLP for Teams with Purview

Introduction In a context where sensitive data, particularly banking information, is increasingly circulating in collaborative tools, businesses must be extra vigilant to avoid accidental o

Read More
How to enable DLP for Outlook with Purview

How to enable DLP for Outlook with Purview

Introduction Last week, I showed you how to enable DLP for Teams with Microsoft Purview to prevent accidental or malicious data leaks (Data Loss Prevention). Purview is a comprehensive

Read More
Entra Private Access for Domain Controllers

Entra Private Access for Domain Controllers

Introduction Microsoft has announced the Public Preview of Microsoft Entra Private Access for Active Directory Domain Controllers, a major step forward in strengthening the security of

Read More
Sensitive content detection in Teams meetings

Sensitive content detection in Teams meetings

Introduction In a world where business interactions increasingly take place via video conferencing, the security of information shared in meetings is becoming a major issue. Microsoft is ad

Read More
How to activate Defender EDR in "Block Mode"

How to activate Defender EDR in "Block Mode"

Introduction In a context of constantly evolving cyber threats, antivirus solutions are no longer sufficient to effectively protect workstations. Microsoft Defender for Endpoint's *Block

Read More
How to enable DSPM for AI with Purview

How to enable DSPM for AI with Purview

Introduction With the rise of generative AI models, the phenomenon of Shadow AI (the use of artificial intelligence tools and services not approved or controlled by organizations) is incr

Read More
How to block a website URL in Edge with Defender

How to block a website URL in Edge with Defender

Introduction Web browsing is one of the most common attack vectors in business environments. To strengthen security, Microsoft Defender for Endpoint offers a powerful feature : blocking m

Read More
How to enable DLP for cloud storage with Purview

How to enable DLP for cloud storage with Purview

Introduction A few months ago, I showed you how to enable DLP for Outlook with Microsoft Purview to prevent accidental or malicious data leaks (Data Loss Prevention). Purview is a com

Read More
Blocking screen captures in Teams meetings

Blocking screen captures in Teams meetings

Introduction In a world where business interactions increasingly take place via video conferencing, the security of information shared in meetings is becoming a major issue. A simple screen

Read More
Extend Zero Trust to AI agent identities in Entra ID

Extend Zero Trust to AI agent identities in Entra ID

Introduction AI agents are becoming increasingly widespread in businesses (incident summaries, log analysis, flow execution, etc.), and it is crucial that their access is continuously evalu

Read More
How to enable DLP for printing with Purview

How to enable DLP for printing with Purview

Introduction A few weeks ago, I showed you how to enable DLP to prevent the copying of financial data to an external cloud storage solution using Microsoft Purview, in order to prevent

Read More
How to enable DLP for AI websites with Purview

How to enable DLP for AI websites with Purview

Introduction Last week, I showed you how to enable DLP to prevent printing of financial data using Microsoft Purview, in order to prevent accidental or malicious data leaks (*Data Loss

Read More
How to enable DLP for copy/paste with Purview

How to enable DLP for copy/paste with Purview

Introduction Last month, I showed you how to enable DLP to prevent financial data from being sent to an AI website using Microsoft Purview, in order to prevent accidental or malicious d

Read More
Purview Sensitivity Labels are coming to OneNote

Purview Sensitivity Labels are coming to OneNote

Introduction Good news for security and compliance teams, Sensitivity Labels are now General Availability in OneNote. This update finally allows you to apply the same classification a

Read More
How to block Teams calls and chats with Purview IB

How to block Teams calls and chats with Purview IB

Introduction Microsoft Purview's Information Barriers allow you to restrict communication and collaboration between specific user groups within a Microsoft 365 environment. Their prim

Read More
External MFA is now available in Entra ID

External MFA is now available in Entra ID

Introduction Microsoft has announced the General Availability of External MFA, in Microsoft Entra ID, formerly known as External Authentication Methods. This feature allows the use

Read More
How to create Sensitivity Labels for emails in Purview

How to create Sensitivity Labels for emails in Purview

Introduction Emails remain one of the primary vectors for information leaks in businesses. Whether it's a message sent to the wrong recipient, an attachment forwarded without proper oversig

Read More
How to secure your emails with Sensitivity Labels

How to secure your emails with Sensitivity Labels

Introduction Last week, I showed you how to create Sensitivity Labels to secure your emails, without explaining how they work. Today I'll talk about how to use them and what results you g

Read More