From 669dfe2af015ace07ba9fe0407eeaef3f4f2e194 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Dec 2018 19:02:19 +0100 Subject: [PATCH] www/c-icap: add customized virus found page (#1048) --- www/c-icap/Makefile | 2 +- .../opnsense/scripts/OPNsense/CICAP/setup.sh | 3 + .../service/templates/OPNsense/CICAP/+TARGETS | 5 ++ .../templates/OPNsense/CICAP/VIRUS_FOUND | 67 +++++++++++++++++++ .../templates/OPNsense/CICAP/VIR_MODE_HEAD | 6 ++ .../OPNsense/CICAP/VIR_MODE_PROGRESS | 1 + .../templates/OPNsense/CICAP/VIR_MODE_TAIL | 4 ++ .../OPNsense/CICAP/VIR_MODE_VIRUS_FOUND | 64 ++++++++++++++++++ .../templates/OPNsense/CICAP/c-icap.conf | 2 +- 9 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIRUS_FOUND create mode 100644 www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_HEAD create mode 100644 www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_PROGRESS create mode 100644 www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_TAIL create mode 100644 www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_VIRUS_FOUND diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile index 2106b104e..ae60824d7 100644 --- a/www/c-icap/Makefile +++ b/www/c-icap/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= c-icap -PLUGIN_VERSION= 1.6 +PLUGIN_VERSION= 1.7 PLUGIN_COMMENT= c-icap connects the web proxy with a virus scanner PLUGIN_DEPENDS= c-icap c-icap-modules PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh b/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh index 9e1e74165..d9bc15677 100755 --- a/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh +++ b/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh @@ -7,3 +7,6 @@ chmod 750 /var/run/c-icap mkdir -p /var/log/c-icap chown -R c_icap:c_icap /var/log/c-icap chmod 750 /var/log/c-icap + +mkdir -p /tmp/c-icap/templates/virus_scan/en +chmod -R 755 /tmp/c-icap/ diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS index aa6913943..4be92f826 100644 --- a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS @@ -2,3 +2,8 @@ c_icap:/etc/rc.conf.d/c_icap c-icap.conf:/usr/local/etc/c-icap/c-icap.conf newsyslog.conf:/etc/newsyslog.conf.d/c-icap virus_scan.conf:/usr/local/etc/c-icap/virus_scan.conf +VIRUS_FOUND:/tmp/c-icap/templates/virus_scan/en/VIRUS_FOUND +VIR_MODE_HEAD:/tmp/c-icap/templates/virus_scan/en/VIR_MODE_HEAD +VIR_MODE_PROGRESS:/tmp/c-icap/templates/virus_scan/en/VIR_MODE_PROGRESS +VIR_MODE_TAIL:/tmp/c-icap/templates/virus_scan/en/VIR_MODE_TAIL +VIR_MODE_VIRUS_FOUND:/tmp/c-icap/templates/virus_scan/en/VIR_MODE_VIRUS_FOUND diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIRUS_FOUND b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIRUS_FOUND new file mode 100644 index 000000000..dccbadb81 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIRUS_FOUND @@ -0,0 +1,67 @@ + + + + + MALWARE FOUND + + + + + +

MALWARE FOUND

+ +

You tried to upload/download a file that contains the malware: %VVN
+ The HTTP location is: + %huo +

+{% if helpers.exists('OPNsense.cicap.general.serveradmin') and OPNsense.cicap.general.serveradmin != '' %} +

For more information contact {{ OPNsense.cicap.general.serveradmin }}

+{% else %} +

For more information contact your system administrator

+{% endif %} +
+ + + diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_HEAD b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_HEAD new file mode 100644 index 000000000..ca3cff67b --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_HEAD @@ -0,0 +1,6 @@ + + + + + +

c-icap download page for %VFR

diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_PROGRESS b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_PROGRESS new file mode 100644 index 000000000..2f077073a --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_PROGRESS @@ -0,0 +1 @@ +Downloaded %Ib bytes from %VFS of data
diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_TAIL b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_TAIL new file mode 100644 index 000000000..30fb71518 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_TAIL @@ -0,0 +1,4 @@ +Download your file(size=%Ib) from %VFR
+ + + diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_VIRUS_FOUND b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_VIRUS_FOUND new file mode 100644 index 000000000..d05c96880 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/VIR_MODE_VIRUS_FOUND @@ -0,0 +1,64 @@ + + + + + MALWARE FOUND + + + + + +

MALWARE FOUND

+ +

You tried to upload/download a file that contains the malware: %VVN
+ The HTTP location is: + %huo +

+

For more information contact your system administrator

+ +
+ + + diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf index c8d0ec7f4..37580540a 100644 --- a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf @@ -72,7 +72,7 @@ Pipelining on SupportBuggyClients off ModulesDir /usr/local/lib/c_icap ServicesDir /usr/local/lib/c_icap -TemplateDir /usr/local/share/c_icap/templates/ +TemplateDir /tmp/c-icap/templates/ TemplateDefaultLanguage en LoadMagicFile /usr/local/etc/c-icap/c-icap.magic ServerLog /var/log/c-icap/server.log