thinomar
(usa Linux Mint)
Enviado em 26/10/2016 - 10:46h
Nossa, acabei esquecendo de fechar o tópico.
Um tempinho depois de abrir o tópico, cansei de bater a cabeça na parede e resolvi mudar tudo. Instalei a o Squid3.4.8, com suporte a SSL, mudei para o modo não transparente, coloquei um certificado nas máquinas, refiz todo o arquivo de configuração do Squid3 e consegui fazer funcionar, barrando tanto HTTP quanto HTTPS.
Enfim, obrigado (atrasado) pelo suporte, pessoal.
Segue a versão final do meu squid.conf (tem muita coisa comentada de testes e funcionalidades que retirei, e algumas erradas, talvez, mas está funcionando):
# Rede local #
acl localnet src 192.168.100.0/24
# ACL Ports #
acl manager url_regex -i ^cache_object:// /squid-internal-mgr/
acl SSL_Ports port 8080
acl SSL_Ports port 443 # HTTPS
acl SSL_Ports port 465 # SSL
acl SSL_ports port 993 # IMAP
acl SSL_ports port 3389 # Terminal Service
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 110 # POP
acl Safe_ports port 143 # IMAP
acl Safe_ports port 280 # HTTP-MGMT
acl Safe_ports port 465 # SSL
acl Safe_ports port 993 # SMTP Seguro
acl Safe_ports port 901 # SWAT
acl Safe_ports port 995 # POP Seguro
acl Safe_ports port 8888 32000 # Outras portas necessarias
# Outras ACLs #
acl CONNECT method CONNECT
acl purge method PURGE
http_access allow purge localhost
http_access deny purge
http_access allow manager localhost
http_access deny manager
# Bloqueia conexoes de portas desconhecidas #
http_access deny !Safe_ports
# Bloqueia conexao de portas que nao estao em SSL_ports #
http_access deny CONNECT !SSL_ports
# Autenticacao (Integracao com Active Directory do Windows Server) #
#auth_param basic program /usr/lib/squid3/basic_ldap_auth -R -b dc=*dominio_win*,dc=domain -f sAMAccountName=%s -h *ip_win_server* -D cn=*usuario_win*,cn=users,dc=*dominio*,dc=domain -w *senha_usuario_win*
#auth_param basic children 5
#auth_param basic realm Digite sua senha
#auth_param basic credentialsttl 6 hours
#auth_param basic casesensitive off
#external_acl_type ldap_group %LOGIN /usr/lib/squid3/ext_ldap_group_acl -R -b "dc=*dominio*,dc=domain" -D cn=*usuario_win*,cn=users,dc=domain,dc=*dominio* -w *senha* -f "(&(objectclass=person)(sAMAccountName=%v)(memberof=cn=%a,ou=groups,dc=*dominio*,dc=local))" -h *ip_win_server*
#auth_param negotiate program /usr/lib/squid3/negotiate_kerberos_auth -d -s HTTP/*dominio*.domain@*DOMINIO*.DOMAIN
#auth_param negotiate children 20
#auth_param negotiate keep_alive on
#acl grupox external X%20Group
#acl grupoc external ext_kerberos_ldap_group_acl Y%20Group
#acl grupoz external ext_kerberos_ldap_group_acl Z%20Group
########################################
#### INICIO REGRAS PERSONALIZADAS ####
########################################
# ACLs sites #
acl bloqueados url_regex -i "/etc/squid3/regras/bloqueados"
#acl liberados url_regex -i "/etc/squid3/regras/liberados"
#acl youtube_allow url_regex -i ^https://www.youtube.com/watch?v=5pOxlazS3zs
# Horarios #
#acl madrugada time 00:00-05:59
#acl manha time 06:00-11:59
#acl tarde time 12:00-17:59
#acl noite time 18:00-23:59
# Bloqueios / Liberacoes #
#http_access allow liberados
#http_access deny youtube_allow
http_access deny bloqueados
# Videos / Musicas #
#acl audio_video rep_mime_type -i "/etc/squid3/regras/audio_video"
#http_reply_access deny audio_video
######################################
#### FIM REGRAS PERSONALIZADAS ####
######################################
# Libera localhost e localnet
http_access allow localhost
http_access allow localnet
# Bloqueia o restante
#http_access deny all
no_cache deny all
# Porta conexoes e certs para SSL #
http_port 3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid3/ssl_cert/CA.pem key=/etc/squid3/ssl_cert/CA.pem
# e2guardian #
#follow_x_forwarded_for allow localhost
#follow_x_forwarded_for deny all
# Cache RAM #
cache_mem 512 MB
# Tamanho max. objs na RAM #
maximum_object_size_in_memory 1024 KB
# Cache dir #
cache_dir ufs /var/spool/squid3/squid1 1024 16 256 read-only
cache_dir ufs /var/spool/squid3/squid2 1024 16 256 read-only
cache_dir ufs /var/spool/squid3/squid3 1024 16 256 read-only
cache_dir ufs /var/spool/squid3/squid4 1024 16 256 read-only
cache_dir ufs /var/spool/squid3/squid5 1024 16 256 read-only
# Politica de memoria #
memory_replacement_policy heap GDSF
# Tamanho max./min. objs na RAM #
minimum_object_size 0 KB
maximum_object_size 4 MB
# % max. e min. de cache para iniciar remocao #
cache_swap_low 90
cache_swap_high 95
# Logs #
cache_access_log /var/log/squid3/access.log
cache_log /var/log/squid3/cache.log
# Logrotate #
logfile_rotate 3
# Tempo valido de cache #
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
# Arquivos 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
# 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 AVG #
refresh_pattern avg.com/.*\.(bin) 10080 100% 43200 reload-into-ims
# Nome #
visible_hostname *Hostname*
# Email para contato em pagina de bloqueio #
cache_mgr *email*
# BUMP SSL #
ssl_bump none localhost
ssl_bump server-first all
ssl_bump none all
always_direct allow all
sslcrtd_program /usr/lib/squid3/ssl_crtd -s /var/lib/ssl_db/ -M 4MB
sslcrtd_children 5
sslproxy_cert_error allow all
sslproxy_flags DONT_VERIFY_PEER
# Squidguard #
#redirect_program /usr/bin/squidGuard
#redirect_program /usr/bin/squidGuard -c /etc/squid3/squidGuard.conf
#redirect_children 8
#redirector_bypass on
# Diretorio com paginas de erro #
error_directory /usr/share/squid3/errors/pt-br/