Data Loss Prevention — Rules Reference ENT

Defining content-scanning rules that block sensitive data from being archived, and reading the DLP audit log.

Audience: IT / security administrators · Applies to: Slim Archiver Enterprise.

What DLP does

When DLP is enabled, Slim Archiver reads the content of every file before it is compressed and matches it against your rules. What a file is decided from its content (its first bytes), not from its name or extension, so renaming a file does not change how it is scanned. If a file matches a rule marked to block, or cannot be inspected (section 5), the archive operation is refused. DLP is configured entirely through your machine policy file.

1. Where DLP is configured

DLP rules live in the machine policy file, under a dlp section:

C:\ProgramData\Slim Archiver\policy.json

DLP is active only when the section is present, enabled is true, and at least one rule is defined. Save the file as UTF-8; a leading byte-order mark (BOM) is tolerated.

2. Policy structure

The dlp section has an enabled flag and a rules array. Each rule has three fields:

FieldRequiredMeaning
nameyesA label for the rule. Appears in the audit log and in the block message.
patternyesA regular expression matched against the file's text content (see section 3).
actionyesWhat to do on a match. block refuses the operation. Any other value logs the match only (see section 4).

The dlp section can also set blockUnscannedArchives (default false). When it is true, an archive that DLP cannot open (7z, RAR, gzip, xz, bzip2, zstd, CAB or .slim, also inside a ZIP) blocks compression instead of passing unscanned (section 3.1).

2.1 Example policy.json

{
  "dlp": {
    "enabled": true,
    "blockUnscannedArchives": true,
    "rules": [
      { "name": "US SSN", "pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b", "action": "block" },
      { "name": "Confidential marking", "pattern": "(?i)\\bstrictly confidential\\b", "action": "block" },
      { "name": "Project codename (monitor)", "pattern": "(?i)\\bproject aurora\\b", "action": "log" }
    ]
  }
}

The first two rules block; the third only records a match in the audit log (any action other than block).

Escape backslashes in JSONBecause pattern is written inside JSON, every backslash must be escaped — a regex \d is written \\d in the file.

3. Writing patterns

  • Patterns are JavaScript regular expressions, matched against the text DLP reads from each file (section 3.1).
  • Case-insensitive matching: include (?i), normally at the start of the pattern; the whole pattern is then matched case-insensitively, e.g. (?i)confidential.
  • A rule triggers on the first match in a file; each matching rule is logged once per file, and a rule whose action is block stops the scan of that file.

3.1 What DLP reads

What the file is (from its content)What is matched
Text (UTF-8, UTF-16), any extension, any sizeThe whole file, 4 MiB at a time, each window overlapping the previous one by 64 KiB, so a match up to 64 KiB long is never split.
Word, Excel, PowerPoint (.docx .xlsx .pptx) and OpenDocumentThe text of every XML part: body, headers, footers, comments, notes, sheets, slides. An encrypted or unreadable document is blocked (section 5).
Older Office files (.doc .xls .ppt .msg) and other binary dataIts readable strings: runs of 6 or more ASCII or UTF-16 characters.
PDFIts literal and hex text strings, also inside compressed (FlateDecode) streams. Text drawn with fonts that have no direct character encoding is not recovered.
ZIP archiveEach entry, one level deep, read like a file by its content (Office documents inside included). A ZIP inside a ZIP is not opened. An encrypted entry is blocked.
Other archives: 7z, RAR, gzip, xz, bzip2, zstd, CAB, .slimNot opened. They pass, unless blockUnscannedArchives is true (then they block).
Programs (.exe, .dll) and media (images, audio, video)Not scanned; they pass.
Keep patterns efficientPatterns run against file content, so avoid catastrophic-backtracking constructs (e.g. nested quantifiers like (a+)+). A text file is matched 4 MiB at a time; the text of an Office, PDF or ZIP file (at most 100 MB, section 5) is matched whole.

4. Actions & what happens on a match

When a rule matches a file, the match is always written to the audit log. What happens next depends on the rule's action:

