initial commit of file from CVS for smeserver-clamav-unofficial-sigs on Sat Sep 7 20:14:15 AEST 2024

This commit is contained in:
Trevor Batley 2024-09-07 20:14:15 +10:00
parent 6693386b45
commit 2a65881e10
29 changed files with 373 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.gz

21
Makefile Normal file
View File

@ -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)

View File

@ -1,3 +1,15 @@
# smeserver-clamav-unofficial-sigs # <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> smeserver-clamav-unofficial-sigs
SMEServer Koozali developed git repo for smeserver-clamav-unofficial-sigs smecontribs SMEServer Koozali developed git repo for smeserver-clamav-unofficial-sigs smecontribs
## Wiki
<br />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
<br />*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*
<br />

11
additional/CHANGELOG.git Normal file
View File

@ -0,0 +1,11 @@
commit d49776a2678f4125362855ea3079bc29455863fd
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Jun 10 09:32:04 2015 +0200
Fix small typos
commit d9c1d2a35475a70f2a7546ae8617a2e6193eef0a
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Jun 9 18:42:08 2015 +0200
Initial commit

View File

@ -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 <daniel@firewall-services.com> - 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

1
contriborbase Normal file
View File

@ -0,0 +1 @@
contribs10

16
createlinks Normal file
View File

@ -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/));

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
service

View File

@ -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) );
}

View File

@ -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/*

View File

@ -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

View File

@ -0,0 +1,2 @@
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
export PATH

View File

@ -0,0 +1,2 @@
clam_user="clamupdate"
clam_group="clamupdate"

View File

@ -0,0 +1 @@
clam_dbs="/var/lib/clamav"

View File

@ -0,0 +1 @@
clamd_pid="/var/run/clamd/clamd.pid"

View File

@ -0,0 +1 @@
clamd_socket="/var/run/clamd/clamd.socket"

View File

@ -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

View File

@ -0,0 +1,2 @@
reload_dbs="yes"
reload_opt="clamdscan --config-file=/etc/clamd.d/scan.conf --reload"

View File

@ -0,0 +1 @@
clamd_restart_opt="/usr/bin/systemctl try-restart clamd"

View File

@ -0,0 +1,4 @@
enable_random="yes"
min_sleep_time="60"
max_sleep_time="600"

View File

@ -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
}

View File

@ -0,0 +1,2 @@
si_update_hours="4"
mbl_update_hours="6"

View File

@ -0,0 +1 @@
keep_db_backup="no"

View File

@ -0,0 +1,3 @@
enable_logging="yes"
log_file_path="/var/log/clamav-unofficial-sigs"
log_file_name="clamav-unofficial-sigs.log"

View File

@ -0,0 +1,2 @@
rsync_proxy=""
curl_proxy=""

View File

@ -0,0 +1 @@
user_configuration_complete="yes"

View File

@ -0,0 +1,2 @@
[Install]
WantedBy=sme-server.target

View File

@ -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 <brianr@koozali.org> 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 <brianr@bjsystems.co.uk> 0.1.0-4.sme
- Re-build and link to latest devtools [SME: 11997]
* Mon Jun 13 2022 Jean-Philippe Pialasse <tests@pialasse.com> 0.1.0-3.sme
- migrate script [SME: 11597]
fix missing urlhaus folder
* Sun Jun 12 2022 Jean-Philippe Pialasse <tests@pialasse.com> 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 <daniel@firewall-services.com> - 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