LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Dansguardian & Squid (https://www.linuxquestions.org/questions/linux-security-4/dansguardian-and-squid-480571/)

yunus.raza 09-05-2006 07:45 AM

Dansguardian & Squid
 
Hi All,

I have configured Dansguardian for Squid in Red Hat 9. Its working well. It is configured for port 3128 and Squid is configured for port 2831.

I have one question with the way Dansguardian forwards requests to Squid, since it sits between client and squid server, it sends the IP of the server itself to squid.

In other words if i access the log file of squid in realtime i can see that it appears to squid that the source ip is the ip of the squid server itself, and i cant makeout as to which client is accessing in my SARG report generation tool.

Is there a way to tell Dansguardian to forward the real IP of the client to squid rather than the IP of the server itself. I didnt see any such option in the dansguardian.conf file (or may be i missed it)

Please guide.

Thanks

acid_kewpie 09-05-2006 10:26 AM

you'd enable the x-forwarded-for header. google has plenty to say about this including its use in dans.

backhand 09-05-2006 09:04 PM

to know the client source ip, just look in the dansguardian log.. in /var/log/dansguardian/access.log but for squid to get the client source ip you need to enable the x-forward-for header. ;)

acid_kewpie 09-06-2006 04:15 AM

Quote:

Originally Posted by backhand
to know the client source ip, just look in the dansguardian log.. in /var/log/dansguardian/access.log but for squid to get the client source ip you need to enable the x-forward-for header. ;)

i've already said that... :confused:

yunus.raza 09-06-2006 06:37 AM

I did that still if i see access.log of squid it says source ip as localhost.localdomain.

Anything i am missing??

acid_kewpie 09-06-2006 07:24 AM

the squid side still needs to be told to read the header. check the configs for the squid side... http://devel.squid-cache.org/follow_xff/index.html you can see the last line of the config example there is specifically relevant to the log files as opposed to the primary use of the header to follow acl's etc...

backhand 09-06-2006 10:11 PM

Quote:

Originally Posted by yunus.raza
I did that still if i see access.log of squid it says source ip as localhost.localdomain.

Anything i am missing??

how about your entry in dansguardian access.log
try to check inside /var/log/dansguardian/access.log
is it say source ip as localhost.localdomain?

ssamir81@hotmail.com 08-04-2010 03:11 AM

ssamir
 
AOA

In order to work Squid ACL and dansguardian both at a time you have to do two things.

1. In dansguardian.conf set the 2 tags like this.

forwardedfor = on
usexforwardedfor = on

2. Now in squid.conf you have to use x-forwarded option. Set the tags like this. By default these tags are commented. Search these tags and Remove the '#' and set like this:

follow_x_forwarded_for deny all
acl_uses_indirect_client on
delay_pool_uses_indirect_client on
log_uses_indirect_client on

And finally in writing ACL see the example below

acl my_network src 192.168.41.60
follow_x_forwarded_for allow my_network
http_access deny all

where 192.168.41.60 is the ip of my squid server and dansguardian in on the same machine.

win32sux 08-04-2010 03:19 AM

ssamir81@hotmail.com, please don't resurrect dead threads – help us keep LQSEC as zombie-free as possible. In addition, be advised that posting the same thing multiple times isn't proper behavior.


All times are GMT -5. The time now is 07:24 AM.