XWiki attachment virus scanning with ClamAV

XWiki attachment virus scanning uses the Antivirus Application to hand files to a ClamAV daemon, blocking infected uploads and reporting scheduled full-scan results to administrators. This page covers the design choices, setup sequence, sizing and the items to confirm before relying on it.

On this page

How XWiki attachment virus scanning with ClamAV stops infected uploads

The Antivirus Application, working with a ClamAV daemon, blocks infected files at upload and runs scheduled full scans of stored attachments, with reports sent to administrators. A team needs this when people upload files to XWiki pages from laptops, email or outside partners, and the security team must show that those files were checked before colleagues open them. The Antivirus Application is an extension distributed through the XWiki Store, so it is installed and updated like other XWiki extensions. Its exact behavior, configuration settings and the XWiki lines it supports must be confirmed in that extension's own documentation, since this page does not cover its configuration details. Treat the points below as questions to put to that documentation and to your own test instance.

Settle three decisions before installation. First, decide what happens when the ClamAV daemon cannot be reached or cannot scan a file. A fail closed setting holds uploads until scanning works, which protects confidentiality but can stop contributors during an outage. A permissive setting keeps work moving but leaves a gap. Confirm which behavior the extension offers and which one it uses by default. Second, confirm whether blocking applies to every upload path into the wiki or only to some, because attachments added through other interfaces may not pass the same check. Third, confirm who receives scan reports, through which channel, and how an administrator should handle a detection, including whether the infected file is removed, quarantined or left for review.

How an attachment moves from upload to ClamAV verdict

It starts when a user uploads an attachment in the browser. The XWiki application on Tomcat, with the Antivirus Application, passes the file to the ClamAV daemon on a local or separate scanning host. The boundary between the wiki host and that scanning host is the point to check: confirm which network path carries the file and how the wiki connects to the daemon. The verdict decides the outcome. Clean files go to the attachment store, and infected uploads are rejected. A scheduled full-scan job re-reads stored attachments and writes a report to administrators. That report is where sensitive filenames appear, so limit who can open it.

Upload path, accept or reject verdict, and the scheduled full scan with its admin report.

Which scanning mode fits which attachment store

This table compares the scanning modes and daemon placements for XWiki attachments scanned by the Antivirus Application and ClamAV. Read each row for what it protects against, what it costs to run and when it fits. Upload blocking alone leaves older attachments unchecked, so plan for scheduled full scans as well. Confirm the exact setting names in the extension documentation before you plan the configuration.

Mode or placementWhat it protects againstOperating cost and when it fits
Upload-time blocking onlyKnown malware at the point of upload, before the file is stored. Misses files already stored before signatures were updated.Little ongoing scan work. Fits small stores with few uploads, but leaves older attachments unchecked.
Scheduled full scans onlyAttachments already in the store and files uploaded before signatures changed. Malware is detected after it is stored and may already be opened.Recurring scan load grows with store size. Fits large existing stores as a backstop, paired with reports to administrators.
Upload-time blocking and scheduled full scans togetherBlocks new known-bad uploads and finds older or re-flagged files in the store. Covers both entry and resting attachments.Highest combined scan load, so size the daemon for both paths. Fits stores with external uploads or records duties.
Daemon on the wiki hostFewer moving parts and no added network hop. Little isolation: scan spikes can slow the wiki.Cost is one extra service to patch and monitor on the wiki host. Fits small single-instance wikis with light upload volume.
Daemon on a dedicated hostIsolates scan load and its resource use from the wiki, and lets the daemon be sized for large stores. Adds a network dependency.Adds a host to build, patch and monitor, and a connection to secure. Fits large stores and busy upload paths.
Single shared daemon across environmentsOne signature set and one place to maintain updates. A fault or overload affects every environment that calls it.Fewest daemons to run and patch. Fits small estates where test and production can accept sharing an outage.
One daemon per environmentTest, staging and production scan independently, so a test change or outage stays in its environment. Signatures must be kept current in each.Multiplies patching and signature update work with each environment. Fits regulated estates that need separate evidence per environment.

Upload blocking versus scheduled full scans

