[Server-devel] (Mostly) Enforcing Google Image Safe Search With Squid

Anna aschoolf at gmail.com
Mon Jun 8 19:17:02 EDT 2009


I just installed the latest XS 0.6d2, and in addition to setting up OpenDNS
in named-xs.conf to do the usual filtering, hunted around to find an easy
way to enforce safe Google image searches, as that seems to be an issue.

Looks like squid can block urls via regular expressions.  I created a file
named /etc/squid/blacklisted_sites.txt consisting of:

http://images.google.com/preferences
http://images.google.com/advanced_image_search
safe=off

and added the following lines to /etc/squid/squid-xs.conf.in at the
beginning of their respective sections.

acl blacklist_sites url_regex "/etc/squid/blacklisted_sites.txt"

http_access deny blacklist_sites

Then, of course,

make -f /etc/xs-config.make squid-xs.conf

And then

/etc/sysconfig/olpc-scripts/TURN_SQUID_ON

So now when I attempt to turn off safe search, squid gives me access
denied.  A *horrible* issue was when I tested what would happen if I "came
to school" with safe search already off in my cookie.  Well, it doesn't
block the first results page as Google doesn't put safe=off in the url
string, but it does block the next page.  Small comfort if you're the
teacher with that kid in your class, though.  Oh, only one page of nasty
thumbnails.  That's not disruptive at all.

It blocks the preferences page link from the image results as well, so
you're stuck with whatever you connected to the XS with, even if that
happens to allow the depraved corners of the internet.  We can't help what
kids do at home, though.

I don't know if safe=off is the best thing to block on, as there might be
some legitimate sites with that string in the URL, but somehow I doubt it.

The non XS specific part of the instructions came from
http://learnlinux.tsf.org.za/courses/build/electives/ch03s03.html

I sure hope someone out there has a better idea.

Anna Schoolfield
Birmingham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/server-devel/attachments/20090608/ce872902/attachment.htm 


More information about the Server-devel mailing list