SquidGuard is a URL redirector used to use blacklists with the proxysoftware Squid. There are two big advantages to squidguard: it is fast and it is free.
DansGuardian
Primary tabs
Installation
Install the necessary PCRE libraries:
yum install pcre-devel
Download the latest version of DansGuardian:
cd /extra/src
wget http://usmirror.dansguardian.org/downloads/2/Stable/dansguardian-2.10.1.1.tar.gz
tar zxf dansguardian-2.10.1.1.tar.gz
cd dansguardian-2.10.1.1
Configure it:
./configure
make
make install
Change the ownership on the log file directory:
chown nobody:nobody /usr/local/var/log/dansguardian
To test it out, you can run it directly from the shell:
dansguardian
Redirect your web traffic to port 8080 of the Squid/Dansguardian machine and watch /usr/local/var/log/dansguardian/access.log
for activity.
Blacklists
cd /usr/local/etc/dansguardian/lists/blacklists
Blacklist files can be downloaded from a variety of sources:
- Malware Patrol
- URLBlacklist.com
- Shalla's Blacklists
cd /extra/src
wget http://www.shallalist.de/Downloads/shallalist.tar.gz
tar zxf shallalist.tar.gz
cd BLCopy which blacklists you want from
/extra/src/BL
to/usr/local/etc/dansguardian/lists/blacklists
Edit /usr/local/etc/dansguardian/lists/bannedurllist
and /usr/local/etc/dansguardian/lists/bannedsitelist
to add the lists you want used. There are examples in those files.
Restart DansGuardian:
dansguardian -g
Automatic startup
We're going to use daemontools. If you haven't already, install daemontools.
Create a directory for the Dansguardian service:
mkdir -m 1755 /var/service/dansguardian
cd /var/service/dansguardian
Create the /var/service/dansguardian/run
script, making sure to change the servername:
#!/bin/sh
exec /usr/local/sbin/dansguardian -N 2>&1
Make the script executable:
chmod 755 run
Our log script comes from John Simpson's:
mkdir -m 755 log
cd log
wget http://qmail.jms1.net/scripts/service-any-log-run
mv service-any-log-run run
chmod 755 run
Finally, add the service to daemontools by creating the symbolic link in /service
ln -s /var/service/dansguardian /service/dansguardian
Confirm that the service is running:
svstat /service/dansguardian /service/dansguardian/log
Logging
MySAR & Squid, edit /usr/local/etc/dansguardian/dansguardian.conf
and change:
forwardedfor = on
Edit /usr/loca/squid/etc/squid.conf
and add:
forwarded_for on
- Log in to post comments