Solved

Using Squid and Squid-Guard

Posted on 2004-08-09
4
1,390 Views
Last Modified: 2007-12-19
I am preparing to upgrade our Linux firewall/cache.

I have decided to continue to use the most excellent Squid for caching.
I have also decided to try and use squidGuard as the standard redirector,
since it seems well supported.

Now for the problem.  I have the need to modify the rules in squidGuard to act
differently when the requests are coming in from a different source
port.

For example, if requests are coming from 3128 I want to
filter porn, adult, ads, and limit to approved sites only.
If requests are coming from 3129 I want to filter porn,
adult, ads, and allow everything else.

After hours of looking at config files, FAQ's, and docs, I give up.  I
don't think it is possible.  Ideally, I would want to run one squid
and two squidguards.  The squid would call the appropriate squidauard
depending on the source request port.

Does anyone know if that is possible?
0
Comment
Question by:jballread
  • 2
4 Comments
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 250 total points
ID: 11757817
Unfortunately, I agree that the way that you want it to work with 1 squid and 2 squidguards is not trivial. I can't envisage how to get that concept to work at all! However, 2 squids and 2 squidguards is. You merely need to recompile your second squid to use a different config file, and rename it to be squid2....The /etc/init.d/squid would also need to be duplicated for the second squid.

HTH:)
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 11757825
Just a thought, I think that you will probably be unable to use the same cache for the 2 squids, as there could be some intermittent problems if both try to access the same cache at the same time. This would impact slightly on performance.
0
 
LVL 1

Accepted Solution

by:
bluelip earned 250 total points
ID: 11772852
squidguard is only able to designate rules based on ip address not what port the request comes into squid on.

The first condition looks like you want to function like a whitelist whereas the second would be a blacjlist.

This can be accomplished by segregating the network in subnets nets and by doing the whitelist processing with ACL's in squid.conf while doing the blacklists with squidguard.conf

Whitelisting is gone over in the squid docs.

To do the blacklisting, look at example 3 in the squidguard config examples.



Example 3 - Blocking the access for unknown or unprivileged clients:

     logdir /usr/local/squidGuard/log
     dbhome /usr/local/squidGuard/db

     src privileged {
       ip      10.0.0.1 10.0.0.73 10.0.0.233      # ONE OF single clients
       ip      10.0.0.10-10.0.0.20            # OR WITHIN range 10.0.0.10 - 10.0.0.20
       ip      10.0.1.32/27                  # OR WITHIN range 10.0.1.32 - 10.0.1.63
       ip      10.0.2.0/255.255.255.0            # OR WITHIN range 10.0.2.0  - 10.0.2.255
                                    # AND
       domain foo.bar                        # MATCH foo.bar. OR *.foo.bar.
     }

     acl {
       privileged {
           pass all
       }

       default {
           pass none
           redirect http://info.foo.bar/cgi/blocked?clientaddr=%a&clientname=%n&clientuser=%i&clientgroup=%s&url=%u
       }
     }
   




If you provide more details, these instructions can be customized to your situation.


bluelip
0
 

Author Comment

by:jballread
ID: 11898534
Thank you for your help!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
website file permissions 4 71
open port 993, 995, 110, 143  for mail server 20 2,402
IPA - change main server? 3 134
reset ubuntu password for root and admin after clearing it. 7 44
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question