Salut
Grâce à vous j’ai pu configurer un proxy filtrant le contenu pornographique, mais le problème c’est qu’il est facilement contournable car uniquement configurable dans les navigateurs.
J’aimerais donc créer un proxy transparent qui fasse office de passerelle par défaut dans mon DHCP. Problème je n’ai aucune idée de comment faire ça.
J’explique un peu mon infra.
1 Serveur physique sous VMware esxi
4 interfaces réseau.
Pour l’instant, j’ai créé un switch virtuel vSwitch0 sur lequel sont connectées l’ensemble de mes VMs (Serveurs AD, fichiers…) ainsi que mon serveur Proxy (SRVPROXY). Seule l’interface vmnic0 est affectée à ce switch. Cette interface est reliée physiquement à mon réseau et donc à ma passerelle Internet SDSL (192.168.10.0/24).
J’ai créé un second switch que j’ai appelé VMWan. J’ai affecté à ce switch l’interface vmnic3 reliée physiquement à une Livebox pro ADSL (192.168.200.0/24).
J’aimerais forcer le flux Internet à passer dans mon Proxy et ensuite à passer par la Livebox ADSL, en laissant l’accès SDSL réservé aux flux RDP, fichiers…
Mon serveur Proxy a donc deux cartes réseau Eth0 relié sur vSwitch0 (192.168.10.1) et Eth1 relié sur VMWan (192.168.200.10).
Je bloc ici.
Avant de faire ça grandeur nature et de déployer à tous les users, je fais le test sur une machine à laquelle j’ai attribué la passerelle par défaut 192.168.10.1 de manière à la faire passer par le Proxy. Elle n’a pas accès à Internet, par contre les requêtes arrivent au proxy.
Voici mes différents fichiers de conf
squid.conf
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 192.168.10.0/24 # RFC1918 possible internal network
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl Safe_ports port 25 # SMTP
acl Safe_ports port 587 # SSMTP
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow localnet
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 3128
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
hosts_file /etc/hosts
coredump_dir /var/spool/squid
cache_dir ufs /var/spool/squid 1024 256 256
cache_mem 128 MB
maximum_object_size 15 MB
delay_parameters 1 -1/-1 -1/-1
redirect_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf
redirect_children 10
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
httpd_accel_single_host off
squidGuard.conf
[code]dbhome /var/lib/squidguard/db
logdir /var/log/squidguard
src users {
ip 192.168.10.0/24
}
dest porn {
domainlist porn/domains
urllist porn/urls
}
dest social_networks {
domainlist social_networks/domains
urllist social_networks/urls
}
dest adult {
domainlist adult/domains
urllist adult/urls
}
dest dating {
domainlist dating/domains
urllist dating/urls
}
dest warez {
domainlist warez/domains
urllist warez/urls
}
dest ads {
domainlist ads/domains
urllist ads/urls
expressionlist ads/expressions
}
acl {
users {
pass !in-addr !ads !warez !dating !adult !social_networks !porn any
redirect http://localhost/index.html
}
else {
pass none
redirect http://localhost/index.html
}
default {
pass none
redirect http://localhost/index.html
}
}
[/code]
iptables
[code]# Generated by iptables-save v1.4.14 on Fri Nov 16 15:17:04 2012
*nat
:PREROUTING ACCEPT [385:36983]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.200.10:3128
-A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
:INPUT ACCEPT [346:35027]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
Completed on Fri Nov 16 15:17:04 2012
Generated by iptables-save v1.4.14 on Fri Nov 16 15:17:04 2012
*mangle
:PREROUTING ACCEPT [2964:242771]
:INPUT ACCEPT [2910:240035]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2253:943055]
:POSTROUTING ACCEPT [2253:943055]
COMMIT
Completed on Fri Nov 16 15:17:04 2012
Generated by iptables-save v1.4.14 on Fri Nov 16 15:17:04 2012
*filter
:INPUT ACCEPT [2912:240127]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2254:943347]
COMMIT
Completed on Fri Nov 16 15:17:04 2012[/code]
J’avoue que ça me dépasse un petit peu. ![]()
Merci de votre aide !

