Repository navigation
DLP: honour a file policy's file_filters (backend contract #326) - #372
Merged
Merged
Conversation
The backend's merged contract (Compliance-OS#562) lets a policy carry
file_filters {types, min_bytes, max_bytes}, and the agent ignored them, so a
policy meant for some file types applied to every file.
- Types are lowercase extensions or detected types: a policy matches a file
by its extension, its detected type (ooxml.xlsx) or the detected type's
last part (xlsx), so a renamed file is still caught by its content.
Archive entries are filtered on their own name and type.
- Sizes filter before the scan: a file outside every policy's size range is
not read at all.
- file_filters are decoded tolerantly: unreadable ones are reported as a
compile error and the policy applies to every file (a bad filter must not
silence a policy, nor reject the clipboard's bundle).
Refs #326
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
neamul602
enabled auto-merge
November 2, 2026 10:11
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
# Conflicts: # CHANGELOG.md
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Follow-up to the backend's merged file DLP contract (BrainStation-23/Compliance-OS#562, #566), which @Warhammer4000 confirmed on #326.
I compared the merged
docs/dlp.mdwith the agent field by field. The bundle'smodules.files, the exception shapes, the event objects and the capability gating all match. One gap: policies can carryfile_filters(types,min_bytes,max_bytes), which the agent ignored. A policy meant only for some file types would have applied to every file.Change
Types are lowercase extensions or detected types, as the backend validates them. A policy matches a file by:
ooxml.xlsx);xlsx), so a renamed file is still caught by its content.Archive entries are filtered on their own name and type, so an
xlsxpolicy also catches a spreadsheet inside a zip.Sizes apply before the scan: a file outside every policy's size range isn't read at all.
Unreadable filters are reported as a compile error, and the policy applies to every file. A bad filter must neither silence a policy nor reject a bundle the clipboard depends on.
Test plan
XLSX,.pdf); the size and type rules (including a renamed file); malformed filters tolerated and reported.xlsxentry in a zip matches; an entry of another type doesn't.make verify-crossand the changelog check pass.Refs #326
🤖 Generated with Claude Code