diff --git a/ct/clamav.sh b/ct/clamav.sh new file mode 100644 index 0000000000..4ae20f47fa --- /dev/null +++ b/ct/clamav.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: cisox +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://www.clamav.net/ + +APP="ClamAV" +var_tags="${var_tags:-antivirus;security}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-3072}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /etc/clamav/clamd.conf ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Updating ClamAV" + apt_update_safe + upgrade_packages_with_retry clamav clamav-daemon clamav-freshclam + msg_ok "Updated ClamAV" + msg_ok "Updated successfully!" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}clamd is listening for scan requests on TCP port 3310:${CL}" +echo -e "${GATEWAY}${BGN}${IP}:3310${CL}" diff --git a/install/clamav-install.sh b/install/clamav-install.sh new file mode 100644 index 0000000000..10499e65e5 --- /dev/null +++ b/install/clamav-install.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: cisox +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://www.clamav.net/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing ClamAV" +echo "clamav-daemon clamav-daemon/TcpOrLocal select TCP" | debconf-set-selections +echo "clamav-daemon clamav-daemon/TCPSocket string 3310" | debconf-set-selections +echo "clamav-daemon clamav-daemon/TCPAddr string 0.0.0.0" | debconf-set-selections +mkdir -p /etc/systemd/system/clamav-daemon.socket.d +cat </etc/systemd/system/clamav-daemon.socket.d/tcp.conf +[Socket] +ListenStream=3310 +EOF +$STD apt install -y \ + clamav \ + clamav-daemon \ + clamav-freshclam +msg_ok "Installed ClamAV" + +msg_info "Downloading ClamAV Signatures" +systemctl stop clamav-freshclam +$STD freshclam +systemctl enable -q --now clamav-freshclam clamav-daemon +msg_ok "Downloaded ClamAV Signatures" + +motd_ssh +customize +cleanup_lxc diff --git a/json/clamav.json b/json/clamav.json new file mode 100644 index 0000000000..c004b45c5b --- /dev/null +++ b/json/clamav.json @@ -0,0 +1,36 @@ +{ + "name": "ClamAV", + "slug": "clamav", + "categories": [ + 6 + ], + "date_created": "2026-10-30", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://docs.clamav.net/", + "website": "https://www.clamav.net/", + "repository": "https://github.com/Cisco-Talos/clamav", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/clamav.webp", + "description": "ClamAV is an open-source antivirus engine for detecting trojans, viruses, malware and other threats. The clamd daemon serves scan requests over the network, so mail servers, Nextcloud, Paperless-ngx and other apps can use it as their virus scanner, while freshclam keeps the signatures up to date.", + "install_methods": [ + { + "type": "default", + "script": "ct/clamav.sh", + "config_path": "/etc/clamav/clamd.conf", + "resources": { + "cpu": 2, + "ram": 3072, + "hdd": 8, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +}