]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Fixed authentication not working when using proxy
authorManiacikarus <csm-mail@gmx.de>
Sat, 5 Apr 2008 11:54:44 +0000 (13:54 +0200)
committerManiacikarus <csm-mail@gmx.de>
Sat, 5 Apr 2008 11:54:44 +0000 (13:54 +0200)
Changed redirector to be more dynamic and handle new redirectors
Changed proxy cgi to support one new redirector and allways use the default one
Added recent changes to core 11
Changed clamd.conf file to handle streams up to 50M and not using the default value
Started building squidclamav redirector to scan for viruses when using the proxy(builded blackbox may lead to errors), core11 must be installed

config/rootfiles/packages/squidclamav [new file with mode: 0644]
config/squidclamav/squidclamav.conf [new file with mode: 0644]
html/html/clwarn.cgi [new file with mode: 0755]
lfs/squidclamav [new file with mode: 0644]

diff --git a/config/rootfiles/packages/squidclamav b/config/rootfiles/packages/squidclamav
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/config/squidclamav/squidclamav.conf b/config/squidclamav/squidclamav.conf
new file mode 100644 (file)
index 0000000..3d36ea7
--- /dev/null
@@ -0,0 +1,16 @@
+proxy none
+logfile /var/log/squidclamav.log
+redirect http://192.168.255.1:81/clwarn.cgi
+debug 0
+force 1
+stat 0
+clamd_local /var/run/clamav/clamd
+timeout 600
+abort ^.*\.html$
+abort ^.*\.css$
+abort ^.*\.xml$
+abort ^.*\.xsl$
+content ^.*application\/.*$
+whitelist .*ultrastarsongs\.com
+whitelist .*zonealarm\.com
+
diff --git a/html/html/clwarn.cgi b/html/html/clwarn.cgi
new file mode 100755 (executable)
index 0000000..44f7f98
--- /dev/null
@@ -0,0 +1,150 @@
+#!/usr/bin/perl
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+use CGI qw(param);
+
+# enable only the following on debugging purpose
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
+
+$swroot="/var/ipfire";
+&readhash("$swroot/ethernet/settings", \%netsettings);
+
+my $TITLE_VIRUS = "SquidClamAv Virus detection";
+
+my $url = param('url') || '';
+my $virus = param('virus') || '';
+my $source = param('source') || '';
+$source =~ s/\/-//;
+my $user = param('user') || '';
+
+
+# Remove clamd infos
+$virus =~ s/stream: //;
+$virus =~ s/ FOUND//;
+
+print "Pragma: no-cache\n";
+print "Cache-control: no-cache\n";
+print "Connection: close\n";
+print "Content-type: text/html\n\n";
+
+print <<END
+
+<html>
+<head>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>ACCESS MESSAGE</title>
+</head>
+
+<body>
+<table width="100%" height='100%' border="0">
+<tr>
+               <td colspan='3' width='100%' height='130' align="center" background="http://$netsettings{'GREEN_ADDRESS'}:81/images/background.gif">
+<tr>           <td width='10%'><td align='center' bgcolor='#CC000000' width='80%'><font face="verdana, arial, sans serif" color="#FFFFFF" size="5">
+                                       <b>$TITLE_VIRUS</b>
+                                       </font>
+               <td width='10%'>
+END
+;
+
+if (!($virus eq ""))
+{
+       print <<END
+       <tr>            <td colspan='3' align='center'>
+                               <font face="verdana, arial, sans serif" color="#CC000000" size="1">
+                                       <b>$virus found</b>
+                               </font>
+END
+;
+}
+print <<END
+<tr>
+                       <td colspan='3' align="center">
+                               <font face="verdana, arial, sans serif" color="#000000" size="4">
+                               <b>Access to the requested page has been denied</b>
+                               </font>
+                               <font face="verdana,arial,sans serif" color="#000000" size="2">
+END
+;
+
+if (!($url eq ""))
+{
+print <<END
+                                       <p>URL: <a href="$url">$url</a>
+END
+;
+}
+
+if (!($source eq ""))
+{
+print <<END
+                                       <p>Client IP address: <i>$source</i>
+END
+;
+}
+
+print <<END
+                                       <br><p>Please contact the Network Administrator if you think there has been an error
+                                       </font>
+
+<tr>
+       <td colspan='3' height='60%' valign="bottom" align="right">
+               <font face="verdana,arial,sans serif" color="#656565" size="1">Web Filtering by
+               </font>
+               <a href="http://www.ipfire.org" target="_blank"><b>
+               <font face="verdana,arial,sans serif" color="#656565" size="1">IPFire</b></a>
+               </font>
+
+</table>
+</body>
+
+</html>
+END
+;
+
+sub readhash
+{
+       my $filename = $_[0];
+       my $hash = $_[1];
+       my ($var, $val);
+
+       if (-e $filename)
+       {
+               open(FILE, $filename) or die "Unable to read file $filename";
+               while (<FILE>)
+               {
+                       chop;
+                       ($var, $val) = split /=/, $_, 2;
+                       if ($var)
+                       {
+                               $val =~ s/^\'//g;
+                               $val =~ s/\'$//g;
+
+                               # Untaint variables read from hash
+                               $var =~ /([A-Za-z0-9_-]*)/;        $var = $1;
+                               $val =~ /([\w\W]*)/; $val = $1;
+                               $hash->{$var} = $val;
+                       }
+               }
+               close FILE;
+       }
+}
diff --git a/lfs/squidclamav b/lfs/squidclamav
new file mode 100644 (file)
index 0000000..dfd0512
--- /dev/null
@@ -0,0 +1,81 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 3.5
+
+THISAPP    = squidclamav-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = squidclamav
+PAK_VER    = 1
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 955060d2cf87d5fb9ab05f6c8cf83f56
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/squidGuard-$(VER)-20071117.patch
+       cd $(DIR_APP) && ./configure --prefix=/usr
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+       cp -f  $(DIR_SRC)/squidclamav/squidclamav.conf /etc/squidclamav.conf
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)