Improve Drush command

Created on 9 February 2025, 2 months ago

Problem/Motivation

We've tried using the Drush command provided in Provide a command for re-scanning old files Active and have couple issues:

  • with a large amount of files to scan, we have around 200k, scanning could take a while and, in case of a antivirus service outage, there is no way to tell which files were skipped from scanning
  • by default scanner would report only the file name if the virus is detected, but this information is not complete for the case of scanning historical data

Proposed resolution

  • when the antivirus service is down, report the file ID so it can be logged and rescanned later
  • add ability to filter files to be scanned by ID
  • when a virus is detected, report the file ID is it can be actioned

Remaining tasks

code
review
commit

User interface changes

Additional option for the Drush command to scan only specified file IDs.

API changes

None/TBD

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇳🇿New Zealand RoSk0 Wellington

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @RoSk0
  • Merge request !19Issue #3505409: Improve Drush command → (Open) created by RoSk0
  • 🇳🇿New Zealand RoSk0 Wellington

    Manually tested locally with TCP/IP and executable modes - works as expected.

    Not sure what GitLab doesn't like about my branch - I could merge it into the 2.x locally with no issues in fast-forward mode, also this is confirmed by the green tick mark ( if I understand this correctly ) next to the "Merge request must be rebased, because a fast-forward merge is not possible." check in the merge request overview.

  • First commit to issue fork.
  • Pipeline finished with Canceled
    25 days ago
    Total: 122s
    #451802
  • Pipeline finished with Failed
    25 days ago
    Total: 322s
    #451803
  • 🇦🇺Australia almunnings Melbourne, 🇦🇺

    Is the namespace of this command incorrect?

    With drush 12
    drush status --debug

    Results in

     [debug] Could not instantiate Drupal\clamav\Drush\Commands\ClamavCommand: Too few arguments to function Drupal\Clamav\Drush\Commands\ClamavCommand::__construct(), 0 passed in /app/vendor/drush/drush/src/Runtime/ServiceManager.php on line 333 and exactly 3 expected [0.88 sec, 53.82 MB]
    

    Suggest changing:

    \Drupal\clamav\Drush\Commands\ClamavCommand
    to
    \Drupal\clamav\Commands\ClamavCommand
    
Production build 0.71.5 2024