Map MIME Types With Legacy Content Signatures
The Content Signatures section maintains the content-signature database and libmagic MIME detection used across SafeSquid. It helps identify actual file types, bypassing deceptive file extensions — but live connection tagging for policy uses Response Types in the current build.Custom rows are merged into
content4.xml under /var/lib/safesquid/content_signatures/. Tag names still appear in DLP and UI pickers even when the request-time hooks are inactive.Core mechanics
What runs at runtime today
- On config load and on scheduled update, SafeSquid may download vendor
content4.xmland reload the merged database. - Custom rows from the Web UI are saved to the dev copy of
content4.xmlwhen the section is displayable. - The internal MIME engine uses the libmagic database from this directory for body type detection (also used by DLP, logging, and Response Types).
- The request-time hooks are not implemented — list rows do not add or remove connection tags at request time in the current build.
Global Enabled
When off, the section reports itself disabled — signature database download/reload and MIME library setup are affected. List rows are still persisted even when the request-time hooks are inactive.Subsections
- Content Signatures List — MIME regex rows plus tags to add. Stored in config; not applied on connections at request time today.
- Content Categories List — Category names for autocomplete and grouping in signature rows.
- Content File Extensions — Extension regex rows plus extension tags. The matching request-time hook is not implemented.
Legacy UI options
Selectors such as Transfer Encoding Chunk, multi-part byte-range, and Trace Entry under Content Signatures are not bound to any template field in this tree. They have no effect here (the same labels on Response Types do affect matching).Schema fields
None of the fields below are matched against live traffic in the current build — see the warnings above.Global
enabled— master switch for signature database download/reload and MIME-detection library setup. Entries you add are saved regardless of this setting.
Content Signatures List
enabled— off skips the entry on save or reload.comment— administrator note.- Mime type (
valueField) — a regex such as^text/htmlor^image/; blank represents all MIME types. add_content_signatures— the signature value(s) this entry defines.- category (
group) — category value(s) associated with this entry.
Content Categories List
enabled,comment,add_content_category— same fields as above, applied to a category definition rather than a signature.
Content File Extensions
enabled,comment— same fields as above.- File Extension (
valueField) — a regex. Comma-separated patterns are combined as an OR, the same convention Response Types uses; blank represents all extensions. add_file_extensions,group— the extension value(s) this entry defines, and its category.
Examples
How to verify
- Check module stats / Reports for content signature load or download status.
- After editing rows, confirm
content4.xmlunder/var/lib/safesquid/content_signatures/updates. - For live tagging, verify
response_profilesin Detailed logs, not content signature hooks.

