Detection rules › Sublime MQL

DLP: Portugal Tax Identification Number

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

Detects messages containing Portuguese Tax Identification Numbers (NIF).

Event coverage

Rule body MQL

type.outbound
and any([body.current_thread.text, subject.subject],
        // Portuguese NIF: 9 digits
        regex.contains(., '\b[1-3,5,6,8]\d{8}\b')
)
and any([body.current_thread.text, subject.subject],
        regex.icontains(., 'NIF|número\s+de\s+identificação\s+fiscal|tax\s+ID')
)

Detection logic

Scope: outbound message.

Detects messages containing Portuguese Tax Identification Numbers (NIF).

  1. outbound message
  2. any of [body.current_thread.text, subject.subject] where:
    • . matches '\\b[1-3,5,6,8]\\d{8}\\b'
  3. any of [body.current_thread.text, subject.subject] where:
    • . matches 'NIF|número\\s+de\\s+identificação\\s+fiscal|tax\\s+ID'

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

Indicators matched (2)

FieldMatchValue
regex.containsregex\b[1-3,5,6,8]\d{8}\b
regex.icontainsregexNIF|número\s+de\s+identificação\s+fiscal|tax\s+ID