Detection rules › Sublime MQL

DLP: Sweden National ID

Severity
high
Type
dlp
Source
github.com/sublime-security/sublime-rules

Detects messages containing Swedish National ID numbers (personnummer).

Event coverage

Rule body MQL

type.outbound
and any([body.current_thread.text, subject.subject],
        // Swedish Personnummer: YYYYMMDD-XXXX or YYMMDD-XXXX
        regex.contains(., '\b(?:\d{8}|\d{6})[\s\-]\d{4}\b')
)
and any([body.current_thread.text, subject.subject],
        regex.icontains(., 'personnummer|national\s+ID')
)

Detection logic

Scope: outbound message.

Detects messages containing Swedish National ID numbers (personnummer).

  1. outbound message
  2. any of [body.current_thread.text, subject.subject] where:
    • . matches '\\b(?:\\d{8}|\\d{6})[\\s\\-]\\d{4}\\b'
  3. any of [body.current_thread.text, subject.subject] where:
    • . matches 'personnummer|national\\s+ID'

Inspects: body.current_thread.text, subject.subject, type.outbound. Sensors: regex.contains, regex.icontains.

Indicators matched (2)

FieldMatchValue
regex.containsregex\b(?:\d{8}|\d{6})[\s\-]\d{4}\b
regex.icontainsregexpersonnummer|national\s+ID