Detection rules › Sublime MQL

DLP: Poland Tax Identification Number

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

Detects messages containing Polish Tax Identification Numbers (NIP).

Event coverage

Rule body MQL

type.outbound
and any([body.current_thread.text, subject.subject],
        // Polish NIP: 10 digits in XXX-XXX-XX-XX or XXXXXXXXXX format
        regex.contains(., '\b\d{3}[\s\-]?\d{3}[\s\-]?\d{2}[\s\-]?\d{2}\b|\b\d{10}\b')
)
and any([body.current_thread.text, subject.subject],
        regex.icontains(., 'NIP|tax\s+identification')
)

Detection logic

Scope: outbound message.

Detects messages containing Polish Tax Identification Numbers (NIP).

  1. outbound message
  2. any of [body.current_thread.text, subject.subject] where:
    • . matches '\\b\\d{3}[\\s\\-]?\\d{3}[\\s\\-]?\\d{2}[\\s\\-]?\\d{2}\\b|\\b\\d{10}\\b'
  3. any of [body.current_thread.text, subject.subject] where:
    • . matches 'NIP|tax\\s+identification'

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

Indicators matched (2)

FieldMatchValue
regex.containsregex\b\d{3}[\s\-]?\d{3}[\s\-]?\d{2}[\s\-]?\d{2}\b|\b\d{10}\b
regex.icontainsregexNIP|tax\s+identification