2014-10-27 - Re: [GRASE-Hotspot] Can you use squidguard with Grase Hotspot?

Header Data

From: Thomas Heil <he***l@terminal-consulting.de>
Message Hash: 345e29136f742970fd0a7bc0c14cf631924f95f2619136595a78a0e67cdb783d
Message ID: <544E1E6C.7060602@terminal-consulting.de>
Reply To: <228ed189-7452-4aa6-a05a-666730cfc4c8@grasehotspot.org>
UTC Datetime: 2014-10-27 03:29:00 UTC
Raw Date: Mon, 27 Oct 2014 11:29:00 +0100

Raw message

Hi,
On 27.10.2014 04:10, Derek Mitchell wrote:
> Hi, Is it possible to use squidguard with Grase Hotspot?
>
Yey it is. Here is an example for the stable grase hotspot one. Have a
look on it.
--
DEBCONF_FRONTEND=noninteractive apt-get install squidguard -y --force-yes

cat > /etc/squid3/grase.d/sguard.conf <<'ENDOFMESSAGE'
url_rewrite_program /usr/bin/squidGuard -c /etc/squidguard/squidGuard.conf
url_rewrite_children 2
ENDOFMESSAGE

cat > /etc/squidguard/squidGuard.conf <<'ENDOFMESSAGE'
#
# CONFIG FILE FOR SQUIDGUARD
#

dbhome /var/lib/squidguard/db/blacklists
logdir /var/log/squidguard

#
# TIME RULES:
# abbrev for weekdays:
# s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat

time workhours {
        weekly mtwhf 08:00 - 16:30
        date *-*-01  08:00 - 16:30
}

#
# REWRITE RULES:
#

#rew dmz {
#       s@://admin/@://admin.foo.bar.no/@i
#       s@://foo.bar.no/@://www.foo.bar.no/@i
#}

#
# SOURCE ADDRESSES:
#

#src admin {
#       ip              1.2.3.4 1.2.3.5
#       user            root foo bar
#       within          workhours
#}

#src foo-clients {
#       ip              172.16.2.32-172.16.2.100 172.16.2.100 172.16.2.200
#}

#src bar-clients {
#       ip              172.16.4.0/26
#}

#
# DESTINATION CLASSES:
#

dest good {
}

dest local {
}

dest ads {
        domainlist      ads/domains
        urllist         ads/urls
}

dest aggressive {
        domainlist      aggressive/domains
        urllist         aggressive/urls
}

dest audio-video {
        domainlist      audio-video/domains
        urllist         audio-video/urls
}
dest drugs {
        domainlist      drugs/domains
        urllist         drugs/urls
}

dest gambling {
        domainlist      gambling/domains
        urllist         gambling/urls
}


dest hacking {
        domainlist      hacking/domains
        urllist         hacking/urls
}

dest mail {
        domainlist      mail/domains
}

dest porn {
        domainlist      porn/domains
        urllist         porn/urls
}

dest proxy {
        domainlist      proxy/domains
        urllist         proxy/urls
}

dest redirector {
        domainlist      redirector/domains
        urllist         redirector/urls
}

dest spyware {
        domainlist      spyware/domains
        urllist         spyware/urls
}

dest suspect {
        domainlist      suspect/domains
        urllist         suspect/urls
}


dest violence {
        domainlist      violence/domains
        urllist         violence/urls
}

dest warez{
        domainlist      warez/domains
        urllist         warez/urls
}


acl {
#       admin {
#               pass     any
#       }

#       foo-clients within workhours {
#               pass     good !in-addr !adult any
#       } else {
#               pass any
#       }

#       bar-clients {
#               pass    local none
#       }

        default {
                pass !ads !aggressive !audio-video !drugs !gambling
!hacking !mail !porn !proxy !redirector !spyware !suspect !violence
!warez all
#               rewrite  dmz
                redirect        http://10.1.0.1/block.html

        }
}
ENDOFMESSAGE


wget http://squidguard.mesd.k12.or.us/blacklists.tgz -O - | tar  -C
/var/lib/squidguard/db/  -zxvf -

chown proxy:proxy /var/lib/squidguard

/etc/init.d/squid3 restart

cat > /var/www/block.html <<'ENDOFMESSAGE'
<html>

<head>
<meta http-equiv="Expires" content="0"><meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Website gesperrt</title>
</head>

<body bgcolor=#000000 text=#FFFFFF>

<p><br><br><br></p>

<table border=0 width=100% bgcolor=#FF0000 height=1>
<tr><td>&nbsp;</td></tr>
</table>

<p><br></p>

<p align=center>
<!-- this is localised for german, you may want to localise it for your
own language -->
<font size=5>Website durch Hotspot-Filter gesperrt</font>
</p>

<p><br></p>

<table border=0 width=100% bgcolor=#FF0000 height=1>
<tr><td>&nbsp;</td></tr>
</table>

<p align=right><a href=http://www.skolelinux.de
style="text-decoration:none; font-stretch:wider">
<font style="font-weight:900; font-size:125%" face="Arial, Helvetica,
Geneva, Swiss,
SunSans-Regular, sans-serif" color=#FFFFFF size="4">hotspot.lan</a>
</p>

</body>
ENDOFMESSAGE

cheers
thomas
--
> Regards,
> Derek
> -- 
> This mailing list is for the Grase Hotspot Project http://grasehotspot.org
> ---
> You received this message because you are subscribed to the Google
> Groups "Grase Hotspot" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gr***e@grasehotspot.org
> <mailto:gr***e@grasehotspot.org>.
> To post to this group, send email to gr***t@grasehotspot.org
> <mailto:gr***t@grasehotspot.org>.
> Visit this group at
> http://groups.google.com/a/grasehotspot.org/group/grase-hotspot/.
> To view this discussion on the web visit
> https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/228ed189-7452-4aa6-a05a-666730cfc4c8%40grasehotspot.org
> <https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/228ed189-7452-4aa6-a05a-666730cfc4c8%40grasehotspot.org?utm_medium=email&utm_source=footer>.



Thread