Edubuntu Filter Server
Gerald Drouillard
gerrylist at drouillard.ca
Thu Jun 26 02:03:01 BST 2008
Dorminy, Bill wrote:
> Hello all,
>
> I am using Edubuntu with Dansguardian, Tinyproxy, and Firehol as a temporary URL filtering server. I have set Internet Explorer to use the server Ip and port 8080 as a proxy which is working great, however I am having trouble blocking secure proxy (https://) sites. Can anyone tell me how to filter https sites with Dansguardian?
>
> Thanks,
>
> Bill
>
> DCSS
Try using opendns.org with a combination of this script to run every
hour or so:
#!/bin/sh
valid_dotted_quad()
{
ERROR=0
oldIFS=$IFS
IFS=.
set -f
set -- $1
if [ $# -eq 4 ]
then
for seg
do
case $seg in
""|*[!0-9]*) ERROR=1;break ;;
*) [ $seg -gt 255 ] && ERROR=2 ;;
esac
done
else
ERROR=3
fi
IFS=$oldIFS
set +f
return $ERROR
}
YESTERDAY=`date --date='1 days ago'`
D=`date --date="$YESTERDAY" +%-d`
M=`date --date="$YESTERDAY" +%-m`
Y=`date --date="$YESTERDAY" +%-Y`
TESTLOG=/tmp/proxy_test.txt
BLOCK_DOMAIN=/tmp/proxy_block_domain.log
BLOCK_IP=/tmp/proxy_block_ip.log
HOST=/etc/hosts
RULES=/etc/dansguardian/bannedsitelist
BLOCK_PRE=""
#rm $BLOCK_DOMAIN
#touch $BLOCK_DOMAIN
#echo
#echo "*** DansGuardian DENIED Report ***"
#cat /var/log/dansguardian/access.log |grep -w "$Y.$M.$D" |grep "DENIED"
cat /var/log/dansguardian/access.log |grep
'/loader-counter.js?hostname='|awk {'print $5'}|cut -c 8-|sort -u|cut
-d/ -f 1 >$TESTLOG
changed=0
for DOMAIN in `cat $TESTLOG`; do
if ! grep -q "$DOMAIN" "$RULES"; then
echo
echo $DOMAIN
if valid_dotted_quad "$DOMAIN"; then
BLOCK_PRE="*"
else
BLOCK_PRE=""
fi
echo "$BLOCK_PRE""$DOMAIN" >> $RULES
changed=1
fi
done
if [ $changed = 1 ]; then
/etc/init.d/dansguardian restart
fi
--
Regards
--------------------------------------
Gerald Drouillard
Technology Architect
Drouillard & Associates, Inc.
http://www.Drouillard.biz
More information about the edubuntu-users
mailing list