m4rc3l055
(usa Debian)
Enviado em 27/11/2014 - 15:28h
# Portas (padrao 3128)
#########################################
http_port XXX.XX.0.222:3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid3/ssl_cert/DOMINIO.pem
# Resolve DNS para nomes curtos
append_domain .DOMINIO.com.br
# OTIMIZANDO CONEXOES
#########################################
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \? \& \%
no_cache deny QUERY
cache_mem 1024 MB
cache_dir ufs /cache 1024 16 256
####hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
# Logs
########################################
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
#access_log /var/log/squid3/access.log combined
access_log /var/log/squid3/access.log
cache_log /var/log/squid3/cache.log
# acls de origem/LAN
# =======================================
acl localhost src XXX.XX.0.222/32
# LIBERA TUDO PARA REDES RESERVADAS
# =======================================
acl redes_reservadas_dst dst 172.16.0.0/12
acl redes_reservadas_dst dst 10.0.0.0/8
acl redes_reservadas_dst dst 192.168.0.0/16
acl redes_reservadas_src src 172.16.0.0/12
acl redes_reservadas_src src 10.0.0.0/8
acl redes_reservadas_src src 192.168.0.0/16
# MODO DE FTP PASSIVO
#########################################
ftp_passive on
# CONFIGS Diversas
########################################
# Email do administrador
cache_mgr acesso@DOMINIO.com.br
# Host visivel
visible_hostname proxy.DOMINIO.com.br
# Linguagem dos erros
error_directory /usr/share/squid3/errors/pt-br
# Evita que sejam feitos coredumps.
coredump_dir /var/spool/squid3
# Numero de arquivos de log rotacionados a guardar.
logfile_rotate 10
# LIBERA SSL INSPECTION
####################################
acl libera_ssl dstdomain "/etc/squid3/acls/EXCECAO-sslinspection"
ssl_bump none libera_ssl
# parametros para autenticao
##############################
### negotiate kerberos and ntlm authentication
auth_param negotiate program /lib/squid3/negotiate_wrapper_auth -d --ntlm /usr/bin/ntlm_auth --diagnostics --helper-protocol=squid-2.5-ntlmssp --domain=NT --kerberos /usr/lib/squid3/squid_kerb_auth -d -s GSS_C_NO_NAME
auth_param negotiate children 10
auth_param negotiate keep_alive off
### pure ntlm authentication
auth_param ntlm program /usr/bin/ntlm_auth --diagnostics --helper-protocol=squid-2.5-ntlmssp --domain=NT
auth_param ntlm children 10
auth_param ntlm keep_alive off
### Auth padrao
auth_param basic program /usr/lib/squid3/squid_ldap_auth -R -b "dc=DOMINIO,dc=com,dc=br" -D "CN=ldap,OU=Contas para Casos Especiais,OU=Deptos DOMINIO,DC=DOMINIO,DC=com,DC=br" -w "**********" -f sAMAccountName=%s -h XXX.XX.1.1
auth_param basic children 5
auth_param basic realm Digite seu Login e Senha para o Acesso Internet
auth_param basic credentialsttl 1 minute
acl autentica proxy_auth REQUIRED
##SQUIDGUARD
url_rewrite_program /usr/bin/squidGuard -c /etc/squidguard/squidGuard.conf
## EXTERNAL ACL LISTA GRUPOS LDAP
#=================================
#external_acl_type grupo_ad ipv4 %LOGIN /usr/lib/squid3/wbinfo_group.pl
external_acl_type grupo_ad ipv4 ttl=10 %LOGIN /usr/lib/squid3/wbinfo_group.pl
# acls default squid
# ========================================
acl CONNECT method CONNECT
http_access allow localhost
http_access deny manager
### ACLstreaming download
#===========================
# streaming download
acl fails rep_mime_type -i ^video/
acl fails rep_mime_type ^.*mms.*
acl fails rep_mime_type ^.*ms-hdr.*
acl fails rep_mime_type ^.*x-fcs.*
acl fails rep_mime_type ^.*x-ms-asf.*
acl fails rep_mime_type ^audio/midi$
acl fails rep_mime_type ^audio/mpeg$
acl fails rep_mime_type ^audio/ogg$
acl fails rep_mime_type ^audio/vnd.ms-playready.media.pya$
acl fails rep_mime_type ^audio/vorbis$
acl fails rep_mime_type ^audio/x-mpeg$
acl fails rep_mime_type ^audio/x-ms-wax$
acl fails rep_mime_type ^audio/x-ms-wma$
acl fails rep_mime_type ^audio/x-pn-realaudio$
acl fails rep_mime_type ^audio/x-realaudio$
acl fails rep_mime_type ^audio/x-wav$
acl fails rep_mime_type ^video/avi$
acl fails rep_mime_type ^video/flc$
acl fails rep_mime_type ^video/mpeg$
acl fails rep_mime_type ^video/msvideo$
acl fails rep_mime_type ^video/quicktime$
acl fails rep_mime_type ^video/vnd.rn-realvideo$
acl fails rep_mime_type ^video/x-flv$
acl fails rep_mime_type ^video/x-mpeg$
acl fails rep_mime_type ^video/x-mpeg2$
acl fails rep_mime_type ^video/x-ms-asf$
acl fails rep_mime_type ^video/x-ms-wm$
acl fails rep_mime_type ^video/x-ms-wmv$
acl fails rep_mime_type ^video/x-ms-wmx$
acl fails rep_mime_type ^video/x-ms-wvx$
acl fails rep_mime_type ^video/x-msvideo$
acl fails rep_mime_type ^video/x-qtc$
acl fails rep_mime_type ^application/x-shockwave-flash$
acl fails2 urlpath_regex dvrplayer mediastream mms://
acl fails2 urlpath_regex \.asf$ \.afx$ \.flv$ \.swf$ \.mp3$
acl deny_rep_mime_flashvideo rep_mime_type -i video/flv
acl deny_rep_mime_shockwave rep_mime_type -i ^application/x-shockwave-flash$
acl x-type req_mime_type -i ^application/octet-stream$
acl x-type req_mime_type -i application/octet-stream
acl x-type req_mime_type -i ^application/x-mplayer2$
acl x-type req_mime_type -i application/x-mplayer2
acl x-type req_mime_type -i ^application/x-oleobject$
acl x-type req_mime_type -i application/x-oleobject
acl x-type req_mime_type -i application/x-pncmd
acl x-type req_mime_type -i ^video/x-ms-asf$
acl x-type req_mime_type -i audio/midi audio/mpeg audio/ogg audio/vnd.ms-playready.media.pya audio/vorbis audio/x-mpeg audio/x-ms-wax audio/x-ms-wma audio/x-pn-realaudio audio/x-realaudio audio/x-wav video/avi video/flc video/mpeg video/msvideo video/quicktime video/vnd.rn- realvideo video/x-flv video/x-mpeg video/x-mpeg2 video/x-ms-asf video/x-ms-wm video/x-ms-wmv video/x-ms-wmx video/x-ms-wvx video/x-msvideo video/x-qtc application/x-shockwave-flas application/json
acl x-type2 rep_mime_type -i ^application/octet-stream$
acl x-type2 rep_mime_type -i application/octet-stream
acl x-type2 rep_mime_type -i ^application/x-mplayer2$
acl x-type2 rep_mime_type -i application/x-mplayer2
acl x-type2 rep_mime_type -i ^application/x-oleobject$
acl x-type2 rep_mime_type -i application/x-oleobject
acl x-type2 rep_mime_type -i application/x-pncmd
acl x-type2 rep_mime_type -i ^video/x-ms-asf$
# acl controlar horario de expediente
# ----------------------------------------
acl horario_almoco time MTWHFA 12:00-13:59
### ACL POR GRUPOS LDAP
#===========================
acl liberados_full external grupo_ad fwl_Acesso_full
acl liberados_DirGer external grupo_ad fwl_diretores_e_gerentes
acl horario_almoco_12a13_grupo external grupo_ad fwl_intervalo1213
acl horario_almoco_12a13_hora time MTWHFA 12:00-12:59
acl horario_almoco_13a14_grupo external grupo_ad fwl_intervalo1314
acl horario_almoco_13a14_hora time MTWHFA 13:00-13:59
acl liberados_multimedia external grupo_ad fwl_multimedia
acl liberados_redes_sociais external grupo_ad FWL_Redes_Sociais
acl liberados_google external grupo_ad fwl_servicos_google
acl bloqueado_meiodia external grupo_ad fwl_acesso_padrao_integral
acl bloqueia_tudo external grupo_ad fwl_sem_acesso
acl libera_dropbox external grupo_ad fwl_dropbox
### ACL POR LISTA DE DOMINIO
#===========================
acl bloqueia_google dstdomain "/etc/squid3/acls/servicos_google"
acl bloqueia_redes_sociais dstdomain "/etc/squid3/acls/servicos_redes_sociais"
acl sites_permitidos urlpath_regex -i "/etc/squid3/acls/sites-permitidos"
### ACL LIBERACAO DOS DESTINOS SSL INSPECTION
#===========================================
# ACL Dropbox
acl dropbox dstdomain .dropbox.com
ssl_bump none dropbox libera_dropbox
ssl_bump none dropbox liberados_full
ssl_bump none dropbox liberados_DirGer
# ACL GDRIVE
acl libera_src_gdrive src "/etc/squid3/acls/liberados_gdrive"
acl gdrive dstdomain .accounts.google.com
acl gdrive dstdomain .clients3.google.com
acl gdrive dstdomain .drive.google.com
acl gdrive dstdomain .googledrive.com
#acl gdrive dstdomain .talk.google.com
acl gdrive dstdomain .www.googleapis.com
acl gdrive dstdomain .ssl.gstatic.com
#acl gdrive dstdomain .*.docs.google.com
acl gdrive dstdomain .*.drive.google.com
acl gdrive dstdomain .*.googleusercontent.com
ssl_bump none gdrive liberados_google
ssl_bump none gdrive liberados_full
ssl_bump none gdrive liberados_DirGer
ssl_bump none gdrive libera_src_gdrive
http_access allow gdrive libera_src_gdrive
####### HTTP_ACCESS REGRAS DAS ACLS
#=============================
#========= REGRAS COM DIFERENCIACAO DE HORARIO DE ALMOCO
#-------SEM ALMOCO
#BLOQUEIO SERVICOS GOOGLE
ssl_bump none Liberados_full gdrive
http_access deny !sites_permitidos bloqueado_meiodia bloqueia_google
#BLOQUEIO REDES SOCIAIS
http_access deny !sites_permitidos bloqueado_meiodia bloqueia_redes_sociais
#BLOQUEIO STREAMING
http_reply_access deny !sites_permitidos bloqueado_meiodia deny_rep_mime_flashvideo
http_reply_access deny !sites_permitidos bloqueado_meiodia deny_rep_mime_shockwave
http_access deny !sites_permitidos bloqueado_meiodia fails
http_reply_access deny !sites_permitidos bloqueado_meiodia fails
http_access deny !sites_permitidos bloqueado_meiodia fails2
http_reply_access deny !sites_permitidos bloqueado_meiodia fails2
http_access deny !sites_permitidos bloqueado_meiodia x-type
http_reply_access deny !sites_permitidos bloqueado_meiodia x-type
http_access deny !sites_permitidos bloqueado_meiodia x-type2
http_reply_access deny !sites_permitidos bloqueado_meiodia x-type2
#-----------------------------------------------------------------
#-------ALMOCO DAS 12:00 ATE 13:00
#BLOQUEIO SERVICOS GOOGLE
http_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo bloqueia_google
#REDES SOCIAIS
http_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo bloqueia_redes_sociais
#BLOQUEIO STREAMING
http_reply_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo deny_rep_mime_flashvideo
http_reply_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo deny_rep_mime_shockwave
http_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo fails
http_reply_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo fails
http_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo fails2
http_reply_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo fails2
http_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo x-type
http_reply_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo x-type
http_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo x-type2
http_reply_access deny !sites_permitidos !horario_almoco_12a13_hora horario_almoco_12a13_grupo x-type2
#LIBERA CASO SEJA HORA ALMOCO
http_reply_access allow horario_almoco_12a13_grupo sites_permitidos
http_access allow horario_almoco_12a13_grupo sites_permitidos
#------------------------------------------------------------------------------------------------------
#--------ALMOCO DAS 13:00 ATE 14:00
#BLOQUEIO SERVICOS GOOGLE
http_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora bloqueia_google
#BLOQUEIO REDES SOCIAIS
http_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora bloqueia_redes_sociais
#BLOQUEIO STREAMING
http_reply_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora deny_rep_mime_flashvideo
http_reply_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora deny_rep_mime_shockwave
http_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora fails
http_reply_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora fails
http_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora fails2
http_reply_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora fails2
http_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora x-type
http_reply_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora x-type
http_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora x-type2
http_reply_access deny !sites_permitidos horario_almoco_13a14_grupo !horario_almoco_13a14_hora x-type2
#LIBERA CASO SEJA HORA ALMOCO
http_reply_access allow horario_almoco_13a14_grupo sites_permitidos
http_access allow horario_almoco_13a14_grupo sites_permitidos
#---------------------------------------------------------------------------------------------------
#========= REGRAS COM HORARIO DE ALMOCO PADRAO
#LIBERACOES FULL
http_access allow Liberados_full
http_access allow Liberados_DirGer
#LIBERA DO SSL INSPECTION
ssl_bump none Liberados_full gdrive
ssl_bump none Liberados_DirGer gdrive
#BLOQUEIO REDES SOCIAIS
http_access deny !sites_permitidos !horario_almoco !liberados_redes_sociais bloqueia_redes_sociais
#BLOQUEIO SERVICOS GOOGLE
http_access deny !sites_permitidos !horario_almoco !liberados_google bloqueia_google
#BLOQUEIO STREAMING
http_reply_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia deny_rep_mime_flashvideo
http_reply_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia deny_rep_mime_shockwave
http_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia fails
http_reply_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia fails
http_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia fails2
http_reply_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia fails2
http_access deny !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia x-type
http_reply_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia x-type
http_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia x-type2
http_reply_access deny !sites_permitidos !horario_almoco !Liberados_DirGer !Liberados_full !liberados_multimedia x-type2
#====== grupos QUEUES
acl queue_EXCECAO external grupo_ad FWL_HTB_Excecao
# DELAY POOLS (QUEUES)
#===================================
## DOWNLOAD
delay_pools 2
## QUEUE EXCECAO
delay_class 1 5
delay_access 1 allow queue_EXCECAO
delay_access 1 deny all
delay_parameters 1 12250000/12250000
#NORMAL
delay_class 2 2
delay_access 2 allow all
delay_parameters 2 1250000/625000 12500000/12500000
###########################################################################################
#################### O PROBLEMA ESTÁ AQUI #################################################
##### QUANDO DESCOMENTO AS OPÇÕES ABAIXO QUE FERRA COM O SQUID ##########################
###########################################################################################
##UPLOAD
#client_delay_pools 1
#client_delay_initial_bucket_level 100
#client_delay_access 1 allow all
#client_delay_parameters 1 2048 1024
always_direct allow localhost
ssl_bump client-first all
http_reply_access allow !bloqueia_tudo autentica
http_access allow !bloqueia_tudo autentica
http_access deny all
#####################
### FIM DO CONFIG ###
#####################