Leroba,
Vou lhe falar como o meu squid está configurado, talves lhe sirva.
Proxy com autenticação de Usuários,
Bloqueio de downloads,
Restricão de acesso por horários
No meu squid existem dois tipos de usuários, os livres e os bloqueados. Os livres têm acesso total (menos o que está na minha blacklist, ex: sacanagens, orkut, etc), e os bloqueados têm acesso restrito (só na whitelist, ex: bancos, sites.gov.br, etc).
Coloquei uma regra de horários, onde os usuários bloqueados podem ter direitos de usuários livres em alguns horários estipulados, no meu caso, quando eles chegam no trabalho (ate as 08:00), no almoço (11:00 a 12:30) e depois das 17:00. Fora desses horários só o que está na whitelist.
Abs,
Leo
[email protected] - MSN
Segue squid.conf:
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 8 MB
cache_dir ufs /var/spool/squid 300 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
pid_filename /var/run/squid.pid
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/usuarios
auth_param basic children 5
auth_param basic realm Empresa X CONTROLE DE ACESSO
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 1863
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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 10000
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl REDE_LOCAL src 192.168.0.0/255.255.255.0
acl PASSWORD proxy_auth REQUIRED
acl USUARIOS_LIVRES proxy_auth "/etc/squid/usuarios_livres"
acl USUARIOS_BLOCKED proxy_auth "/etc/squid/usuarios_blocked"
acl BLACKLIST url_regex -i "/etc/squid/blacklist"
acl WHITELIST url_regex -i "/etc/squid/whitelist"
acl DENY_DOWNLOADS urlpath_regex \.exe$ \.mp3$ \.bat$ \.pps$ \.ppt$ \.doc$ \.xls$ \.mpeg$ \.wmv$ \.avi$ \.pif$
acl hl01 time MTWHF 00:00-08:05
acl hl02 time MTWHF 11:00-12:30
acl hl03 time MTWHF 16:55-23:59
acl hl04 time MTWHF 12:00-12:10
http_access deny BLACKLIST
http_access deny DENY_DOWNLOADS
http_access allow USUARIOS_BLOCKED hl01
http_access allow USUARIOS_BLOCKED hl02
http_access allow USUARIOS_BLOCKED hl03
http_access allow USUARIOS_LIVRES
http_access allow WHITELIST
http_access allow localhost
http_reply_access allow all
http_access deny all
icp_access allow all
visible_hostname EmpresaX
logfile_rotate 10
icon_directory /usr/share/squid/icons
error_directory /etc/squid/errors
coredump_dir /var/spool/squid