From 5d58f43107d0eba34841762f37141a66c258782d Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 4 Jul 2023 07:48:14 +0200 Subject: [PATCH 1/2] enh: add some more documentation for antivirus usage Signed-off-by: Max --- .../antivirus_configuration.rst | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/admin_manual/configuration_server/antivirus_configuration.rst b/admin_manual/configuration_server/antivirus_configuration.rst index 6b3b25487..e45937711 100644 --- a/admin_manual/configuration_server/antivirus_configuration.rst +++ b/admin_manual/configuration_server/antivirus_configuration.rst @@ -169,6 +169,51 @@ Executable When you are satisfied with how ClamAV is operating, you might want to go back and change all of your logging to less verbose levels. +Confirm everything is working +----------------------------- + +Every antivirus provider implements a test virus string, that way tests are quite easy. You find the files here: +https://www.eicar.org/download-anti-malware-testfile/ + +Uploading the file will trigger an error: + "Virus Win.Test.EICAR_HDB-1 is detected in the file. Upload cannot be completed." + +Manage the background scanner +----------------------------- + +The background scanner does not require any manual intervention. +However at times you might want to inspect it or perform tasks on it. + +Get info about files in the scan queue +~~~~~~~~ + +:: + + occ files_antvirus:status [-v] + + +Manually trigger the background scan +~~~~~~~~ + +:: + + occ files_antivirus:background-scan [-v] [-m MAX] + +Manually scan a single file +~~~~~~~~ + +:: + + occ files_antvirus:scan + +Mark a file as scanned or unscanned. +~~~~~~~~ + +:: + + occ files_antivirus:mark + +Files marked as scanned will not be scanned for the next four weeks. Configuring ICAP on Nextcloud ----------------------------- @@ -183,6 +228,6 @@ Additional documentation is work in progress. Disabling background scan task ------------------------------ -You can disable background scan with occ to only scan files during upload. +You can disable background scan with occ to only scan files during upload:: occ config:app:set files_antivirus av_background_scan --value="off" From 9de4a83e8f92dddb54c6eeb088d9bfa60bb5370e Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 2 Jan 2024 09:30:08 +0100 Subject: [PATCH 2/2] fix(admin): antivirus occ commands Including feedback from PR review of #10711. Signed-off-by: Max --- .../antivirus_configuration.rst | 20 ++++++++--------- .../configuration_server/occ_command.rst | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/admin_manual/configuration_server/antivirus_configuration.rst b/admin_manual/configuration_server/antivirus_configuration.rst index e45937711..1a1b3ddd0 100644 --- a/admin_manual/configuration_server/antivirus_configuration.rst +++ b/admin_manual/configuration_server/antivirus_configuration.rst @@ -185,33 +185,33 @@ The background scanner does not require any manual intervention. However at times you might want to inspect it or perform tasks on it. Get info about files in the scan queue -~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - occ files_antvirus:status [-v] + sudo -u www php occ files_antivirus:status [-v] Manually trigger the background scan -~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - occ files_antivirus:background-scan [-v] [-m MAX] + sudo -u www php occ files_antivirus:background-scan [-v] [-m MAX] Manually scan a single file -~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - occ files_antvirus:scan + sudo -u www php occ files_antivirus:scan -Mark a file as scanned or unscanned. -~~~~~~~~ +Mark a file as scanned or unscanned +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :: - occ files_antivirus:mark + sudo -u www php occ files_antivirus:mark Files marked as scanned will not be scanned for the next four weeks. @@ -230,4 +230,4 @@ Disabling background scan task You can disable background scan with occ to only scan files during upload:: - occ config:app:set files_antivirus av_background_scan --value="off" + sudo -u www php occ config:app:set files_antivirus av_background_scan --value="off" diff --git a/admin_manual/configuration_server/occ_command.rst b/admin_manual/configuration_server/occ_command.rst index a1c0ed297..72f72300f 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/configuration_server/occ_command.rst @@ -42,6 +42,7 @@ occ command Directory * :ref:`two_factor_auth_label` * :ref:`disable_user_label` * :ref:`system_tags_commands_label` +* :ref:`antivirus_commands_label` * `Debugging`_ .. _http_user_label: @@ -1717,6 +1718,27 @@ invisible No No | ¹ User can see the tag | ² User can assign the tag to a file +.. _antivirus_commands_label: + +Antivirus +--------- + +Get info about files in the scan queue:: + + sudo -u www php occ files_antivirus:status [-v] + +Manually trigger the background scan:: + + sudo -u www php occ files_antivirus:background-scan [-v] [-m MAX] + +Manually scan a single file:: + + sudo -u www php occ files_antivirus:scan + +Mark a file as scanned or unscanned:: + + sudo -u www php occ files_antivirus:mark + .. _occ_debugging: Debugging