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 scans the text content of files before they are compressed. If a file matches a rule marked to block, the archive operation is refused and the match is recorded in the audit log. 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).

2.1 Example policy.json

{
  "dlp": {
    "enabled": true,
    "rules": [
      { "name": "US SSN", "pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b", "action": "block" },
      { "name": "Credit card", "pattern": "(?i)\\b(?:\\d[ -]*?){13,16}\\b", "action": "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 standard regular expressions, matched against the extracted text of each file.
  • Case-insensitive matching: prefix the pattern with (?i). Slim Archiver recognizes this prefix and applies case-insensitivity — e.g. (?i)confidential.
  • Matching is global — a rule triggers on the first match found in a file.
Which files are scannedDLP scans text it can extract: .txt .json .xml .csv .html .md, Office documents (.docx .xlsx .pptx, via their internal XML), and .pdf. Files it cannot read as text (images, video, already-compressed binaries) carry no scannable text and pass the scan.
Keep patterns efficientPatterns run against file content, so avoid catastrophic-backtracking constructs (e.g. nested quantifiers like (a+)+). Slim Archiver bounds how much text a single pattern is run against to keep a careless pattern from stalling — see section 5.

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 which rule blocked the operation.
(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 treats anything it cannot fully evaluate as a block when DLP is enabled:

  • A file too large to scan (over the read limit) is blocked rather than passed unscanned.
  • A file whose extracted text exceeds the per-pattern scan limit is blocked.
  • A rule whose regular expression is invalid (won't compile) causes the file to be blocked — the scan could not be evaluated, so it fails closed.
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. Note that the log directory is under ProgramData; protect it with appropriate file-system permissions, and consider forwarding events to your central audit system (Windows Event Log / SIEM), which the app also supports.

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; confirm the file type is text-scannable (section 3).
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.
Large files are blockedFiles over the scan size limit fail closed. This is expected; split or exclude very large files, or review the file.
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.