A new instance with few attachments has little stored history, so upload blocking covers most of the risk from day one. Every new attachment is sent to the ClamAV daemon before it is saved, and a file the daemon flags is refused. Existing files are a smaller question here, because the instance may hold only test uploads and early migrated pages.

  • What gets checked: New uploads are the primary control. Confirm that the Antivirus Application is set to scan on upload and that the XWiki container can reach the ClamAV daemon before go-live.
  • What the user sees: A rejected upload shows an error in the editor, and the attachment is not stored. Test this in a non-production wiki with the standard EICAR test string, and record the exact message your version displays.
  • What administrators receive: Confirm whether a rejection creates a notification, a log entry or only a browser error. Plan on the log being the record you read.
  • Re-scans of stored files: Confirm whether the application can run a full scan on demand and whether that run writes a log with the files checked and their results. Run one manual scan at the start to set a baseline.

Before go-live, confirm the upload path, the rejection message and the log output in a test wiki that matches your production settings.

Setting up XWiki attachment virus scanning with ClamAV

This sequence takes a self-hosted XWiki from no attachment scanning to blocked uploads, scheduled full scans and administrator reports, in the order each piece depends on the one before it. The ClamAV daemon is installed and restricted to the wiki first, then the extension is connected to it and tested with a harmless file. Each step ends with a check you can record for your change review.

  1. Confirm the XWiki and extension versions

    The platform administrator checks the Antivirus Application listing in the XWiki Store against the XWiki line you run, whether stable, LTS or intermediate LTS. Record the exact XWiki, Java and Tomcat versions from the administration pages, because the extension's compatibility notes depend on them. If no compatibility entry matches your version, stop here and either plan an XWiki upgrade or confirm support with the extension maintainers before going further. Done when the matched versions are written into your change record.

  2. Install and update the ClamAV daemon

    The infrastructure team installs the ClamAV daemon, its command-line scanner and the freshclam signature updater on a dedicated Linux host you control, using the packages your team already patches. Run freshclam once so the signature databases load, then enable the clamd and freshclam services so updates recur without manual steps. Check the daemon log for loaded signatures. Done when sending PING to the daemon returns PONG and the signature database date is current.

  3. Restrict the daemon to the wiki

    Set the listening address in clamd.conf so the daemon accepts connections only on the interface or Unix socket the wiki servers can reach. Add firewall rules that allow the scanning connection only from the XWiki application servers, and keep the daemon away from user networks and the internet. Treat the daemon as an internal service with its own access review, because it handles content from every editor. Done when PING succeeds from a wiki server and fails from every other host you test.

  4. Install the Antivirus Application extension

    The wiki administrator installs the Antivirus Application from the XWiki Store on a test instance first, using the version matched in the first step. Keep the production instance unchanged until the test run finishes. Check the installed extensions list for the expected version, and read the startup log for errors about the extension or its dependencies. Done when the extension is active on the test instance and the startup log records no errors for it.

  5. Point the extension at the daemon

    In the extension's administration settings, enter the same host and port or socket path configured in clamd.conf, along with any timeout values the extension offers. Choose the behavior for when the daemon cannot be reached, and confirm in the extension's documentation that the option you pick blocks the upload rather than storing it unscanned. Record the decision with your security owner. Done when a clean test file uploads successfully and stopping the daemon produces the blocking behavior you chose.

  6. Test upload blocking with a harmless file

    Upload the EICAR test file to a test space. It is a harmless text string that antivirus engines are designed to flag, and it contains no malware. The upload should be rejected with a virus message, the attachment should not appear on the page, and the event should appear in the logs. Repeat the upload with a clean file to confirm normal uploads still succeed. Done when both results match the expected outcome and you have log excerpts for the change record.

  7. Run a scheduled full scan on a test space

    Because upload blocking keeps the test file out of the wiki, place it in a test space through an exception your team agrees on in advance, such as a temporary configuration change that is reverted afterward. Then schedule a full scan of that space in the extension settings at a time outside peak editing. Check that the run completes and flags the seeded file. Done when the scan result lists the file and the run finishes without errors recorded in the logs.

  8. Verify the administrator report arrives and reads

    Confirm the recipient configured for administrator notifications, then review the report produced by the scheduled scan. Check that it names the flagged attachment, its space and the time of detection, and that a reviewer who does not run the server can read it without help. Confirm mail delivery through your own relay, since the report depends on it. Done when the report reaches the administrator mailbox and the flagged test file appears in it with a readable summary.

Sizing ClamAV for large XWiki attachment stores

Size the ClamAV daemon from the workload it must carry, and start by writing down five drivers. The first is the number and total size of attachments already stored, because that sets how much data a full scan must read. The second is the length of the scan window, meaning how long one full pass may take before the next one is due. The third is the peak number of uploads arriving at once, which sets how many checks must be answered without making editors wait. The fourth is the memory the daemon needs for its signature database and parallel scans. The fifth is how often signature updates must be applied, since each update can change load and may need a planned reload window.

