PowerShell Credential Objects with Plaintext Password

Detects PowerShell credential constructs that embed plaintext passwords, including ConvertTo-SecureString with -AsPlainText and [Net.NetworkCredential]::new() calls. Mirrors Snaffler rule KeepPsCredentials.

Type
regex
Engine
boost_regex
Confidence
high
Confidence justification
High confidence: ConvertTo-SecureString with -AsPlainText is the canonical PowerShell plaintext-password anti-pattern, explicitly warned against in Microsoft documentation. [Net.NetworkCredential]::new() with inline strings is equally specific.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, PCI-DSS
Data categories
credentials, security
Scope
specific
Platform compatibility
Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Compatible

Pattern

ConvertTo-SecureString[\s\S]{0,80}-AsPlainText

Corroborative evidence keywords

ConvertTo-SecureString, -Force, Get-Credential, password, AsPlainText

Proximity: 300 characters

Should match

Should not match

Known false positives

Collections