The module may be installed on a site which has a number of existing files. As the module only scans new files, as they are uploaded, it would be useful to check the existing files and report whether any are infected.

A second use-case is regular subsequent checks, to identify infected files uploaded in the 0-day period before they could be identified by the scanner.

Proposed resolution

Add new Drush command that scans the managed files using the Drupal's Batch API.

Issue fork clamav-2919464

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

manarth created an issue. See original summary.

manarth’s picture

Current WIP against 7.x is going on in branch feature/2919464-rescan-old-files.

capellic’s picture

Hello, we are evaluating this module, prompted by Pantheon's announcement that they now support it. Would like to see this functionality and wondering if any progress has been made.

manarth’s picture

IIRC the code in that feature-branch seemed to be in a good state, and would benefit from testing + feedback. I know of a site which may be trialling the branch in the next month or so, but nothing concrete just yet. Feel free to run with it though, and if it's positively received we'll merge it to the 7.x dev branch to expose it to a wider audience and plan for a new release.

capellic’s picture

Thanks @manarth. Our evaluation has been put on pause, but I'll take a look should we move forward. Thank you for the response.

sokru’s picture

Title: Provide a mechanism for re-scanning old files » Provide a command for re-scanning old files
Version: 8.x-1.x-dev » 2.x-dev

sokru’s picture

Issue summary: View changes
Status: Active » Needs review

I'll leave to maintainers to decide if they first want to complete the #3423633: Code modernisation.

sokru’s picture

Title: Provide a command for re-scanning old files » Provide a command for re-scanning existing files
rosk0’s picture

Status: Needs review » Needs work

Needs more work. See comments in the merge request.

patrickharris’s picture

Assigned: Unassigned » patrickharris
Status: Needs work » Active

I will try and address the recent comments here.

patrickharris’s picture

Assigned: patrickharris » Unassigned
patrickharris’s picture

Status: Active » Needs review

$this->logger() was not working for me in the batch process, so I substituted \Drupal::logger() ... I'm not sure if it is working for other people?

rosk0’s picture

Assigned: Unassigned » rosk0
Status: Needs review » Active

Will do some more polishing myself.

rosk0’s picture

Assigned: rosk0 » Unassigned
Status: Active » Needs review

Back to NR

vladimiraus’s picture

Title: Provide a command for re-scanning existing files » Provide drush command for re-scanning existing files
jannakha’s picture

Status: Needs review » Reviewed & tested by the community

tested and works as required

thanks for your contributions!

vladimiraus’s picture

Version: 2.x-dev » 2.0.x-dev
Status: Reviewed & tested by the community » Fixed

Merged. Thank you all.

vladimiraus’s picture

jannakha’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.