A full scan of a large store is a different workload from per-upload checks, and it should be sized separately. A per-upload check handles one file at a time, is small, and must return quickly so the upload can complete. A full scan reads every stored attachment in a long batch, so it is mostly limited by disk read throughput and can run for a long time on a large store. If the scan window is shorter than a full pass takes, runs overlap and compete with live uploads for the same CPU and disk. Signature updates that land mid-scan add another variable, so confirm how the Antivirus Application handles a reload during a running scan before you set the schedule.

Use this section to frame the questions, then answer them with measurements. Ask ClamAV and the maintainers of the Antivirus Application for their current resource guidance, including the memory and CPU they expect at your attachment volume and the versions they support together. Then build a test copy of your real attachment profile, with the same file count, size distribution, file types and growth rate, and run two tests: a timed full scan and a burst of simultaneous uploads at your measured peak. Record the scan duration and upload latency under load, and size headroom from those peak results so the decision rests on worst-case behavior, not averages.

Security risks and controls for attachment scanning

Antivirus scanning of XWiki attachments tends to fail in predictable ways: outdated signatures, an exposed scanning daemon, upload paths the check never sees, and reports or quarantine folders that leak what they should protect. Each card names one risk, the control to put in place, and what to confirm with ClamAV or in your environment before go-live.

Stale virus signatures

A ClamAV daemon that has not refreshed its signature database will pass malware it has never seen, and the upload log will still show attachments as accepted. Put a scheduled update check in place with alerting on the age of the signature database. Confirm with your ClamAV packaging how the update tool fetches signatures, whether an internal mirror is needed in an air-gapped network, and how the daemon reports its database version. Treat a clean result from an outdated database as unverified.

Daemon exposed beyond its network

The ClamAV daemon accepts scan requests over a socket, so any host that can reach it can submit files and read results. Limit the daemon to a local socket or a private interface that only the XWiki application servers can reach, and block its port at the host and network firewalls. Confirm which address and port the Antivirus Application connects to in your setup, and whether your ClamAV version offers any access control beyond network placement.

Attachment paths the extension misses

Upload blocking only protects the paths where the extension runs its check. Attachments can also arrive through imports, programmatic saves, page copies or custom scripts that write files directly (illustrative examples). Map every write path into attachment storage and test each one with a harmless EICAR test file. Confirm with the extension documentation which paths it hooks, and record any path that skips the check as an accepted gap with an owner.

Reports that reveal filenames

Scan reports sent to administrators list filenames, uploaders and page locations, which can disclose project names, personnel files or pending legal matters to anyone who reads the mail. Restrict report recipients to a named security group and keep the report content to the minimum needed for triage. Confirm whether report mail passes through an external relay, how long mailboxes keep copies, and whether your records policy covers them.

Handling quarantined and rejected files

A blocked upload can still exist in temporary storage, logs, backups or a quarantine folder, and the file itself is what you must keep from spreading. Define where rejected and quarantined files go, who may open them, and when they are deleted. Keep them out of normal attachment storage and the search index. Confirm with your security team the retention period for quarantined files and whether your backups capture quarantine locations.

Antivirus as one control

Signature scanning catches known malware and says little about malicious macros, exploits against unpatched XWiki or Tomcat versions, or links to phishing pages. Pair scanning with attachment type restrictions, timely XWiki and Tomcat patching, and tight rights on sensitive spaces. Record which control covers which risk in your risk register, and confirm the scope with your auditors or reviewers so the scanner is not presented as the whole answer.

What administrator reports should show and who reads them

An administrator report is only useful if it shows what was checked, what was found and what happened to each flagged file. Plan for each run to record its scope (which wiki and which attachments were covered, and whether it was a scheduled full scan or a check at upload), its start and end times, the number of files scanned, the number flagged, and for each flagged item the attachment name, the page it sits on, the uploader and the action taken, such as blocked or removed. The exact field names, output format and delivery channel (email, a log file or an administration page) depend on the Antivirus Application version you install, so confirm them in its extension documentation before you write alerting or retention rules around them. Do not assume a report includes the uploader or the page until you have seen a sample from your own test instance.

