SQL Account Creation with Password

Detects SQL statements that create database user accounts or logins with embedded passwords, covering SQL Server CREATE LOGIN, MySQL CREATE USER IDENTIFIED BY, and PostgreSQL CREATE USER WITH PASSWORD. Mirrors Snaffler rule KeepSqlAccountCreation.

Type
regex
Engine
boost_regex
Confidence
high
Confidence justification
High confidence: the combination of SQL account-creation keywords and an explicit password clause is highly specific to credential-bearing SQL scripts. DDL without password clauses (CREATE TABLE, CREATE INDEX) does not match.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF
Data categories
credentials
Scope
specific
Platform compatibility
Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Unsupported

Pattern

CREATE\s+(?:USER|LOGIN)\s+[\s\S]{0,200}(?:IDENTIFIED BY|WITH PASSWORD)

Corroborative evidence keywords

GRANT, ALTER LOGIN, sp_addlogin, sysadmin

Proximity: 300 characters

Should match

Should not match

Known false positives

Collections