diff options
Diffstat (limited to 'config/dansguardian')
-rw-r--r-- | config/dansguardian/blockedflash.swf | bin | 0 -> 2740 bytes | |||
-rwxr-xr-x | config/dansguardian/dansguardian.inc | 34 | ||||
-rw-r--r-- | config/dansguardian/dansguardian.xml | 14 | ||||
-rwxr-xr-x | config/dansguardian/dansguardian_about.php | 1 | ||||
-rw-r--r-- | config/dansguardian/dansguardian_blacklist.xml | 4 | ||||
-rw-r--r-- | config/dansguardian/dansguardian_config.xml | 4 | ||||
-rwxr-xr-x | config/dansguardian/dansguardian_groups.xml | 4 | ||||
-rw-r--r-- | config/dansguardian/dansguardian_ips_header.xml | 96 | ||||
-rw-r--r-- | config/dansguardian/dansguardian_limits.xml | 4 | ||||
-rw-r--r-- | config/dansguardian/dansguardian_log.xml | 4 | ||||
-rwxr-xr-x | config/dansguardian/dansguardian_sync.xml | 4 | ||||
-rw-r--r-- | config/dansguardian/dansguardian_users_header.xml | 4 |
12 files changed, 172 insertions, 1 deletions
diff --git a/config/dansguardian/blockedflash.swf b/config/dansguardian/blockedflash.swf Binary files differnew file mode 100644 index 00000000..ef53ee44 --- /dev/null +++ b/config/dansguardian/blockedflash.swf diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc index 2c14fca8..1c079fe7 100755 --- a/config/dansguardian/dansguardian.inc +++ b/config/dansguardian/dansguardian.inc @@ -193,6 +193,7 @@ function sync_package_dansguardian() { "/lists/bannedmimetypelist", "/lists/headerregexplist", "/lists/bannedregexpheaderlist", + "/lists/authplugins/ipgroups", "/lists/contentscanners/exceptionvirusextensionlist", "/lists/contentscanners/exceptionvirusmimetypelist", "/lists/contentscanners/exceptionvirussitelist", @@ -641,7 +642,19 @@ function sync_package_dansguardian() { $filtergroupslist.=$matches[1]."=filter".$count."\n"; } } + if ($config['installedpackages']['dansguardianips']['config'][0][$dansguardian_group_name]!=""){ + $import_ips = explode("\n", base64_decode($config['installedpackages']['dansguardianips']['config'][0][$dansguardian_group_name])); + asort($import_ips); + $config['installedpackages']['dansguardianips']['config'][0][$dansguardian_group_name]=base64_encode(implode("\n", $import_ips)); + foreach ($import_ips as $new_ip){ + if (preg_match("/(\S+)\s+(.*)/",$new_ip,$matches)) + $filtergroupsiplist.=$matches[1]." = filter".$count." #".$matches[2]."\n"; + elseif (preg_match("/(\S+)/",$new_ip,$matches)) + $filtergroupsiplist.=$matches[1]." = filter".$count."\n"; + } + } $filtergroup_count=count($import_users); + $filtergroupip_count=count($import_ips); #Default group catch all unauth groups as well non listed users if($count > 1) $user_xml .=<<<EOF @@ -659,7 +672,22 @@ function sync_package_dansguardian() { <encoding>base64</encoding> </field> EOF; + $ips_xml .=<<<EOF + <field> + <name>{$dansguardian_groups['description']} ({$filtergroupip_count})</name> + <type>listtopic</type> + </field> + <field> + <fieldname>{$dansguardian_group_name}</fieldname> + <fielddescr>{$dansguardian_groups['name']}</fielddescr> + <description><![CDATA[Include ip addresses and or ipadresses/netmask for this group one per line<br>Hint:192.168.1.0/255.255.255.0<br>192.168.1.5]]></description> + <type>textarea</type> + <cols>80</cols><rows>12</rows> + <encoding>base64</encoding> + </field> +EOF; + $count++; } if ($user_xml==""){ @@ -678,10 +706,14 @@ EOF; } #Create/update filtergroupslist file_put_contents($dansguardian_dir."/lists/filtergroupslist",$filtergroupslist,LOCK_EX); + #Create/update filtergroupsiplist + file_put_contents($dansguardian_dir."/lists/authplugins/ipgroups",$filtergroupsiplist,LOCK_EX); #Create/update userlist xml file + $ips_xml_header=file_get_contents("/usr/local/pkg/dansguardian_ips_header.xml"); $user_xml_header=file_get_contents("/usr/local/pkg/dansguardian_users_header.xml"); $user_xml_footer=file_get_contents("/usr/local/pkg/dansguardian_users_footer.xml"); file_put_contents("/usr/local/pkg/dansguardian_users.xml",$user_xml_header.$user_xml.$user_xml_footer,LOCK_EX); + file_put_contents("/usr/local/pkg/dansguardian_ips.xml",$ips_xml_header.$ips_xml.$user_xml_footer,LOCK_EX); #Create report template if (is_dir("/usr/local/share/dansguardian/languages/".$reportlanguage)) @@ -846,7 +878,7 @@ EOF; $libexec_dir="/usr/local/libexec/dansguardian/"; if (preg_match("/clamd/",$dansguardian_config['content_scanners'])){ - if (!file_exists('/var/db/clamav/main.cvd')){ + if (!(file_exists('/var/db/clamav/main.cvd')||file_exists('/var/db/clamav/main.cld'))){ file_notice("Dansguardian - No antivirus database found for clamav, running freshclam in background.",""); log_error('No antivirus database found for clamav, running freshclam in background.'); mwexec_bg('/usr/local/bin/freshclam'); diff --git a/config/dansguardian/dansguardian.xml b/config/dansguardian/dansguardian.xml index b49bc0fc..df7bd1c4 100644 --- a/config/dansguardian/dansguardian.xml +++ b/config/dansguardian/dansguardian.xml @@ -74,6 +74,11 @@ <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> + <item>http://www.pfsense.org/packages/config/dansguardian/dansguardian_ips_header.xml</item> + <prefix>/usr/local/pkg/</prefix> + <chmod>0755</chmod> + </additional_files_needed> + <additional_files_needed> <item>http://www.pfsense.org/packages/config/dansguardian/dansguardian_users_header.xml</item> <prefix>/usr/local/pkg/</prefix> <chmod>0755</chmod> @@ -168,6 +173,11 @@ <prefix>/usr/local/pkg/</prefix> <chmod>0755</chmod> </additional_files_needed> + <additional_files_needed> + <item>http://www.pfsense.org/packages/config/dansguardian/blockedflash.swf</item> + <prefix>/usr/local/share/dansguardian/</prefix> + <chmod>0755</chmod> + </additional_files_needed> <tabs> <tab> <text>Daemon</text> @@ -199,6 +209,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> diff --git a/config/dansguardian/dansguardian_about.php b/config/dansguardian/dansguardian_about.php index 306ddc3e..f9c9e260 100755 --- a/config/dansguardian/dansguardian_about.php +++ b/config/dansguardian/dansguardian_about.php @@ -59,6 +59,7 @@ include("head.inc"); $tab_array[] = array(gettext("Access Lists"), false, "/pkg_edit.php?xml=dansguardian_antivirus.xml&id=0"); $tab_array[] = array(gettext("Groups"), false, "/pkg.php?xml=dansguardian_groups.xml&id=0"); $tab_array[] = array(gettext("Users"), false, "/pkg.php?xml=dansguardian_users.xml&id=0"); + $tab_array[] = array(gettext("IPs"), false, "/pkg.php?xml=dansguardian_ips.xml&id=0"); $tab_array[] = array(gettext("Report and Log"), false, "/pkg_edit.php?xml=dansguardian_log.xml&id=0"); $tab_array[] = array(gettext("XMLRPC Sync"), false, "/pkg_edit.php?xml=dansguardian_sync.xml&id=0"); $tab_array[] = array(gettext("Help"), true, "/dansguardian_about.php"); diff --git a/config/dansguardian/dansguardian_blacklist.xml b/config/dansguardian/dansguardian_blacklist.xml index cf4e3c15..a8895342 100644 --- a/config/dansguardian/dansguardian_blacklist.xml +++ b/config/dansguardian/dansguardian_blacklist.xml @@ -77,6 +77,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> diff --git a/config/dansguardian/dansguardian_config.xml b/config/dansguardian/dansguardian_config.xml index c561de98..11a34434 100644 --- a/config/dansguardian/dansguardian_config.xml +++ b/config/dansguardian/dansguardian_config.xml @@ -77,6 +77,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> diff --git a/config/dansguardian/dansguardian_groups.xml b/config/dansguardian/dansguardian_groups.xml index 4f56601f..4849126d 100755 --- a/config/dansguardian/dansguardian_groups.xml +++ b/config/dansguardian/dansguardian_groups.xml @@ -76,6 +76,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> diff --git a/config/dansguardian/dansguardian_ips_header.xml b/config/dansguardian/dansguardian_ips_header.xml new file mode 100644 index 00000000..2029fabf --- /dev/null +++ b/config/dansguardian/dansguardian_ips_header.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd"> +<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?> +<packagegui> + <copyright> + <![CDATA[ +/* $Id$ */ +/* ========================================================================== */ +/* + dansguardian_ips.xml + part of the dansguardian for pfSense + Copyright (C) 2012 Marcello Coutinho + + 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. + */ +/* ========================================================================== */ + ]]> + </copyright> + <description>Describe your package here</description> + <requirements>Describe your package requirements here</requirements> + <faq>Currently there are no FAQ items provided.</faq> + <name>dansguardianips</name> + <version>1.0</version> + <title>Services: Dansguardian</title> + <include_file>/usr/local/pkg/dansguardian.inc</include_file> + <tabs><tab> + <text>Daemon</text> + <url>/pkg_edit.php?xml=dansguardian.xml&id=0</url> + </tab> + <tab> + <text>General</text> + <url>/pkg_edit.php?xml=dansguardian_config.xml&id=0</url> + </tab> + <tab> + <text>Limits</text> + <url>/pkg_edit.php?xml=dansguardian_limits.xml&id=0</url> + </tab> + <tab> + <text>Blacklist</text> + <url>/pkg_edit.php?xml=dansguardian_blacklist.xml&id=0</url> + </tab> + <tab> + <text>Access Lists</text> + <url>/pkg_edit.php?xml=dansguardian_antivirus_acl.xml&id=0</url> + </tab> + <tab> + <text>Groups</text> + <url>/pkg.php?xml=dansguardian_groups.xml</url> + </tab> + <tab> + <text>Users</text> + <url>/pkg_edit.php?xml=dansguardian_users.xml</url> + </tab> + <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + <active/> + </tab> + <tab> + <text>Report and log</text> + <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> + </tab> + <tab> + <text>XMLRPC Sync</text> + <url>/pkg_edit.php?xml=dansguardian_sync.xml&id=0</url> + </tab> + <tab> + <text>Help</text> + <url>/dansguardian_about.php</url> + </tab> +</tabs> + <fields> +
\ No newline at end of file diff --git a/config/dansguardian/dansguardian_limits.xml b/config/dansguardian/dansguardian_limits.xml index e28393a1..eef24d52 100644 --- a/config/dansguardian/dansguardian_limits.xml +++ b/config/dansguardian/dansguardian_limits.xml @@ -77,6 +77,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> diff --git a/config/dansguardian/dansguardian_log.xml b/config/dansguardian/dansguardian_log.xml index 5fd49138..3a0f241e 100644 --- a/config/dansguardian/dansguardian_log.xml +++ b/config/dansguardian/dansguardian_log.xml @@ -76,6 +76,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> <active/> diff --git a/config/dansguardian/dansguardian_sync.xml b/config/dansguardian/dansguardian_sync.xml index f2b9d2e3..c041f398 100755 --- a/config/dansguardian/dansguardian_sync.xml +++ b/config/dansguardian/dansguardian_sync.xml @@ -75,6 +75,10 @@ <url>/pkg_edit.php?xml=dansguardian_users.xml</url> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and Log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> diff --git a/config/dansguardian/dansguardian_users_header.xml b/config/dansguardian/dansguardian_users_header.xml index 921d7ebf..70edb5fe 100644 --- a/config/dansguardian/dansguardian_users_header.xml +++ b/config/dansguardian/dansguardian_users_header.xml @@ -76,6 +76,10 @@ <active/> </tab> <tab> + <text>IPs</text> + <url>/pkg_edit.php?xml=dansguardian_ips.xml</url> + </tab> + <tab> <text>Report and log</text> <url>/pkg_edit.php?xml=dansguardian_log.xml&id=0</url> </tab> |