From 2a65881e10f70918bea8e76135dcf4527dfe7a44 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Sat, 7 Sep 2024 20:14:15 +1000 Subject: [PATCH] initial commit of file from CVS for smeserver-clamav-unofficial-sigs on Sat Sep 7 20:14:15 AEST 2024 --- .gitignore | 4 + Makefile | 21 ++++ README.md | 16 ++- additional/CHANGELOG.git | 11 ++ .../smeserver-clamav-unofficial-sigs.spec | 52 +++++++++ contriborbase | 1 + createlinks | 16 +++ .../defaults/clamav-unofficial-sigs/status | 1 + .../defaults/clamav-unofficial-sigs/type | 1 + .../migrate/80clamav-unofficial-sigs | 8 ++ .../actions/clamav-unofficial-sigs-init | 6 + .../clamav-unofficial-sigs/os.conf/00header | 20 ++++ .../clamav-unofficial-sigs/os.conf/010Path | 2 + .../clamav-unofficial-sigs/os.conf/015User | 2 + .../etc/clamav-unofficial-sigs/os.conf/020Db | 1 + .../etc/clamav-unofficial-sigs/os.conf/025Pid | 1 + .../clamav-unofficial-sigs/os.conf/026Socket | 1 + .../clamav-unofficial-sigs/os.conf/028upgrade | 15 +++ .../clamav-unofficial-sigs/os.conf/030Reload | 2 + .../clamav-unofficial-sigs/os.conf/030Restart | 1 + .../os.conf/035Randomize | 4 + .../os.conf/040Databases | 104 ++++++++++++++++++ .../os.conf/045Frequencies | 2 + .../clamav-unofficial-sigs/os.conf/065Backup | 1 + .../etc/clamav-unofficial-sigs/os.conf/075Log | 3 + .../clamav-unofficial-sigs/os.conf/080Proxy | 2 + .../os.conf/099UserConfigComplete | 1 + .../50-koozali.conf | 2 + smeserver-clamav-unofficial-sigs.spec | 74 +++++++++++++ 29 files changed, 373 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 additional/CHANGELOG.git create mode 100644 additional/smeserver-clamav-unofficial-sigs.spec create mode 100644 contriborbase create mode 100644 createlinks create mode 100644 root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/status create mode 100644 root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/type create mode 100644 root/etc/e-smith/db/configuration/migrate/80clamav-unofficial-sigs create mode 100644 root/etc/e-smith/events/actions/clamav-unofficial-sigs-init create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/00header create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/010Path create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/015User create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/020Db create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/025Pid create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/026Socket create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/028upgrade create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Reload create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Restart create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/035Randomize create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/040Databases create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/045Frequencies create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/065Backup create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/075Log create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/080Proxy create mode 100644 root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/099UserConfigComplete create mode 100644 root/usr/lib/systemd/system/clamav-unofficial-sigs.service.d/50-koozali.conf create mode 100644 smeserver-clamav-unofficial-sigs.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb3a13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9b1575c --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-clamav-unofficial-sigs +# $Id: Makefile,v 1.1 2021/03/16 03:50:43 jpp Exp $ +NAME := smeserver-clamav-unofficial-sigs +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index 644be8f..8fdce62 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ -# smeserver-clamav-unofficial-sigs +# smeserver-clamav-unofficial-sigs -SMEServer Koozali developed git repo for smeserver-clamav-unofficial-sigs smecontribs \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-clamav-unofficial-sigs smecontribs + +## Wiki +
https://wiki.koozali.org/ + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-clamav-unofficial-sigs&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/additional/CHANGELOG.git b/additional/CHANGELOG.git new file mode 100644 index 0000000..6ef8b35 --- /dev/null +++ b/additional/CHANGELOG.git @@ -0,0 +1,11 @@ +commit d49776a2678f4125362855ea3079bc29455863fd +Author: Daniel Berteaud +Date: Wed Jun 10 09:32:04 2015 +0200 + + Fix small typos + +commit d9c1d2a35475a70f2a7546ae8617a2e6193eef0a +Author: Daniel Berteaud +Date: Tue Jun 9 18:42:08 2015 +0200 + + Initial commit diff --git a/additional/smeserver-clamav-unofficial-sigs.spec b/additional/smeserver-clamav-unofficial-sigs.spec new file mode 100644 index 0000000..ea52dfa --- /dev/null +++ b/additional/smeserver-clamav-unofficial-sigs.spec @@ -0,0 +1,52 @@ +%define version 0.1.0 +%define release 0.beta0 +%define name smeserver-clamav-unofficial-sigs + + +Summary:Unofficial ClamAV signature integration +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: Applications/System +Source: %{name}-%{version}.tar.gz + +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch +BuildRequires: e-smith-devtools + +Requires: clamav-unofficial-sigs +Requires: smeserver-clamav + +%description +Configure unofficial ClamAV signatures on SME Server + +%changelog +* Tue Jun 9 2015 Daniel Berteaud - 0.1.0 +- initial release + +%prep +%setup -q -n %{name}-%{version} + +%build +perl createlinks + +%install +/bin/rm -rf $RPM_BUILD_ROOT +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + > %{name}-%{version}-filelist + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +%clean +rm -rf $RPM_BUILD_ROOT + +%pre + +%post + +%preun + diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..9b7fd51 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +contribs10 diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..f9cb332 --- /dev/null +++ b/createlinks @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +templates2events("/etc/clamav-unofficial-sigs/os.conf", qw(email-update bootstrap-console-save clamav-update)); + +my $event="smeserver-clamav-unofficial-sigs-update"; +templates2events("/etc/clamav-unofficial-sigs/os.conf",$event); +#safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/clamav-unofficial-sigs"); +#clamav-unofficial-sigs.service clamav-unofficial-sigs.timer +event_link("systemd-default", $event, "88"); +event_link("systemd-reload", $event, "89"); +event_link("clamav-unofficial-sigs-folders", $event, "55"); +use esmith::Build::Backup qw(:all); +backup_includes("smeserver-clamav-unofficial-sigs", qw(/etc/clamav-unofficial-sigs/master.conf /etc/clamav-unofficial-sigs/user.conf /var/lib/clamav-unofficial-sigs/)); + diff --git a/root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/status b/root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/type b/root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/clamav-unofficial-sigs/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/db/configuration/migrate/80clamav-unofficial-sigs b/root/etc/e-smith/db/configuration/migrate/80clamav-unofficial-sigs new file mode 100644 index 0000000..ef6cb54 --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/80clamav-unofficial-sigs @@ -0,0 +1,8 @@ +{ + my $clamav_unof = $DB->get("clamav-unofficial-sigs") || + $DB->new_record("clamav-unofficial-sigs", { type => "service" }); + + $clamav_unof->delete_prop($_) for ( qw(honeynet.hdb jurlbl.ndb phish.ndb sanesecurity.ftm securiteinfobat.hdb securiteinfoelf.hdb securiteinfohtml.hdb securiteinfopdf.hdb spamimg.hdb winnow_malware_links.ndb +junk.ndb mbl.ndb rogue.hdb scam.ndb securiteinfodos.hdb securiteinfo.hdb securiteinfooffice.hdb securiteinfosh.hdb winnow_malware.hdb) ); + +} diff --git a/root/etc/e-smith/events/actions/clamav-unofficial-sigs-init b/root/etc/e-smith/events/actions/clamav-unofficial-sigs-init new file mode 100644 index 0000000..4bb2085 --- /dev/null +++ b/root/etc/e-smith/events/actions/clamav-unofficial-sigs-init @@ -0,0 +1,6 @@ +#!/bin/bash +# create missing folder to avoid error +# see https://github.com/extremeshok/clamav-unofficial-sigs/pull/390 https://github.com/extremeshok/clamav-unofficial-sigs/pull/400 +mkdir -p /var/lib/clamav-unofficial-sigs/dbs-uh +mkdir -p /var/lib/clamav-unofficial-sigs/dbs-yara +chown clamupdate:clamupdate /var/lib/clamav-unofficial-sigs/* diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/00header b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/00header new file mode 100644 index 0000000..a56592a --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/00header @@ -0,0 +1,20 @@ +# This file contains os configuration settings for clamav-unofficial-sigs.sh +################### +# This is property of eXtremeSHOK.com +# You are free to use, modify and distribute, however you may not remove this notice. +# Copyright (c) Adrian Jon Kriel :: admin@extremeshok.com +# License: BSD (Berkeley Software Distribution) +################## +# +# Script updates can be found at: https://github.com/extremeshok/clamav-unofficial-sigs +# +################## +# +################################################################################ +# SEE MASTER.CONF FOR CONFIG EXPLANATIONS +################################################################################ +# Rename to os.conf to enable this file +################################################################################ + +# Recommended Options for Packaging, this example applies to RHEL/CentOS + diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/010Path b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/010Path new file mode 100644 index 0000000..f76a2fe --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/010Path @@ -0,0 +1,2 @@ +PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +export PATH diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/015User b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/015User new file mode 100644 index 0000000..698b6f8 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/015User @@ -0,0 +1,2 @@ +clam_user="clamupdate" +clam_group="clamupdate" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/020Db b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/020Db new file mode 100644 index 0000000..aaf8a06 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/020Db @@ -0,0 +1 @@ +clam_dbs="/var/lib/clamav" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/025Pid b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/025Pid new file mode 100644 index 0000000..c83c443 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/025Pid @@ -0,0 +1 @@ +clamd_pid="/var/run/clamd/clamd.pid" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/026Socket b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/026Socket new file mode 100644 index 0000000..7a20225 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/026Socket @@ -0,0 +1 @@ +clamd_socket="/var/run/clamd/clamd.socket" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/028upgrade b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/028upgrade new file mode 100644 index 0000000..67dc3ce --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/028upgrade @@ -0,0 +1,15 @@ +# Recommended Options for Packaging, this example applies to RHEL/CentOS + +# Disable Upgrades +allow_upgrades="no" + +# Disable Update Checks +allow_update_checks="no" + +# Provided two variables that package and port maintainers can use in order to +# prevent the script from removing itself with the '-r' flag +# If the script was installed via a package manager like yum, apt, pkg, etc. +# The script will instead provide feedback to the user about how to uninstall the package. +pkg_mgr="yum" #the package manager name +pkg_rm="yum erase clamav-unofficial-sigs" #the package manager command to remove the script + diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Reload b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Reload new file mode 100644 index 0000000..c511a46 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Reload @@ -0,0 +1,2 @@ +reload_dbs="yes" +reload_opt="clamdscan --config-file=/etc/clamd.d/scan.conf --reload" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Restart b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Restart new file mode 100644 index 0000000..9a30ec4 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/030Restart @@ -0,0 +1 @@ +clamd_restart_opt="/usr/bin/systemctl try-restart clamd" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/035Randomize b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/035Randomize new file mode 100644 index 0000000..6c34049 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/035Randomize @@ -0,0 +1,4 @@ +enable_random="yes" +min_sleep_time="60" +max_sleep_time="600" + diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/040Databases b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/040Databases new file mode 100644 index 0000000..807e692 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/040Databases @@ -0,0 +1,104 @@ +{ + +my %db = $DB->get('clamav-unofficial-sigs')->props; + +my @ss = (); +my @si = (); +my @mbl = (); + +if ((${'clamav-unofficial-sigs'}{'status'} || 'disabled') eq 'enabled'){ + while (my ($param,$value) = each(%db)){ + if ($value eq 'ss'){ + push @ss, $param; + } + elsif ($value eq 'si'){ + push @si, $param; + } + elsif ($value eq 'mbl'){ + push @mbl, $param; + } + } +# $OUT .= "ss_dbs=\"\n " . join("\n ", @ss) . "\n\"\n" if (scalar @ss > 0); +# $OUT .= "si_dbs=\"\n " . join("\n ", @si) . "\n\"\n" if (scalar @si > 0); +# $OUT .= "mbl_dbs=\"\n " . join("\n ", @mbl) . "\n\"\n" if (scalar @mbl > 0); +} +$OUT ="\n"; +} +# securiteinfo +securiteinfo_premium={((${'clamav-unofficial-sigs'}{'securiteinfo_premium'}|| "no" ) eq '"yes"' )? "yes" : '"no"' } +securiteinfo_authorisation_signature={my $key=${'clamav-unofficial-sigs'}{'securiteinfo_authorisation_signature'}|| 'YOUR-SIGNATURE-NUMBER'; $OUT="\"$key\""; } + +#malwareexpert +malwareexpert_serial_key={my $key=${'clamav-unofficial-sigs'}{'malwareexpert_serial_key'}||'YOUR-SERIAL-KEY'; $OUT="\"$key\""} + +#malwarepatrol +malwarepatrol_receipt_code={my $key=${'clamav-unofficial-sigs'}{'malwarepatrol_receipt_code'}||'YOUR-RECEIPT-NUMBER'; $OUT="\"$key\"";} +malwarepatrol_product_code="8" +malwarepatrol_list={((${'clamav-unofficial-sigs'}{'malwarepatrol_list'}||"clamav_basic") eq "clamav_basic") ? "\"clamav_basic\"" : "\"clamav_ext\"";} + + +# ======================== +# Enabled Databases +# ======================== +# Set to no to disable an entire database, if the database is empty it will also be disabled. +additional_enabled={((${'clamav-unofficial-sigs'}{'additional_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +interserver_enabled={((${'clamav-unofficial-sigs'}{'interserver_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +linuxmalwaredetect_enabled={((${'clamav-unofficial-sigs'}{'linuxmalwaredetect_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +# if serial_key YOUR-SERIAL-KEY will be forced to disabled in script +malwareexpert_enabled={((${'clamav-unofficial-sigs'}{'malwareexpert_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +# if receipt_code YOUR-RECEIPT-NUMBER will be forced to disabled in script +malwarepatrol_enabled={((${'clamav-unofficial-sigs'}{'malwarepatrol_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +sanesecurity_enabled={((${'clamav-unofficial-sigs'}{'sanesecurity_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +# if authorisation_signature YOUR-SIGNATURE-NUMBER will be forced to disabled in script +securiteinfo_enabled=={((${'clamav-unofficial-sigs'}{'securiteinfo_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +urlhaus_enabled={((${'clamav-unofficial-sigs'}{'urlhaus_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} +# Yara-Rule Project, automatically disabled if clamav is older than 0.100 and enable_yararules is disabled +yararulesproject_enabled={((${'clamav-unofficial-sigs'}{'yararulesproject_enabled'} || "yes") eq "yes") ? "\"yes\"" : "\"no\"";} + +#Enables yararules in the various databases, automatically +enable_yararules={((${'clamav-unofficial-sigs'}{'enable_yararules'} || "no") eq "yes") ? "\"yes\"" : "\"no\"";} + + +# valid rating: LOW, MEDIUM, HIGH, DISABLE +{ +my $defaultDBR = (( ${'clamav-unofficial-sigs'}{'default_dbs_rating'} || "NOP") ~~ ['LOW', 'MEDIUM', 'HIGH', 'DISABLE']) ? ${'clamav-unofficial-sigs'}{'default_dbs_rating'} : 'MEDIUM' ; + +$OUT .= "default_dbs_rating=\"$defaultDBR\"\n"; + +$OUT .= "# Per Database +# These ratings will override the global rating for the specific database +# valid ratings: LOW | MEDIUM | HIGH | DISABLE\n"; + +my $lmd = (( ${'clamav-unofficial-sigs'}{'linuxmalwaredetect_dbs_rating'} || "NOP") ~~ ['LOW', 'MEDIUM', 'HIGH', 'DISABLE']) ? ${'clamav-unofficial-sigs'}{'linuxmalwaredetect_dbs_rating'} : 'NOP' ; +$OUT .= "linuxmalwaredetect_dbs_rating=\"$lmd\"\n" unless $lmd eq 'NOP'; +my $ss = (( ${'clamav-unofficial-sigs'}{'sanesecurity_dbs_rating'} || "NOP") ~~ ['LOW', 'MEDIUM', 'HIGH', 'DISABLE']) ? ${'clamav-unofficial-sigs'}{'sanesecurity_dbs_rating'} : 'NOP' ; +$OUT .= "sanesecurity_dbs_rating=\"$ss\"\n" unless $ss eq 'NOP'; +my $si = (( ${'clamav-unofficial-sigs'}{'securiteinfo_dbs_rating'} || "NOP") ~~ ['LOW', 'MEDIUM', 'HIGH', 'DISABLE']) ? ${'clamav-unofficial-sigs'}{'securiteinfo_dbs_rating'} : 'NOP' ; +$OUT .= "securiteinfo_dbs_rating=\"$si\"\n" unless $si eq 'NOP'; +my $uhd = (( ${'clamav-unofficial-sigs'}{'urlhaus_dbs_rating'} || "NOP") ~~ ['LOW', 'MEDIUM', 'HIGH', 'DISABLE']) ? ${'clamav-unofficial-sigs'}{'urlhaus_dbs_rating'} : 'NOP' ; +$OUT .= "urlhaus_dbs_rating=\"$uhd\"\n" unless $uhd eq 'NOP'; +my $yrp = (( ${'clamav-unofficial-sigs'}{'yararulesproject_dbs_rating'} || "NOP") ~~ ['LOW', 'MEDIUM', 'HIGH', 'DISABLE']) ? ${'clamav-unofficial-sigs'}{'yararulesproject_dbs_rating'} : 'NOP' ; +$OUT .= "yararulesproject_dbs_rating=\"$yrp\"\n" unless $yrp eq 'NOP'; + +} + +# ======================== +# Additional Databases +# ======================== +{ +return "# additional disabled\n" unless ((${'clamav-unofficial-sigs'}{'additional_enabled'} || "yes") eq "yes"); + +my $additionnal = ${'clamav-unofficial-sigs'}{'additional'} or return "# additional list empty\n"; + +$OUT = "declare -a additional_dbs=(\n"; +my @values = split(/;,/, $additionnal); +for ( @values ) { + $OUT .= " $_ \n"; +} + +$OUT .= ") #END ADDITIONAL DATABASES +"; + +#TODO + +} diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/045Frequencies b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/045Frequencies new file mode 100644 index 0000000..1b35414 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/045Frequencies @@ -0,0 +1,2 @@ +si_update_hours="4" +mbl_update_hours="6" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/065Backup b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/065Backup new file mode 100644 index 0000000..6176441 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/065Backup @@ -0,0 +1 @@ +keep_db_backup="no" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/075Log b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/075Log new file mode 100644 index 0000000..c477361 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/075Log @@ -0,0 +1,3 @@ +enable_logging="yes" +log_file_path="/var/log/clamav-unofficial-sigs" +log_file_name="clamav-unofficial-sigs.log" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/080Proxy b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/080Proxy new file mode 100644 index 0000000..db312b8 --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/080Proxy @@ -0,0 +1,2 @@ +rsync_proxy="" +curl_proxy="" diff --git a/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/099UserConfigComplete b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/099UserConfigComplete new file mode 100644 index 0000000..8ffc65f --- /dev/null +++ b/root/etc/e-smith/templates/etc/clamav-unofficial-sigs/os.conf/099UserConfigComplete @@ -0,0 +1 @@ +user_configuration_complete="yes" diff --git a/root/usr/lib/systemd/system/clamav-unofficial-sigs.service.d/50-koozali.conf b/root/usr/lib/systemd/system/clamav-unofficial-sigs.service.d/50-koozali.conf new file mode 100644 index 0000000..aa4f147 --- /dev/null +++ b/root/usr/lib/systemd/system/clamav-unofficial-sigs.service.d/50-koozali.conf @@ -0,0 +1,2 @@ +[Install] +WantedBy=sme-server.target diff --git a/smeserver-clamav-unofficial-sigs.spec b/smeserver-clamav-unofficial-sigs.spec new file mode 100644 index 0000000..407ffb2 --- /dev/null +++ b/smeserver-clamav-unofficial-sigs.spec @@ -0,0 +1,74 @@ +%define version 0.1.0 +%define release 5 +%define name smeserver-clamav-unofficial-sigs + + +Summary:Unofficial ClamAV signature integration +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: Applications/System +Source: %{name}-%{version}.tar.xz + +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArchitectures: noarch +BuildRequires: e-smith-devtools + +Requires: clamav-unofficial-sigs +Requires: smeserver-clamav + +%description +Configure unofficial ClamAV signatures on SME Server + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read 0.1.0-5.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Sat Jul 30 2022 Brian Read 0.1.0-4.sme +- Re-build and link to latest devtools [SME: 11997] + +* Mon Jun 13 2022 Jean-Philippe Pialasse 0.1.0-3.sme +- migrate script [SME: 11597] + fix missing urlhaus folder + +* Sun Jun 12 2022 Jean-Philippe Pialasse 0.1.0-2.sme +- import to SME10 [SME: 11597] + rewrite the configuraiton using os.conf + add event on installation + systemd compatible + about backup ready, need comment out and new dep + +* Wed Jun 10 2015 Daniel Berteaud - 0.1.0-1 +- initial release + +%prep +%setup -q -n %{name}-%{version} +rm -rf root/etc/e-smith/templates/etc/clamav-unofficial-sigs/clamav-unofficial-sigs.conf + +%build +perl createlinks + +%install +/bin/rm -rf $RPM_BUILD_ROOT +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ + > %{name}-%{version}-filelist + +%files -f %{name}-%{version}-filelist +%defattr(-,root,root) + +%clean +rm -rf $RPM_BUILD_ROOT + +%pre + +%post + +%preun +