Enviado em 21/09/2015 - 10:40h
Bom dia,# -> PORTA QUE O SQUID IRÁ ESPERAR POR CONEXÕES
http_port 3128 transparent
# -> NOME DO SERVIÇO
visible_hostname Firewall
# -> ROTACIONAMENTO DE LOGS
logfile_rotate 3
# -> CONFIGURAÇÕES DE CACHE DE MEMÓRIA RAM
cache_mem 698 MB
# -> TAMANHO MÁXIMO DOS OBJETOS NA RAM E TAMANHO MÍNIMO E MÁXIMO DOS OBJETOS NO CACHE
maximum_object_size_in_memory 1024 KB
maximum_object_size 524288 KB
minimum_object_size 0 KB
# -> INDICAÇÃO DE PERCENTAGEM MÍNIMA E MÁXIMA DO TAMANHO DO CACHE ONDE O SQUID COMEÇARÁ A APAGAR ARQUIVOS
cache_swap_low 90
cache_swap_high 95
# -> LISTA DE NOMES DE SERVIDORES QUE IRÃO RECEBER CONSULTAS DNS
dns_nameservers 10.1.1.1 200.225.197.34 200.225.197.37
# -> EMAIL DE ENVIO NO CASO DE PROBLEMAS NO SQUID
cache_mgr jonathan.ribeiro@duofertil.com.br
# -> CONFIGURACOES DE DIRETÓRIOS E LOGS
cache_log /var/log/squid3/cache.log
cache_access_log /var/log/squid3/access.log
# -> DIRETORIOS CACHE, UTILIZANDO 1024 UFS
cache_dir ufs /var/spool/squid3/squid1 1024 16 256
cache_dir ufs /var/spool/squid3/squid2 1024 16 256
cache_dir ufs /var/spool/squid3/squid3 1024 16 256
cache_dir ufs /var/spool/squid3/squid4 1024 16 256
cache_dir ufs /var/spool/squid3/squid5 1024 16 256
# -> POLÍTICA DE TROCA DE MEMÓRIA E CACHE
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
# -> DEFINIÇÃO DE QUANTO TEMPO OS OBJETOS DO CACHE SERÃO CONSIDERADOS VÁLIDOS
refresh_pattern ^ftp:// 1440 20% 10080
refresh_pattern ^gopher:// 1440 0% 1440
refresh_pattern -i (c/cgi-bin/|\?) 0 0 4320
refresh_pattern . 30 40% 4320
# -> DEFINIÇÃO DE ARQUIVOS DO CACHE
refresh_pattern -i \.tgz$ 0 100% 25200
refresh_pattern -i \.exe$ 0 100% 25200
refresh_pattern -i \.zip$ 0 100% 25200
refresh_pattern -i \.rar$ 0 100% 25200
refresh_pattern -i \.flv$ 0 100% 25200
refresh_pattern -i \.cab$ 0 100% 25200
refresh_pattern -i \.swf$ 0 100% 25200
refresh_pattern -i \.jpg$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.gif$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.png$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.jpeg$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.bmp$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.tif$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.tiff$ 0 50% 1440 reload-into-ims
refresh_pattern -i \.doc$ 0 50% 5 reload-into-ims
refresh_pattern -i \.txt$ 0 50% 5 reload-into-ims
refresh_pattern -i \.pdf$ 0 50% 5 reload-into-ims
refresh_pattern -i \.php$ 0 20% 5 reload-into-ims
refresh_pattern -i \.html$ 0 20% 5 reload-into-ims
refresh_pattern -i \.htm$ 0 20% 5 reload-into-ims
refresh_pattern -i \.shtml$ 0 20% 5 reload-into-ims
refresh_pattern -i \.shtm$ 0 20% 5 reload-into-ims
#refresh_pattern -i exe$ 30 100% 20160
#refresh_pattern -i zip$ 30 100% 20160
#refresh_pattern -i flv$ 30 100% 20160 ignore-reload override-lastmod override-expire reload-into-ims
#refresh_pattern -i swf$ 30 100% 20160 ignore-reload override-lastmod override-expire reload-into-ims
#refresh_pattern -i cab$ 30 100% 20160 ignore-reload override-lastmod override-expire reload-into-ims
#refresh_pattern -i rar$ 30 100% 20160 ignore-reload override-lastmod override-expire reload-into-ims
# -> PÁGINAS DE ERROS EM PORTUGUES
error_directory /usr/share/squid3/errors/Portuguese
# -> CACHE WINDOWS UPDATE
refresh_pattern windowsupdate.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern download.microsoft.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern www.download.microsoft.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern www.microsoft.com/.*\.(cab|exe|dll|msi) 10080 100% 43200 reload-into-ims
refresh_pattern au.download.windowsupdate.com/.*\.(cab|exe|dll|msi) 4320 100% 43200 reload-into-ims
refresh_pattern download.windowsupdate.com/.*\.(cab|exe|dll|msi) 4320 100% 43200 reload-into-ims
refresh_pattern www.download.windowsupdate.com/.*\.(cab|exe|dll|msi) 4320 100% 43200 reload-into-ims
# -> CACHE AVAST
refresh_pattern avast.com/.*\.(vpu|cab|stamp|exe) 10080 100% 43200 reload-into-ims
# -> CACHE AVG
refresh_pattern avg.com/.*\.(bin) 10080 100% 43200 reload-into-ims
# -> CACHE KASPERSKY
refresh_pattern dnl-/.*\.(xml|stt|dll|dat|avc|dif|exe|cab|fad) 10080 100% 43200 reload-into-ims
# -> CACHE SANKHYA
refresh_pattern restrita.sankhya.com.br/.*\.(zip|swf|exe) 20160 100% 43200 reload-into-ims
# -> REGRAS BÁSICAS DE ACESSO AOS PRINCIPAIS PROTOCOLOS E PORTAS, ALÉM DO ACESSO AO LOCALHOST DO SERVER
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl SSL_ports port 443 563 #HTTPS
acl SSL_ports port 143 # IMPA
acl SSL_Ports port 465 # SSL
acl SSL_ports port 993 # IMAP
acl SSL_ports port 1194 # TESTE PHILIPE VPN <<<<<<<<<<<<<<<<<
acl SSL_ports port 1863 # Emesene (Linux)
acl SSL_ports port 2083 # Cpanel
acl SSL_ports port 2096 # Webmail Grupo CBM
acl SSL_ports port 3389 # Terminal Service
acl SSL_ports port 10060 # CAT
acl SSL_ports port 10000 # Webmin
acl SSL_ports port 30550 # Tor
acl Safe_ports port 553 # Autenticacao Outlook
acl Safe_ports port 80 # HTTP
acl Safe_ports port 21 # FTP
acl Safe_ports port 25 587 # SMTP
acl Safe_ports port 443 563 # HTTPS
acl Safe_ports port 50 51 500 4500 # Heringer
acl Safe_ports port 70 # GOPHER
acl Safe_ports port 110 # POP
acl Safe_ports port 143 # IMAP
acl Safe_ports port 210 # WAIS
acl Safe_ports port 280 # HTTP-MGMT
acl Safe_ports port 488 # GSS-HTTP
acl Safe_ports port 465 # SSL
acl Safe_ports port 993 # SMTP Seguro
acl Safe_ports port 591 # FILEMAKER
acl Safe_ports port 777 # MULTILING HTTP
acl Safe_ports port 901 # SWAT
acl Safe_ports port 995 # POP Seguro
acl Safe_ports port 1194 # TESTE PHILIPE VPN <<<<<<<<<<<<<<<<<<
acl Safe_ports port 1494 # SIGOV
acl Safe_ports port 1863 # Emesene (Linux)
acl Safe_ports port 2095 # Webmail DuoFertil
acl Safe_ports port 2082 # CPanel DuoFertil
acl Safe_ports port 2083 # CPanel DuoFertil
acl Safe_ports port 2631 # SEFIP / GRRF / CAGED
acl Safe_ports port 3007 # RAIS
acl Safe_ports port 3050 # DAPI
acl Safe_ports port 3456 # SPED Contabil e Fiscal / DACOM / DCTF / ITR / Mapas PF / IRPF
acl Safe_ports port 3389 # Terminal Service
acl Safe_ports port 5017 # CAT
acl Safe_ports port 5022 # CAT
acl Safe_ports port 8017 # GAM57 / Sintegra / ISS / VAF / DAMEF / DIRF / DIPJ
acl Safe_ports port 10000 # Webmin
acl Safe_ports port 10060 # CAT
acl Safe_ports port 1025-65535 # Portas Altas
# -> EXCLUI OS OBJETOS QUE FORAM ARMAZENADOS NO CACHE DO SQUID
acl purge method PURGE
# -> PERMITE O SQUID FAZER CONEXÃO DIRETA QUEM FAZER PARTE DA REGRA
acl CONNECT method CONNECT
# REQUERIMENTO DE AUTENTICACAO DE USUARIO
#auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/squid_passwd
#auth_param basic realm Digite seu login e senha para acesso:
#auth_param basic children 20
#acl autenticacao proxy_auth REQUIRED
#http_access allow autenticacao
#auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd
#auth_param basic children 20
#auth_param basic realm Digite seu usuario e senha
#auth_param basic credentialsttl 2 hours
#auth_param basic casesensitive off
# ATIVANDO SQUIDGUARD
#redirect_program /usr/bin/squidGuard
#redirect_program /usr/bin/squidGuard -c /etc/squid3/squidGuard.conf
#redirect_children 8
#redirector_bypass on
# -> DECLARACAO DE REDE
acl redelocal src 192.168.0.0/24
# -> SETORES DA EMPRESA
acl diretoria src "/etc/squid3/setores/diretoria"
acl gestores src "/etc/squid3/setores/gestores"
acl ti src "/etc/squid3/setores/ti"
acl servidores src "/etc/squid3/setores/servidores"
acl administrativo src "/etc/squid3/setores/administrativo"
# -> BLOQUEIO DE IPS
acl ipsBloqueados src "/etc/squid3/regras/ipsBloqueados"
# -> REGRAS DE SITES
acl liberados dstdomain -i "/etc/squid3/regras/liberados"
acl bloqueados dstdomain -i "/etc/squid3/regras/bloqueados"
acl downloads dstdomain -i "/etc/squid3/regras/downloads"
acl facebook dstdomain -i "/etc/squid3/regras/facebook"
# -> REGRAS DE EXPRESSÕES REGULARES
acl blacklist url_regex -i "/etc/squid3/regras/blacklist"
# -> PERMITE APENAS ACESSO AO ADMINISTRADOR DO CACHE
http_access allow manager localhost
http_access deny manager
# -> PERMITE REQUISIÇÕES PURGE
http_access allow purge localhost
http_access deny purge
# -> BLOQUEIA REQUISIÇÕES DE PORTAS DESCONHECIDAS
http_access allow !Safe_ports
# -> BLOQUEIA CONEXÕES DE PORTAS QUE NÃO ESTEJAM EM SSL_PORTS
http_access deny CONNECT !SSL_ports
# -> DECLARACÃO DE HORÁRIOS
acl madrugada time 00:00-05:59
acl manha time 06:00-08:00
acl almoco time 11:00-13:00
acl tarde time 16:00-20:00
acl noite time 20:01-23:59
### TESTE SWF ###
#http_reply_access deny mimes_req !manha !almoco !tarde !noite !ti
#http_reply_access deny mimes_rep !manha !almoco !tarde !noite !ti
# -> REGRAS
http_access deny madrugada !administrativo !diretoria !gestores !ti !servidores
http_access deny facebook !manha !almoco !tarde !noite !gestores !diretoria
http_access deny ipsBloqueados !liberados
http_access deny blacklist
http_access deny bloqueados
http_access deny downloads !ti
#http_access allow liberados
http_access allow ti
http_access allow diretoria
http_access allow gestores
http_access allow administrativo
http_access allow servidores
# -> PERMITE QUE APENAS O LOCALHOST E A REDE LOCAL ACESSE O PROXY
http_access allow localhost
http_access allow redelocal
# -> BLOQUEIA TODOS OS OUTROS DE ACESSAR O PROXY
http_access deny all
# -> LIBERA ACESSO A PORTA ICP
icp_access allow all