[FUG-BR] PFSense + Squid + Custom Options

Giancarlo Rubio gianrubio em gmail.com
Terça Dezembro 30 12:11:52 BRST 2008


2008/12/30 Welkson Renny de Medeiros <welkson em focusautomacao.com.br>

> Giancarlo,
>
> Fiz a custom options como sugerido pensando que a regra com o mesmo nome
> ignoraria a primeira... mesmo assim não funcionou....
>
> Ficou assim:
> acl blockext url_regex -i \.scr$ \.pif$ \.bat$ \.cmd$ \.lnk$ \.vbs$;
> http_access allow unrestricted_hosts !blockext;
>
> Vou postar o SQUID.CONF inteiro pra você ver:
>
> # Setup some default acls
> acl all src 0.0.0.0/0.0.0.0
> acl localhost src 127.0.0.1/255.255.255.255
> acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901  3128
> 1025-65535
> acl sslports port 443 563
> acl manager proto cache_object
> acl purge method PURGE
> acl connect method CONNECT
> acl dynamic urlpath_regex cgi-bin \?
> acl allowed_subnets src 192.168.2.0/24
> acl unrestricted_hosts src "/var/squid/acl/unrestricted_hosts.acl"
> acl banned_hosts src "/var/squid/acl/banned_hosts.acl"
> acl whitelist dstdom_regex -i "/var/squid/acl/whitelist.acl"
> acl blacklist dstdom_regex -i "/var/squid/acl/blacklist.acl"
> cache deny dynamic
> http_access allow manager localhost
>
> http_access deny manager
> http_access allow purge localhost
> http_access deny purge
> http_access deny !safeports
> http_access deny CONNECT !sslports
>
> # Always allow localhost connections
> http_access allow localhost
>
> request_body_max_size 0 KB
> reply_body_max_size 0 allow all
> cache_mem 8 MB
> maximum_object_size 4 KB
> minimum_object_size 0 KB
> cache_replacement_policy heap LFUDA
> memory_replacement_policy heap GDSF
> http_access allow localhost
>
> request_body_max_size 0 KB
> reply_body_max_size 0 allow all
> delay_pools 1
> delay_class 1 2
> delay_parameters 1 -1/-1 -1/-1
> delay_initial_bucket_level 100
> delay_access 1 allow all
>
> # These hosts are banned
> http_access deny banned_hosts
> # These hosts do not have any restrictions
> http_access allow unrestricted_hosts
> # Always allow access to whitelist domains
> http_access allow whitelist
> # Block access to blacklist domains
> http_access deny blacklist
> # Allow local network(s) on interface(s)
> http_access allow localnet
> http_access allow allowed_subnets
>
> # Custom options (BRONCA AQUI #########################################)
> acl blockext url_regex -i \.scr$ \.pif$ \.bat$ \.cmd$ \.lnk$ \.vbs$
> http_access allow unrestricted_hosts !blockext
>
> # Default block all to be sure
> http_access deny all
>
>
> Ativei o debug como sugerido e tinha isso no cache.log:
>
> 2008/12/30 10:42:10| The reply for GET http://intranet.xxx.com.br/ is
> ALLOWED, because it matched 'all'
> 2008/12/30 10:42:10| The request GET http://intranet.xxx.com.br/ is
> ALLOWED,
> because it matched 'unrestricted_hosts'
> 2008/12/30 10:42:10| The reply for GET http://intranet.xxx.com.br/ is
> ALLOWED, because it matched 'all'
>
> ALL tem prioridade, unrestricted_hosts também.
>
> Resumindo: TÔ FERRADO!
>
> Dei uma olhada no módulo squidguard, nele dar para definir a prioridade,
> mas
> não achei como definir bloqueios por exetensão, ou uma "Custom acl" =)
>
> No fórum do pfsense tem quase nada... rsrs
>
> Welkson


Hum..vc nao leu seu squid.conf neh??


# These hosts are banned
http_access deny banned_hosts
# These hosts do not have any restrictions
http_access allow unrestricted_hosts

....

# Custom options (BRONCA AQUI #########################################)
acl blockext url_regex -i \.scr$ \.pif$ \.bat$ \.cmd$ \.lnk$ \.vbs$ http_access
allow unrestricted_hosts !blockext
 ...

se vc liberou la em cima não queira tentar bloquear agora pq não funciona
neh :p

Se não conseguir fazer dessa forma, use o que o irado acabou de falar...

-- 
---
Giancarlo Rubio
Getech - Soluções em rede
(41) 4063-9039 / (11) 4063-5470
www.getech.com.br


Mais detalhes sobre a lista de discussão freebsd