Triage needs a named owner before the first report arrives. In most organizations the XWiki administrator receives the report and passes flagged items to a security operations contact, while the content owner of the affected space confirms whether the file was expected. For each flagged item, the triager should rerun the scan on a copy to confirm the detection, check the uploader and the page history, and decide whether the file must be removed. Infected attachments should leave the page only after a preserved copy exists in restricted storage outside the wiki, with its checksum recorded in the case notes, so investigators can still examine the sample. Confirm whether the extension can move a file to a quarantine location itself, and whether removing an attachment also removes its history, because that determines what the investigation can recover.

Retention is where the scan report meets your records policy. A report is evidence that a control ran, so it should be kept for the period your records owner sets for security logs, which may differ from the period that applies to wiki content. Store the reports outside the wiki's own attachment store, so that deleting a page or space does not erase the record of what was flagged there. Ask the records team and legal counsel whether file names and uploader identities in the reports count as personal data under your privacy rules, and whether a legal hold is needed for any incident under investigation. Before you rely on the process, run a test scan with a harmless test file in a non-production instance and check that the report, the removal and the preserved copy all appear as you expect.

Limits to confirm before relying on ClamAV blocking

Blocking uploads is only as strong as the environment it runs in. The six checks below cover what the Antivirus Application scans, how it fails, and what it depends on, so you can test each one before a policy relies on it. Run them on a staging instance with your own XWiki version and attachment store.

Supported XWiki and runtime versions

Confirm which XWiki line the Antivirus Application version supports before you pin either. XWiki publishes a stable line, an LTS line and an intermediate LTS line, so the same extension may behave differently across them. Ask for the supported Java and Tomcat versions in writing, then check them against the image or package you run. The official Docker images run on Tomcat, so the container tag sets much of this for you.

Docker image docs

Every attachment upload path

Scanning only helps where it runs. List each route that can put a file into an attachment store: page uploads, attachment edits, imports, the File Manager, REST calls, and scripts or migrations that write attachments directly. Upload one test file through each route, using a standard antivirus test string, and confirm whether it is blocked, flagged or stored. Bulk imports deserve separate attention, since they may not pass through the same upload form.

Archives and very large files

Check how the scanner treats compressed and nested content. Confirm whether archives such as ZIP files are unpacked and scanned, how many levels of nesting are inspected, and whether a file that exceeds a size or time limit is rejected, flagged or stored unscanned. An archive the scanner cannot fully open is a gap if the policy treats it as clean. Ask the vendor for the configured defaults, set your own ceiling, and test a file just above it.

Behavior when the daemon is down

Decide what uploads do when the ClamAV daemon is unreachable, restarting or timing out. A fail open setting accepts files without a scan, which keeps editors working but leaves a gap. Fail closed rejects uploads until scanning returns, which protects storage but can stop teams from publishing. Test it by stopping the daemon in staging and attempting an upload. Confirm the setting name, its default value and whether the failure appears in administrator reports.

Scheduled scans scoped to spaces

Find out whether scheduled full scans can be limited to specific spaces or wikis, or whether they always cover the whole instance. A full scan of a large attachment store can run long enough to compete with peak use, so scope affects capacity as well as coverage. Confirm where scan reports go, who receives them, and whether a finding removes the attachment, hides it or only notifies someone. Ask for a sample report from a test run.

Extension license terms

Read the license of the Antivirus Application in the XWiki Store before you rely on it in a regulated environment. XWiki core is licensed under LGPL 2.1, but an extension can carry its own terms, and the ClamAV daemon is a separate component with its own license. Confirm whether the extension version you plan to deploy has a support agreement, and what modification and redistribution terms apply if you build a custom package. Record the answers in your third-party software inventory.

What XWiki attachment virus scanning costs and what it needs from your team

What does XWiki attachment virus scanning cost to run?

The main cost components are the extension license, if the Antivirus Application carries one, the host capacity for the ClamAV daemon, administrator time, and any fixed-scope services a partner quotes. Confirm the license terms for the Antivirus Application in the XWiki Store before you budget, because they determine whether anything recurs. Host capacity is recurring: the daemon needs memory and CPU in your infrastructure, and the need grows with attachment volume and scan frequency. Administrator time is mostly one-time setup for upload blocking, scheduled full scans and reports, followed by routine checks. Partner services are one-time when bought as a project and recurring when bought as a retainer for updates and testing. Ask every quote to list each component separately, with who pays for it and which items repeat each year.

Can our own team set up ClamAV scanning for XWiki attachments?

