diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile index a982bea50..56d641a67 100644 --- a/www/c-icap/Makefile +++ b/www/c-icap/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= c-icap -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= c-icap connects your 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/mvc/app/controllers/OPNsense/CICAP/forms/general.xml b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/general.xml index 36dbf211a..a2f96e5a3 100644 --- a/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/general.xml +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/general.xml @@ -77,4 +77,10 @@ text A name for this server. Used when displaying information about this server (logs, info service, etc). + + general.enable_accesslog + + checkbox + This will enable logging of access log. + diff --git a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.xml b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.xml index dd9d55e00..d54cfa413 100644 --- a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.xml +++ b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.xml @@ -58,5 +58,9 @@ N - + + 1 + Y + + diff --git a/www/c-icap/src/opnsense/mvc/app/views/OPNsense/CICAP/general.volt b/www/c-icap/src/opnsense/mvc/app/views/OPNsense/CICAP/general.volt index 63c7abac1..e8ed5ff26 100644 --- a/www/c-icap/src/opnsense/mvc/app/views/OPNsense/CICAP/general.volt +++ b/www/c-icap/src/opnsense/mvc/app/views/OPNsense/CICAP/general.volt @@ -69,8 +69,8 @@ POSSIBILITY OF SUCH DAMAGE. ajaxCall(url="/api/cicap/service/status", sendData={}, callback=function(data,status) { updateServiceStatusUI(data['status']); }); - - // check if ClamAV plugin is installed + + // check if ClamAV plugin is installed ajaxCall(url="/api/cicap/service/checkclamav", sendData={}, callback=function(data,status) { if (data == "0") { $('#missing_clamav').show(); 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 ce1ba9236..aa6913943 100644 --- a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS @@ -1,3 +1,4 @@ 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 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 463488f40..25398ac6c 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 @@ -55,7 +55,9 @@ RemoteProxyUsers off RemoteProxyUserHeader X-Authenticated-User RemoteProxyUserHeaderEncoded on ServerLog /var/log/c-icap/server.log +{% if helpers.exists('OPNsense.cicap.general.enable_accesslog') and OPNsense.cicap.general.enable_accesslog == '1' %} AccessLog /var/log/c-icap/access.log +{% endif %} Service echo srv_echo.so Include virus_scan.conf diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/newsyslog.conf b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/newsyslog.conf new file mode 100644 index 000000000..1edd4401f --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/newsyslog.conf @@ -0,0 +1,7 @@ +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +{% if helpers.exists('OPNsense.cicap.general.enabled') and OPNsense.cicap.general.enabled|default("0") == "1" %} +{% if helpers.exists('OPNsense.cicap.general.enable_accesslog') and OPNsense.cicap.general.enable_accesslog == '1' %} +/var/log/c-icap/access.log c_icap:c_icap 644 7 * @T00 ZB /var/run/c-icap/c-icap.pid +{% endif %} +/var/log/c-icap/server.log c_icap:c_icap 644 7 * @T00 ZB /var/run/c-icap/c-icap.pid +{% endif %} diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/virus_scan.conf b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/virus_scan.conf index b4e8336a5..6a170db7d 100644 --- a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/virus_scan.conf +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/virus_scan.conf @@ -8,19 +8,23 @@ virus_scan.ScanFileTypes {{ OPNsense.cicap.antivirus.scanfiletypes.replace(',', {% endif %} {% if helpers.exists('OPNsense.cicap.antivirus.sendpercentdata') and OPNsense.cicap.antivirus.sendpercentdata != '' %} -virus_scan.SendPercentData 5 +virus_scan.SendPercentData {{ OPNsense.cicap.antivirus.sendpercentdata }} {% endif %} {% if helpers.exists('OPNsense.cicap.antivirus.startsendpercentdataafter') and OPNsense.cicap.antivirus.startsendpercentdataafter != '' %} -virus_scan.StartSendPercentDataAfter 2M +virus_scan.StartSendPercentDataAfter {{ OPNsense.cicap.antivirus.startsendpercentdataafter }} {% endif %} -{% if helpers.exists('OPNsense.cicap.antivirus.allow204responses') and OPNsense.cicap.antivirus.allow204responses != '' %} +{% if helpers.exists('OPNsense.cicap.antivirus.allow204responses') and OPNsense.cicap.antivirus.allow204responses == '1' %} virus_scan.Allow204Responces on +{% else %} +virus_scan.Allow204Responces off {% endif %} -{% if helpers.exists('OPNsense.cicap.antivirus.passonerror') and OPNsense.cicap.antivirus.passonerror != '' %} +{% if helpers.exists('OPNsense.cicap.antivirus.passonerror') and OPNsense.cicap.antivirus.passonerror == '1' %} +virus_scan.PassOnError on +{% else %} virus_scan.PassOnError off {% endif %} -{% if helpers.exists('OPNsense.cicap.antivirus.cmaxobjectsize') and OPNsense.cicap.antivirus.maxobjectsize != '' %} -virus_scan.MaxObjectSize 5M +{% if helpers.exists('OPNsense.cicap.antivirus.maxobjectsize') and OPNsense.cicap.antivirus.maxobjectsize != '' %} +virus_scan.MaxObjectSize {{ OPNsense.cicap.antivirus.maxobjectsize }} {% endif %} Module common clamd_mod.so clamd_mod.ClamdHost 127.0.0.1