action valueEffect
blockThe compression is refused. The file, rule name, and a masked snippet are logged. The user sees the error card “Data Loss Prevention Block” with the message DLP Violation: sensitive data matched rule "<rule>" in file "<file>". Compression blocked.
(any other value)The match is logged only — the operation is not stopped. Use this for monitoring a pattern without enforcing it.
Important — only “block” enforcesThe enforceable action is block. A rule with any other action value produces an audit entry but does not stop the archive. If you intend a rule to prevent archiving, its action must be exactly block.

5. Fail-closed behavior

So that DLP cannot be silently bypassed, Slim Archiver blocks a file it cannot inspect when DLP is enabled:

  • An Office, OpenDocument, ZIP or PDF file over 100 MB, or a ZIP entry over 100 MB (these are read whole). Text files have no size limit (section 3.1).
  • An encrypted or unreadable Office document, an encrypted ZIP entry, an unreadable ZIP, or a file that cannot be opened.
  • A rule whose regular expression is invalid (it won't compile): the first file it is applied to is blocked.
  • With blockUnscannedArchives set to true: an archive DLP cannot open.

In these cases the user sees the error card “Data Loss Prevention: File Not Inspected” (not a rule match), and the message names the file and the reason, e.g. File "big.pdf" was not inspected by DLP: File could not be scanned by DLP (oversize); blocked by fail-closed policy. Compression blocked. These blocks are recorded too (section 6).

Consequence for rule authorsBecause an invalid pattern fails closed, a typo in a rule's regex will block users until it is fixed — this is deliberate (a broken rule must not silently pass data), but it means you should test rules before deploying them widely. See section 7.

6. The DLP audit log

Matches are recorded to:

C:\ProgramData\Slim Archiver\Logs\dlp_audit.log

Each entry is a single line:

[2026-01-15T09:30:00.000Z] USER=jdoe FILE="C:\path\file.txt" RULE="US SSN" ACTION=block MATCH="12********89 (len=11)"

The matched value is masked — only the first and last two characters and the length are kept, so the log helps you triage without storing the sensitive data it detected. A file blocked because it could not be inspected (section 5) is recorded with RULE="(unscannable)", "(unscanned archive)" or the invalid rule's name, and REASON="..." (the explanation the user sees) instead of MATCH, e.g.:

[2026-01-15T09:31:00.000Z] USER=jdoe FILE="C:\path\data.7z" RULE="(unscanned archive)" ACTION=block REASON="An archive DLP cannot open (7z, RAR, gzip, ...) is blocked by policy (dlp.blockUnscannedArchives)."

Every entry also goes to the application's audit trail: C:\ProgramData\Slim Archiver\Logs\audit.log (Enterprise license), the Windows Event Log when the policy sets writeToEventLog, and a syslog / SIEM endpoint when it sets syslogEndpoint. If dlp_audit.log cannot be written, the event is sent to the Windows Event Log in any case and the user's block message ends with a warning. The log directory is under ProgramData; protect it with appropriate file-system permissions.

Masking is not a substitute for access controlMasking limits exposure if the log is read, but the log still lists file paths, users, and rule names. Restrict access to the Logs directory with NTFS permissions.

7. Testing a rule (recommended before deployment)

  • On a test machine, enable DLP with your new rule in policy.json.
  • Create a throwaway file whose content matches the pattern; attempt to compress it.
  • Confirm the operation is blocked and an entry appears in dlp_audit.log naming your rule.
  • Create a file that should NOT match; confirm it compresses normally.
  • Because a bad pattern fails closed, verify the rule compiles by confirming normal (non-matching) files still compress after the rule is added.

8. Troubleshooting

SymptomMeaning & fix
DLP never triggersConfirm dlp.enabled is true and at least one rule exists; check what DLP reads for that kind of file (section 3.1).
A rule matches but doesn't blockThe rule's action isn't exactly “block”. Set action to block.
Everything is blocked after adding a ruleThe rule's pattern is invalid (fails closed). Fix the regex; remember JSON backslash escaping.
“File Not Inspected” for a large fileOffice, OpenDocument, ZIP and PDF files over 100 MB cannot be inspected and fail closed. Text files of any size are scanned.
A .7z or .rar file passesArchives DLP cannot open pass unless blockUnscannedArchives is true (section 2).
Policy changes have no effectCheck the path (C:\ProgramData\Slim Archiver\policy.json) and that the JSON is valid; a malformed file is not applied.