Yes, a team that already administers XWiki and runs Linux services can usually handle the setup internally. The work combines extension configuration in XWiki with operating a network service that must be patched, monitored and sized. Confirm that the Antivirus Application version you choose supports the XWiki line you run, and check the Java and Tomcat requirements for that line in the XWiki documentation. Teams without experience running a daemon in production should plan for more review time or bring in a partner for the setup, then keep operations in-house. Decide early who owns the daemon, who receives the scan reports and who responds when a scan fails or an attachment is quarantined.

How long does a ClamAV setup for XWiki usually take?

Setup length depends mainly on the number of XWiki instances, the size of the attachment store, the network path between XWiki and the ClamAV daemon, and how many scan schedules and administrator reports you need. A single instance with an existing test environment and open network paths is the simplest case. Multiple wikis, strict firewall approval or a large first full scan add review and testing steps. This page does not quote a duration. Ask any partner or internal plan for a written schedule with milestones for the test environment, upload blocking verification, the first full scan and handover, and confirm which steps depend on your change approvals.

What does a fixed-scope XWiki virus scanning quote usually include?

A fixed-scope quote should list the deliverables, the environments covered, the number of XWiki instances in scope, the test plan, the handover items and what happens after handover. Most engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts, and the quote follows from that written scope. For reference only, XWiki SAS lists consulting at 1200 EUR per day in its XWiki SAS pricing, and that rate requires a Business or Enterprise support plan. Use the figure as a vendor reference point, and compare quotes by what each deliverable includes and whether your support plan meets the rate's requirement.

What must our team provide for XWiki virus scanning setup?

Your team typically provides four things. First, wiki access, meaning an administrator account or a scoped account with rights to install and configure the extension and to read the reports. Second, a test environment that mirrors the production XWiki line, so upload blocking and scheduled scans can be verified before they touch live attachments. Third, a representative attachment sample, sanitized where needed, that includes the file types and sizes your users actually upload, so tests reflect real traffic. Fourth, a network plan that defines the route between XWiki and the ClamAV daemon, the port, the firewall rules and whether the daemon can reach an update source. Name an owner for each item before the project begins.

How are ClamAV signature updates and XWiki upgrades handled over time?

ClamAV signature updates are normally pulled by the freshclam process on a schedule, so the daemon needs outbound access to an update source or an internal mirror if the network is restricted or air-gapped. Confirm the update source, the schedule and who monitors failed updates. XWiki and Antivirus Application upgrades should be tested in the test environment first, with the scan and blocking behavior checked after each change, and the upgrade path should match the XWiki line you run. Ongoing support, upgrades and continuous testing are available from DeployOpen as retainers, so you can decide whether these checks stay in-house or move to a recurring agreement.

How much server capacity does ClamAV need for large attachment stores?

Capacity depends on how many attachments the daemon scans, the average and largest file sizes, how often full scans run and how many scans can run at once. The ClamAV daemon loads its signature database into memory, so memory is usually the first limit to check, and the official ClamAV documentation lists the requirements for your version. Scheduled full scans of a large store are the heaviest load, so schedule them outside peak hours and measure the first run on a copy of the store. Plan for growth in both attachment volume and signature database size, and set alerts on queue length, scan time and memory use so the team sees pressure before users do.

How DeployOpen scopes and delivers antivirus scanning for XWiki

DeployOpen approaches XWiki attachment virus scanning as a planned change to a self-hosted wiki in infrastructure you control. The work covers the Antivirus Application, a ClamAV daemon, upload blocking, scheduled full scans, administrator reports and sizing for large attachment stores. Engagements are fixed-scope, with scope agreed in writing before work starts.

How we scope

  • The written scope names the XWiki version, database variant and hosting platform the scanner must work with.
  • Upload blocking, scheduled full scans and administrator reports are each listed as separate deliverables with acceptance checks.
  • Sizing for your attachment store, including volume, file types and scan windows, is agreed before any build starts.

How we build

  • Install the Antivirus Application on a test instance and connect it to a ClamAV daemon you operate.
  • Configure upload blocking rules, then test them with clean and known-test malicious sample files in a non-production instance.
  • Size daemon memory, CPU and signature update timing from measured attachment store volume and growth.

How we hand over

  • Written runbook covering scan configuration, blocked file handling, scheduled scan settings and report recipients.
  • Test evidence showing upload blocking, scan results and administrator reports worked on the agreed environment.
  • Operator walkthrough with your administrators on daemon restarts, signature updates and reading scan reports.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Retainer work can cover XWiki upgrades, ClamAV signature and daemon updates, and scan configuration changes.
  • DeployOpen prepares scan logs and reports as compliance evidence; independent auditors issue any audit opinion.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.