kelly.suporte
(usa Ubuntu)
Enviado em 17/07/2023 - 18:05h
Boa tarde Pessoal,
alguém poderia me ajudar, as regras abaixo não funcionam? ja fiz inúmeros testes, estudei todo o manual do squid e nada.Se alguém puder me da somente uma dica.
--- inicio das regras que nao funcionam ------
# sites e palavras novas regras proibidos
acl url_proibidos_indecentes dstdomain “/etc/squid/sites/url_proibidos_indecentes”
http_access deny url_proibidos_indecentes
cat url_proibidos_indecentes
.xvideos.com
.redtube.com
.pornotube.com
.onlyfan.com
.pornotube.com
.r7.com. ## teste de acesso não bloqueia
## Limite no tamanho do download -----> não esta limitando
acl download url_regex -i "/etc/squid/download"
reply_body_max_size 5 MB all !download # Limita o tamanho do download
cat /etc/squid/download
.ftp.br.debian.org.
# BLOQUEIO DE EXTENCOES -----> os downloads estão passando sem bloquear
acl extensoes urlpath_regex -i "/etc/squid/extensoes"
acl permitidos url_regex "/etc/squid/permitidos"
#http_access deny all extensoes !permitidos
http_access deny !permitidos extensoes
cat /etc/squid/extensoes
\.bat($|\?|\&) #para bloquear arquivos com extensao bat
\.bin($|\?|\&) #para bloquear arquivos com extensao bin
\.dat($|\?|\&) #para bloquear arquivos com estensões dat
\.dos($|\?|\&) #para bloquear arquivos com estensões dos
\.exe($|\?|\&) #para bloquear arquivos com extensao exe
--- fim das regras que nao funcionam ------
Aqui é meu squid.conf
#PORTA DE ACESSO AO PROXY#
http_port 192.168.23.1:5005
htcp_port 0
icp_port 0
accept_filter data
retry_on_error on
connect_retries 3
persistent_connection_after_error off
buffered_logs on
visible_hostname proxysrv.cotac.local
#-------------------------
#PARAMETROS DE AUTENTICAÇÃO#
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/cadastro
auth_param basic children 5
auth_param basic realm FlGG - Digite seu LOGIN e SENHA de Internet!
auth_param basic credentialsttl 1 hours
auth_param basic casesensitive off
forward_max_tries 50 #Tenta os primeiros 50 ips do endereço
client_db on
client_ip_max_connections 100
client_lifetime 30 minutes
cache_mgr suporte@cotac.com.br
error_directory /usr/share/squid/errors/pt-br/
#dns_v4_first on
dns_nameservers 1.1.1.1 8.8.8.8 8.8.4.4
cache_mem 6 GB
half_closed_clients off
maximum_object_size_in_memory 1024 KB
maximum_object_size 1024 KB
minimum_object_size 1024 KB
cache_swap_low 90
cache_swap_high 95
memory_pools off
#FIX
ipcache_low 98
ipcache_high 99
ipcache_size 16378
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# POLITICAS DE REPOSICAO
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
cache_mgr not_to_be_disturbed
read_ahead_gap 512 KB
forwarded_for delete
server_persistent_connections on
client_persistent_connections on
range_offset_limit 0
quick_abort_min -1 KB
quick_abort_max 0 KB
quick_abort_pct 90
memory_pools off
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
negative_ttl 3 minutes
positive_dns_ttl 5 minutes
half_closed_clients off
strip_query_terms off
detect_broken_pconn on
pipeline_prefetch on
#-------------------------
visible_hostname proxysrv.cotac.local
shutdown_lifetime 5 seconds
pid_filename /var/run/squid.pid
logfile_rotate 0
cache_store_log none
cache_log none
cache_effective_user proxy
cache_effective_group proxy
coredump_dir /var/log/spool/squid
cache_dir aufs /var/spool/squid/squid1 10000 32 256
cache_dir aufs /var/spool/squid/squid2 10000 32 256
cache_dir aufs /var/spool/squid/squid3 10000 32 256
no_cache deny all
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
## AUTENTICACAO ##
acl usuarios proxy_auth REQUIRED
#http_access allow usuarios
acl purge method PURGE
#http_access allow purge localhost
http_access deny purge
acl Safe_ports port 20 # ftp
acl Safe_ports port 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 80 # http
acl Safe_ports port 81 # http
acl Safe_ports port 82 # http nbs
acl Safe_ports port 84 # http nbs
acl Safe_ports port 85 # http nbs
acl Safe_ports port 210 # wais
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 365 # http-mgmt
acl Safe_ports port 443 # https
acl Safe_ports port 444 # https
acl Safe_ports port 488 # gss-http
acl Safe_ports port 563 # mntps
acl Safe_ports port 591 # filemaker
acl Safe_ports port 631 # filemaker
acl Safe_ports port 633 # cups
acl Safe_ports port 777 # multiling http
acl Safe_ports port 873 # rsync
acl Safe_ports port 809 #
acl Safe_ports port 2424 #Prefeitura SP
acl Safe_ports port 3334 # despachante
acl Safe_ports port 3456 #Sped Fiscal
acl Safe_ports port 3497 #Sped Fiscal
acl Safe_ports port 3443 #Sped Fiscal
acl Safe_ports port 8080
acl Safe_ports port 9090
acl Safe_ports port 8091
acl Safe_ports port 901 # swat
acl Safe_ports port 1011
acl Safe_ports port 1012
acl Safe_ports port 3050 # bradesco
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 1158
acl Safe_ports port 1088
acl Safe_ports port 1707
acl Safe_ports port 1311
acl Safe_ports port 5001
acl Safe_ports port 5005
acl Safe_ports port 4041
acl Safe_ports port 8086
acl Safe_ports port 8443
acl Safe_ports port 9091
acl Safe_ports port 9019
acl Safe_ports port 9020
acl Safe_ports port 9090
acl Safe_ports port 10000
http_access deny !Safe_ports
acl connect method CONNECT
# sites e palavras novas regras proibidos
acl url_proibidos_indecentes dstdomain “/etc/squid/sites/url_proibidos_indecentes”
http_access deny url_proibidos_indecentes
## Limite no tamanho do download
acl download url_regex -i "/etc/squid/download"
reply_body_max_size 5 MB all !download # Limita o tamanho do download
# BLOQUEIO DE EXTENCOES
acl extensoes urlpath_regex -i "/etc/squid/extensoes"
acl permitidos url_regex "/etc/squid/permitidos"
#http_access deny all extensoes !permitidos
http_access deny !permitidos extensoes
###### USUARIOS GERAIS ----> essa regra abaixo esta funcionando
acl geral proxy_auth "/etc/squid/users/usr_geral"
acl url_geral url_regex "/etc/squid/sites/url_geral"
http_access allow geral url_geral