Detection rules › Sublime MQL

DLP: Spain Tax Identification Number

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

Detects messages containing Spanish Tax Identification Numbers (NIF).

Event coverage

Rule body MQL

type.outbound
and any([body.current_thread.text, subject.subject],
        // Spanish NIF: 8 digits + 1 letter or 1 letter + 7 digits + 1 letter
        regex.contains(., '\b(?:[A-Z]?\d{7,8}[A-Z])\b')
)
and any([body.current_thread.text, subject.subject],
        regex.icontains(., 'NIF|número\s+de\s+identificación\s+fiscal|tax\s+ID')
)

Detection logic

Scope: outbound message.

Detects messages containing Spanish Tax Identification Numbers (NIF).

  1. outbound message
  2. any of [body.current_thread.text, subject.subject] where:
    • . matches '\\b(?:[A-Z]?\\d{7,8}[A-Z])\\b'
  3. any of [body.current_thread.text, subject.subject] where:
    • . matches 'NIF|número\\s+de\\s+identificación\\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(?:[A-Z]?\d{7,8}[A-Z])\b
regex.icontainsregexNIF|número\s+de\s+identificación\s+fiscal|tax\s+ID