[Lias] Re: [acscomputers] Google rewrites?

John Summerfield summer at corridors.wa.edu.au
Wed Aug 24 11:46:02 UTC 2005


Paul Gear wrote:
> John Summerfield wrote:
> 
>>...
>>I'm looking at it because we're looking at content filtering here (and
>>I'm probably causing mayhem in the classroom, having blocked
>>mousebreaker & other games sites, teenchat and assorted other chat sites
>>etc.
> 
> 
> Oh, the power!  :-)
> 
> 
>>It looks to me that a basic Perl script akin to that given in FAQ15 (or
>>even sed) will do the job. Either can be piped into squidGuard to allow
>>it to do its thing.
>>...
>>Comments?
> 
> 
> Seems like a bit of a waste when it's what squidGuard is supposed to do
> well...  :-)
> 
> What about a redirect instead?  Could we just put
> 	redirect %u&safe=strict
> in a section that bans all google traffic with a match like
> 	(google.*\?)
> ?
> 

In squid.conf:
# acl aclname url_regex [-i] ^http:// ... # regex matching on whole URL
acl goodgoogle url_regex [-i] \ 
^http://[^/]*google.com(|\.[a-z]{2}/safe=strict
acl google url_regex [-i] \ ^http://[^/]*google.com(|\.[a-z]{2}

Note that the above regex isn't exactly right, it needs to only apply to 
searches.

then explicitly allow goodgoogle and deny google

I don't like site-specific Squid rules, but I guess a small number (my 
definition) is tolerable.

Note the regexes can be read from a file: that would relieve the burden 
a little.

I expect this is quicker than squidGuard too:-)

btw I've just implemented this at home so I can see what goes on:
redirect_program /usr/local/bin/redirector

#!/bin/bash
L=$(mktemp /var/log/squid/squidrequests.XXXXXX)
tee $L

The example I saw only works properly if you limit to one copy.

I think a simple sed with fix Elg Reg stories so I can always get them 
in printable format:-)

Note:
I ran this on WBEL 4 which has selinux enforcing nice behaviour. I could 
not create the files in /tmp which, I suppose, is good.



> --
> Paul Gear, Manager IT Operations, Redlands College
> 38 Anson Road, Wellington Point 4160, Australia
> (Please send attachments in portable formats such as PDF, HTML, or
> OpenOffice.)
> --
> If you've got skills or information that could be helpful to others,
> please consider contributing to the schools IT support wiki at
> http://schools.wikispaces.org
> --
> The information contained in this message is copyright by Redlands
> College.  Any use for direct sales or marketing purposes is expressly
> forbidden.  This message does not represent the views of Redlands
> College.


-- 

Cheers
John
Corridors College Western Australia




More information about the lias mailing list