Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84272

Include the time taken to anti-virus scan file in the existing log event

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MOODLE_500_STABLE
    • Hide

      To test this, you need direct access to the database.

      1. Ideally, enable AV scanning for your test site. (Otherwise, we will log a very short, possibly zero time, but there will be no real problem if so.)
        • Install ClamAV on your machine. E.g. in Ubuntu: "sudo apt install clamav clamav-daemon"
        • Take note of the path to clamscan. e.g. by running "which clamscan"
        • Navigate to Site admin > Plugins > Antivirus plugins.
        • Enable the ClamAV antivirus
        • Go to its settings and set the antivirus_clamav | pathtoclam setting with the path to the clamscan command.
        • Save the changes
      2. You can upload a file anywhere in Moodle. (For example, you can start a forum post and drag a file into the attachment area.)
      3. Look in the logstore_standard_log table, and find the draft_file_added event.
      4. Verify that the other data shows an avscantime property with a float value.
      Show
      To test this, you need direct access to the database. Ideally, enable AV scanning for your test site. (Otherwise, we will log a very short, possibly zero time, but there will be no real problem if so.) Install ClamAV on your machine. E.g. in Ubuntu: " sudo apt install clamav clamav-daemon " Take note of the path to clamscan. e.g. by running " which clamscan " Navigate to Site admin > Plugins > Antivirus plugins. Enable the ClamAV antivirus Go to its settings and set the antivirus_clamav | pathtoclam setting with the path to the clamscan command. Save the changes You can upload a file anywhere in Moodle. (For example, you can start a forum post and drag a file into the attachment area.) Look in the logstore_standard_log table, and find the draft_file_added event. Verify that the other data shows an avscantime property with a float value.
    • Hide

      Code verified against automated checks.

      Checked MDL-84272 using repository: https://github.com/timhunt/moodle.git

      More information about this report

      Built on: Wed Jan 22 11:46:30 AM UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84272 using repository: https://github.com/timhunt/moodle.git main (0 errors / 0 warnings) [branch: MDL-84272 | CI Job ] More information about this report Built on: Wed Jan 22 11:46:30 AM UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84272 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18039/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/61640/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/61641/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/61642/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/61643/ App tests (stable app version) Built on: Wed Jan 22 02:30:21 PM UTC 2025

      We were wondering how well AV scanning was working on our Moodle sites.

      As far as I can see, it is not easy to get logs out of ClamAV that lists all the files scanned, wit the size and how long it took.

      So, instead, it just seemed easier to build on MDL-77406, and add the time required to do the virus scanning to the draft_file_added log event, as an optional memeber of the 'other' array.

      Note: I am not currently planning to expose this data anywhere in the Moodle UI. It will just be there for admins who want to dig into it. E.g. with a query in https://moodle.org/plugins/report_customsql.

        1. MDL-84272.png
          285 kB
          Ron Carl Alfon Yu

            timhunt Tim Hunt
            timhunt Tim Hunt
            Sam Marshall Sam Marshall
            David Woloszyn David Woloszyn
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 54 minutes
                2h 54m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.