I created a minimal Clojure wrapper for ClamAV. I used in several projects as first layer protection at AI projects. https://github.com/damesek/clamav-clj (alpha)
It provides a simple API to scan files, streams, or byte arrays for viruses, includes a Ring Middleware for automatic file upload scanning, and offers a Mock mode for easy testing without a running ClamAV instance.
๐ก๏ธ Ring Middleware: Drop-in protection for file uploads.
๐งช Mock Mode: Test your application logic without running ClamAV (supports clean, infected, and error simulation).
๐ Polymorphic Input: Scan java.io.File, java.io.InputStream, byte[], or file paths (`String`) seamlessly.
โข โ Stable Backend: Built on top of the xyz.capybara/clamav-client Java library.
In details about ClamAV, why good idea to use:
1. Recursive Archive Scanning: Automatically unpacks and scans nested compressed files (ZIP, RAR, 7z, TAR) in memory to find hidden malware.
2. Document & Macro Analysis: Detects macro viruses and embedded exploits within Microsoft Office documents, PDFs, and HTML files.
3. Broad Format Support: Identifies threats in executables (Windows EXE, Linux ELF, macOS Mach-O), raw emails (including attachments), and image files.
4. Static Analysis: Uses signature-based detection to identify known malware patterns efficiently without executing the files.