Enviado em 07/02/2014 - 10:22h
Salve galera,
################################################# AUTENCIACAO ######################################################
auth_param basic program /usr/lib/squid/basic_ldap_auth -R -b "dc=teste,dc=local" -D squid@teste.local -W /etc/squid/ldappass.txt -f sAMAccountName=%s -h 192.168.200.200
auth_param basic children 10
auth_param basic realm DIGITE SEU LOGIN E SENHA:
auth_param basic credentialsttl 2 hours
####################################################################################################################
external_acl_type ldap_group ttl=600 children-max=35 ipv4 %LOGIN /usr/lib/squid/ext_ldap_group_acl -R -b "dc=teste,dc=local" -D squid@teste.local -W /etc/squid/ldappass.txt -f "(&(objectclass=person)(sAMAccountName=%v)(memberof=cn=%a,ou=Grupos,ou=INTERNET,ou=ESCRITORIO,ou=BH,ou=EMPRESA,dc=teste,dc=local))" -h 192.168.200.200
acl localnet src 192.168.200.0/24
acl to_localnet dst 192.168.200.0/24
acl SSL_ports port 443
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
### WINDOWS UPDATE
acl windowsupdate dstdom_regex -n -i "/etc/squid/winupdate.acl"
#################### ACL's AQUI ############################
acl CONNECT method CONNECT
range_offset_limit 500 MB windowsupdate
http_access allow windowsupdate
acl auth proxy_auth REQUIRED
acl one_ip_access max_user_ip -s 2
acl bancos dstdom_regex -n -i "/etc/squid/bancos.acl"
acl almoco time MTWHFAS 12:00-14:00
acl redes_sociais dstdom_regex -n -i "/etc/squid/redes_sociais.acl"
acl g_acesso_total external ldap_group GG_ACESSO_TOTAL
acl g_acesso_padrao external ldap_group GG_ACESSO_PADRAO
acl g_acesso_restrito external ldap_group GG_ACESSO_RESTRITO
acl g_redes_sociais external ldap_group GG_REDES_SOCIAIS
###########################################################
always_direct allow bancos
cache deny bancos
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localnet to_localnet
http_access allow localhost
###################### REGRAS AQUI ########################
http_access allow g_acesso_total
http_access allow almoco redes_sociais
http_access allow g_redes_sociais
http_access deny redes_sociais
http_access allow g_acesso_padrao
###########################################################
http_access deny !auth
http_access deny one_ip_access
http_access allow auth
http_access deny all
#icp_access allow localnet
#icp_access deny all
###########################################################
dns_nameserver 208.67.222.222 208.67.220.220
cache_mem 1024 MB
maximum_object_size_in_memory 512 KB
maximum_object_size 500 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_mgr contato@jwit.com.br
cachemgr_passwd none
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
cache_dir aufs /cache/squid/1 2048 16 256
cache_dir aufs /cache/squid/2 2048 16 256
cache_dir aufs /cache/squid/3 2048 16 256
memory_pools off
quick_abort_min 0 KB
quick_abort_max 0 KB
log_icp_queries off
client_db off
buffered_logs on
half_closed_clients off
forward_timeout 15 seconds
connect_timeout 15 seconds
peer_connect_timeout 10 seconds
visible_hostname Proxy
access_log stdio:/var/log/squid/access.log
cache_access_log stdio:/var/log/squid/cache_access.log
coredump_dir /cache/squid
cache_store_log none
logfile_rotate 10
forwarded_for off
error_directory /usr/share/squid/errors/pt-br
http_port 3128
## CACHE WINDOWS UPDATE ##
refresh_pattern -i microsoft.com/.*\.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
refresh_pattern -i windowsupdate.com/.*\.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
refresh_pattern -i windows.com/.*\.(cab|exe|ms[i|u|f]|asf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
refresh_pattern download.microsoft.com/.*\.(cab|exe|dll|msi|psf) 10080 100% 43200 reload-into-ims
refresh_pattern http://www.download.microsoft.com/.*\.(cab|exe|dll|msi|psf) 10080 100% 43200 reload-into-ims
refresh_pattern http://www.microsoft.com/.*\.(cab|exe|dll|msi|psf) 10080 100% 43200 reload-into-ims
refresh_pattern au.download.windowsupdate.com/.*\.(cab|exe|dll|msi|psf) 4320 100% 43200 reload-into-ims
refresh_pattern download.windowsupdate.com/.*\.(cab|exe|dll|msi|psf) 4320 100% 43200 reload-into-ims
refresh_pattern cache.pack.google.com/.*\.(cab|exe|dll|msi|psf) 4320 100% 43200 reload-into-ims
refresh_pattern http://www.update.microsoft.com/.*\.(cab|exe|dll|msi|psf) 10080 100% 43200 reload-into-ims
refresh_pattern wwww.download.windowsupdate.com/.*\.(cab|exe|dll|msi|psf) 10080 100% 43200 reload-into-ims
## CACHE SKYPE ##
refresh_pattern download.skype.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
## CACHE CHROME ##
refresh_pattern cache.pack.google.com/.*\.(cab|exe|dll|msi|dmg) 10080 100% 43200 reload-into-ims
## CACHE MIDIA ##
refresh_pattern -i \.(mp3|mp4|m4a|ogg|mov|avi|wmv|flv)$ 10080 90% 999999 ignore-no-cache override-expire ignore-private
hierarchy_stoplist cgi-bin ?
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320