diff --git a/security/clamav/src/opnsense/mvc/app/models/OPNsense/ClamAV/General.xml b/security/clamav/src/opnsense/mvc/app/models/OPNsense/ClamAV/General.xml index 4c329a83f..d4e402e9f 100644 --- a/security/clamav/src/opnsense/mvc/app/models/OPNsense/ClamAV/General.xml +++ b/security/clamav/src/opnsense/mvc/app/models/OPNsense/ClamAV/General.xml @@ -12,7 +12,7 @@ Y - 0 + 1 Y diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile new file mode 100644 index 000000000..659e597c5 --- /dev/null +++ b/www/c-icap/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= c-icap +PLUGIN_VERSION= 0.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 +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/www/c-icap/pkg-descr b/www/c-icap/pkg-descr new file mode 100644 index 000000000..34e142c38 --- /dev/null +++ b/www/c-icap/pkg-descr @@ -0,0 +1,6 @@ +c-icap is an implementation of an ICAP server. +It can be used with HTTP proxies that support +the ICAP protocol to implement content adaptation +and filtering services. + +WWW: http://c-icap.sourceforge.net/ diff --git a/www/c-icap/src/etc/inc/plugins.inc.d/cicap.inc b/www/c-icap/src/etc/inc/plugins.inc.d/cicap.inc new file mode 100644 index 000000000..55b94791f --- /dev/null +++ b/www/c-icap/src/etc/inc/plugins.inc.d/cicap.inc @@ -0,0 +1,49 @@ + gettext('C-ICAP server'), + 'configd' => array( + 'restart' => array('cicap restart'), + 'start' => array('cicap start'), + 'stop' => array('cicap stop'), + ), + 'name' => 'cicap', + 'pidfile' => '/var/run/c-icap/c-icap.pid' + ); + } + + return $services; +} diff --git a/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/AntivirusController.php b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/AntivirusController.php new file mode 100644 index 000000000..b4018a4a7 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/AntivirusController.php @@ -0,0 +1,77 @@ +request->isGet()) { + $mdlAntivirus = new Antivirus(); + $result['antivirus'] = $mdlAntivirus->getNodes(); + } + return $result; + } + + public function setAction() + { + $result = array("result"=>"failed"); + if ($this->request->isPost()) { + // load model and update with provided data + $mdlAntivirus = new Antivirus(); + $mdlAntivirus->setNodes($this->request->getPost("antivirus")); + + // perform validation + $valMsgs = $mdlAntivirus->performValidation(); + foreach ($valMsgs as $field => $msg) { + if (!array_key_exists("validations", $result)) { + $result["validations"] = array(); + } + $result["validations"]["antivirus.".$msg->getField()] = $msg->getMessage(); + } + + // serialize model to config and save + if ($valMsgs->count() == 0) { + $mdlAntivirus->serializeToConfig(); + Config::getInstance()->save(); + $result["result"] = "saved"; + } + } + return $result; + } +} diff --git a/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/GeneralController.php b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/GeneralController.php new file mode 100644 index 000000000..f66807e73 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/GeneralController.php @@ -0,0 +1,77 @@ +request->isGet()) { + $mdlGeneral = new General(); + $result['general'] = $mdlGeneral->getNodes(); + } + return $result; + } + + public function setAction() + { + $result = array("result"=>"failed"); + if ($this->request->isPost()) { + // load model and update with provided data + $mdlGeneral = new General(); + $mdlGeneral->setNodes($this->request->getPost("general")); + + // perform validation + $valMsgs = $mdlGeneral->performValidation(); + foreach ($valMsgs as $field => $msg) { + if (!array_key_exists("validations", $result)) { + $result["validations"] = array(); + } + $result["validations"]["general.".$msg->getField()] = $msg->getMessage(); + } + + // serialize model to config and save + if ($valMsgs->count() == 0) { + $mdlGeneral->serializeToConfig(); + Config::getInstance()->save(); + $result["result"] = "saved"; + } + } + return $result; + } +} diff --git a/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/ServiceController.php b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/ServiceController.php new file mode 100644 index 000000000..3e3f0a837 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/Api/ServiceController.php @@ -0,0 +1,160 @@ +configdRun("firmware plugin clamav"); + return $response; + } + + /** + * start cicap service (in background) + * @return array + */ + public function startAction() + { + if ($this->request->isPost()) { + $backend = new Backend(); + $response = $backend->configdRun("cicap start", true); + return array("response" => $response); + } else { + return array("response" => array()); + } + } + + /** + * stop cicap service + * @return array + */ + public function stopAction() + { + if ($this->request->isPost()) { + $backend = new Backend(); + $response = $backend->configdRun("cicap stop"); + return array("response" => $response); + } else { + return array("response" => array()); + } + } + + /** + * restart cicap service + * @return array + */ + public function restartAction() + { + if ($this->request->isPost()) { + $backend = new Backend(); + $response = $backend->configdRun("cicap restart"); + return array("response" => $response); + } else { + return array("response" => array()); + } + } + + /** + * retrieve status of cicap + * @return array + * @throws \Exception + */ + public function statusAction() + { + $backend = new Backend(); + $mdlGeneral = new General(); + $response = $backend->configdRun("cicap status"); + + if (strpos($response, "not running") > 0) { + if ($mdlGeneral->enabled->__toString() == 1) { + $status = "stopped"; + } else { + $status = "disabled"; + } + } elseif (strpos($response, "is running") > 0) { + $status = "running"; + } elseif ($mdlGeneral->enabled->__toString() == 0) { + $status = "disabled"; + } else { + $status = "unkown"; + } + + + return array("status" => $status); + } + + /** + * reconfigure cicap, generate config and reload + */ + public function reconfigureAction() + { + if ($this->request->isPost()) { + // close session for long running action + $this->sessionClose(); + + $mdlGeneral = new General(); + $backend = new Backend(); + + $runStatus = $this->statusAction(); + + // stop cicap if it is running or not + $this->stopAction(); + + // generate template + $backend->configdRun('template reload OPNsense/CICAP'); + + // (res)start daemon + if ($mdlGeneral->enabled->__toString() == 1) { + $this->startAction(); + } + + return array("status" => "ok"); + } else { + return array("status" => "failed"); + } + } +} diff --git a/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/GeneralController.php b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/GeneralController.php new file mode 100644 index 000000000..878f1f325 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/GeneralController.php @@ -0,0 +1,40 @@ +view->title = gettext("C-ICAP Settings"); + $this->view->generalForm = $this->getForm("general"); + $this->view->antivirusForm = $this->getForm("antivirus"); + $this->view->pick('OPNsense/CICAP/general'); + } +} diff --git a/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/antivirus.xml b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/antivirus.xml new file mode 100644 index 000000000..970cf7aa1 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/antivirus.xml @@ -0,0 +1,45 @@ +
+ + antivirus.enable_clamav + + checkbox + This will activate ClamAV + + + antivirus.scanfiletypes + + select_multiple + + Choose for which file types to scan, if unsure select all. + + + antivirus.sendpercentdata + + text + The percentage of data that can be sent by the c-icap server before receiving the complete body of a request. This feature in conjuction with the folowing can be useful because if the download of the object takes a lot of time the connection of web client to proxy can be expired. + + + antivirus.startsendpercentdataafter + + text + Only if the object is bigger than size then the percentage of data which defined by SendPercentData sent by the c-icap server before receiving the complete body of request. + + + antivirus.allow204responses + + checkbox + Disable 204 responses outside previews for virus_scan if your ICAP client does not support it. + + + antivirus.passonerror + + checkbox + Pass the content instead of blocking it, in the case when the virus scanner or the virus_scan module finds an error. + + + antivirus.maxobjectsize + + text + The maximum size of files which will be scanned by antivirus service. You can use K and M indicators to define size in kilobytes or megabytes. + +
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 new file mode 100644 index 000000000..f604435ac --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/controllers/OPNsense/CICAP/forms/general.xml @@ -0,0 +1,80 @@ +
+ + general.enabled + + checkbox + This will activate the c-icap service. + + + general.timeout + + text + The time in seconds after which a connection without activity can be cancelled. + + + general.maxkeepaliverequests + + text + The maximum number of requests can be served by one connection + + + general.keepalivetimeout + + text + The maximum time in seconds waiting for a new requests before a connection will be closed. + + + general.startservers + + text + The initial number of server processes. Each server process generates a number of threads, which serve the requests. + + + general.maxservers + + text + The maximum allowed number of server processes. + + + general.minsparethreads + + text + If the number of the available threads is less than number, the c-icap server starts a new child. + + + general.maxsparethreads + + test + If the number of the available threads is more than number then the c-icap server kills a child. + + + general.threadsperchild + + text + The number of threads per child process. + + + general.maxrequestsperchild + + text + The maximum number of requests that a child process can serve. After this number has been reached, process dies. + + + general.listenaddress + + text + Network address that the c-icap server uses to listen to requests. + + + general.serveradmin + + text + The Administrator of this server. Used when displaying information about this server. + + + general.servername + + text + A name for this server. Used when displaying information about this server (logs, info service, etc). + +
diff --git a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/ACL/ACL.xml b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/ACL/ACL.xml new file mode 100644 index 000000000..11ea1ad0c --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: C-ICAP + + ui/cicap/* + api/cicap/* + + + diff --git a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Antivirus.php b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Antivirus.php new file mode 100644 index 000000000..60fa65459 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Antivirus.php @@ -0,0 +1,35 @@ + + //OPNsense/cicap/antivirus + AntiVirus configuration + 1.0.0 + + + 0 + Y + + + + Y + Y + + Text files + Binary files + Executables + Archives + GIF animations + JPEG pictures + Microsoft office files + + + + 5 + Y + + + 2M + Y + + + 1 + Y + + + N + Y + + + 5M + Y + + + diff --git a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.php b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.php new file mode 100644 index 000000000..c845b4947 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/General.php @@ -0,0 +1,35 @@ + + //OPNsense/cicap/general + c-icap configuration + 1.0.0 + + + 0 + Y + + + 300 + Y + + + 100 + Y + + + 600 + Y + + + 3 + Y + + + 10 + Y + + + 10 + Y + + + 20 + Y + + + 10 + Y + + + 0 + Y + + + ::1 + N + N + , + Y + + + + N + + + + N + + + diff --git a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml new file mode 100644 index 000000000..4413236c5 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml @@ -0,0 +1,5 @@ + + + + + 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 new file mode 100644 index 000000000..63c7abac1 --- /dev/null +++ b/www/c-icap/src/opnsense/mvc/app/views/OPNsense/CICAP/general.volt @@ -0,0 +1,104 @@ +{# + +OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. +This file is Copyright © 2017 by Michael Muenz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} + + +
+
+
+ {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
+
+ +
+
+
+
+
+ {{ partial("layout_partials/base_form",['fields':antivirusForm,'id':'frm_antivirus_settings'])}} +
+
+ +
+
+
+
+ + diff --git a/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh b/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh new file mode 100644 index 000000000..9e1e74165 --- /dev/null +++ b/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +mkdir -p /var/run/c-icap +chown -R c_icap:c_icap /var/run/c-icap +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 diff --git a/www/c-icap/src/opnsense/service/conf/actions.d/actions_cicap.conf b/www/c-icap/src/opnsense/service/conf/actions.d/actions_cicap.conf new file mode 100644 index 000000000..f93eb81b5 --- /dev/null +++ b/www/c-icap/src/opnsense/service/conf/actions.d/actions_cicap.conf @@ -0,0 +1,29 @@ +[start] +command:/usr/local/opnsense/scripts/OPNsense/CICAP/setup.sh;/usr/local/etc/rc.d/c-icap start +parameters: +type:script +message:starting c-icap + +[stop] +command:/usr/local/etc/rc.d/c-icap stop; exit 0 +parameters: +type:script +message:stopping c-icap + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/CICAP/setup.sh;/usr/local/etc/rc.d/c-icap restart +parameters: +type:script +message:restarting c-icap + +[reconfigure] +command:/usr/local/opnsense/scripts/OPNsense/CICAP/setup.sh;/usr/local/etc/rc.d/c-icap restart +parameters: +type:script +message:reconfigure c-icap + +[status] +command:/usr/local/etc/rc.d/c-icap status;exit 0 +parameters: +type:script_output +message:request c-icap status diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS new file mode 100644 index 000000000..ce1ba9236 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/+TARGETS @@ -0,0 +1,3 @@ +c_icap:/etc/rc.conf.d/c_icap +c-icap.conf:/usr/local/etc/c-icap/c-icap.conf +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 new file mode 100644 index 000000000..463488f40 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf @@ -0,0 +1,62 @@ +{% if helpers.exists('OPNsense.cicap.general.enabled') and OPNsense.cicap.general.enabled == '1' %} + +PidFile /var/run/c-icap/c-icap.pid +CommandsSocket /var/run/c-icap/c-icap.ctl +{% if helpers.exists('OPNsense.cicap.general.timeout') and OPNsense.cicap.general.timeout != '' %} +Timeout {{ OPNsense.cicap.general.timeout }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.maxkeepaliverequests') and OPNsense.cicap.general.maxkeepaliverequests != '' %} +MaxKeepAliveRequests {{ OPNsense.cicap.general.maxkeepaliverequests }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.keepalivetimeout') and OPNsense.cicap.general.keepalivetimeout != '' %} +KeepAliveTimeout {{ OPNsense.cicap.general.keepalivetimeout }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.startservers') and OPNsense.cicap.general.startservers != '' %} +StartServers {{ OPNsense.cicap.general.startservers }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.maxservers') and OPNsense.cicap.general.maxservers != '' %} +MaxServers {{ OPNsense.cicap.general.maxservers }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.minsparethreads') and OPNsense.cicap.general.minsparethreads != '' %} +MinSpareThreads {{ OPNsense.cicap.general.minsparethreads }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.maxsparethreads') and OPNsense.cicap.general.maxsparethreads != '' %} +MaxSpareThreads {{ OPNsense.cicap.general.maxsparethreads }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.threadsperchild') and OPNsense.cicap.general.threadsperchild != '' %} +ThreadsPerChild {{ OPNsense.cicap.general.threadsperchild }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.maxrequestsperchild') and OPNsense.cicap.general.maxrequestsperchild != '' %} +MaxRequestsPerChild {{ OPNsense.cicap.general.maxrequestsperchild }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.listenaddress') and OPNsense.cicap.general.listenaddress != '' %} +ListenAddress {{ OPNsense.cicap.general.listenaddress }} +{% endif %} +Port 1344 +{% if helpers.exists('OPNsense.cicap.general.serveradmin') and OPNsense.cicap.general.serveradmin != '' %} +ServerAdmin {{ OPNsense.cicap.general.serveradmin }} +{% endif %} +{% if helpers.exists('OPNsense.cicap.general.servername') and OPNsense.cicap.general.servername != '' %} +ServerName {{ OPNsense.cicap.general.servername }} +{% else %} +ServerName {{ system.hostname }} +{% endif %} +TmpDir /var/tmp +MaxMemObject 131072 +DebugLevel 1 +Pipelining on +SupportBuggyClients off +ModulesDir /usr/local/lib/c_icap +ServicesDir /usr/local/lib/c_icap +TemplateDir /usr/local/share/c_icap/templates/ +TemplateDefaultLanguage en +LoadMagicFile /usr/local/etc/c-icap/c-icap.magic +RemoteProxyUsers off +RemoteProxyUserHeader X-Authenticated-User +RemoteProxyUserHeaderEncoded on +ServerLog /var/log/c-icap/server.log +AccessLog /var/log/c-icap/access.log +Service echo srv_echo.so +Include virus_scan.conf + +{% endif %} diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c_icap b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c_icap new file mode 100644 index 000000000..d1c1b74e4 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c_icap @@ -0,0 +1,6 @@ +{% if helpers.exists('OPNsense.cicap.general.enabled') and OPNsense.cicap.general.enabled == '1' %} +c_icap_opnsense_bootup_run="/usr/local/opnsense/scripts/OPNsense/CICAP/setup.sh" +c_icap_enable="YES" +{% else %} +c_icap_enable="NO" +{% 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 new file mode 100644 index 000000000..b4e8336a5 --- /dev/null +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/virus_scan.conf @@ -0,0 +1,28 @@ +{% if helpers.exists('OPNsense.cicap.antivirus.enable_clamav') and OPNsense.cicap.antivirus.enable_clamav == '1' %} +Service antivirus_module virus_scan.so +ServiceAlias srv_clamav virus_scan +ServiceAlias avscan virus_scan?allow204=on&sizelimit=off&mode=simple + +{% if helpers.exists('OPNsense.cicap.antivirus.scanfiletypes') and OPNsense.cicap.antivirus.scanfiletypes != '' %} +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 +{% endif %} +{% if helpers.exists('OPNsense.cicap.antivirus.startsendpercentdataafter') and OPNsense.cicap.antivirus.startsendpercentdataafter != '' %} +virus_scan.StartSendPercentDataAfter 2M +{% endif %} +{% if helpers.exists('OPNsense.cicap.antivirus.allow204responses') and OPNsense.cicap.antivirus.allow204responses != '' %} +virus_scan.Allow204Responces on +{% endif %} +{% if helpers.exists('OPNsense.cicap.antivirus.passonerror') and OPNsense.cicap.antivirus.passonerror != '' %} +virus_scan.PassOnError off +{% endif %} +{% if helpers.exists('OPNsense.cicap.antivirus.cmaxobjectsize') and OPNsense.cicap.antivirus.maxobjectsize != '' %} +virus_scan.MaxObjectSize 5M +{% endif %} +Module common clamd_mod.so +clamd_mod.ClamdHost 127.0.0.1 +clamd_mod.ClamdPort 3310 +{% endif %}