[FUG-BR] duvida acl squid

Cleyton Bertolim cbertolim em gmail.com
Terça Junho 26 15:46:07 BRT 2007


Boa tarde Lista!

ha algum tempo atraz montei um servidor proxy com o squid e o pessoal
tinha que se autenticar no proxy pra poder navegar na internet, e
tambem tinha um grupo de nomes de usuarios pra cada setor daquela
empresa, entao cada setor so navegava nos sites que eram realmente
liberados. Segue um pequeno trecho do squid.conf deste lugar que esta
funcionando perfeitamente:

################################
### AUTENTICACAO DE USUARIOS ###
################################
auth_param basic program /usr/local/libexec/squid/ncsa_auth /usr/contas
auth_param basic children 10
auth_param basic realm DIGITE SEU USUARIO E SENHA
auth_param basic credentialsttl 1 hours
auth_param basic casesensitive on
authenticate_ttl 0 hours

############
### ACLs ###
############
### Opcoes que ja vem no squid.conf, com pequenas alteracoes ###
acl corporativo src 192.168.0.0/255.255.255.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80		# http
acl Safe_ports port 81		# http
acl Safe_ports port 21		# ftp
acl Safe_ports port 443 563	# https, snews
acl Safe_ports port 70		# gopher
acl Safe_ports port 210		# wais
acl Safe_ports port 1025-65535	# unregistered ports
acl Safe_ports port 280		# http-mgmt
acl Safe_ports port 488		# gss-http
acl Safe_ports port 591		# filemaker
acl Safe_ports port 777		# multiling http
acl CONNECT method CONNECT

acl users_acesso_total proxy_auth "/usr/users_acesso_total"
acl users_agropecuaria proxy_auth "/usr/users_agropecuaria"
acl users_camara proxy_auth "/usr/users_camara"

acl sites_acesso_total url_regex
"/usr/local/etc/squid/ACL/liberados/sites_acesso_total"
acl sites_agropecuaria url_regex
"/usr/local/etc/squid/ACL/liberados/sites_agropecuaria"
acl sites_camara url_regex "/usr/local/etc/squid/ACL/liberados/sites_camara"

acl sites_liberados url_regex
"/usr/local/etc/squid/ACL/liberados/sites_liberados"
acl sites_proibidos url_regex
"/usr/local/etc/squid/ACL/bloqueados/sites_proibidos"

####################
### HTTP_ACCESSs ###
####################
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow manager localhost
icp_access allow corporativo
miss_access allow corporativo
http_reply_access allow corporativo
reply_body_max_size 0 allow corporativo
ident_lookup_access allow corporativo

http_access allow users_acesso_total
http_access allow sites_liberados

http_access deny sites_proibidos

http_access deny users_agropecuaria !sites_agropecuaria
http_access deny users_camara !sites_camara
http_access deny users_contabilidade !sites_contabilidade


-------------------------------------------------------------------------------

AGORA ESTOU TENTANDO FAZER A MESMA COISA EM OUTRA EMPRESA, SO QUE O
PESSOAL ESTA USANDO PROXY TRANSPARENTE E NAO ESTAO FAZENDO
AUTENTICACAO DE USUARIOS, ENTAO O CONTROLE É FEITO APENAS PELOS
ENDERECOS IP'S.
MAS NAO ESTA DANDO CERTO!
SO ESTA PASSANDO PRA ACESSAR A INTERNET OS USUARIOS QUE TEM ACESSO
TOTAL PRA INTERNET. OS IP'S QUE DEVERIAM TER ACESSO HA ALGUNS SITES
COMO: GOOGLE.COM.BR, YAHOO.COM.BR ETC, NAO ESTAO CONSEGUINDO ACESSAR
NADA!!! NAO SEI O QUE ESTA ERRADO! JA PROCUREI NA NET E NA FUG SOBRE
ESSA DUVIDA MAS NAO ENCONTREI NADA!!!

ESTOU ENCAMINHANDO NESTE EMAIL O MEU NOVO SQUID.CONF E ALGUNS TRECHOS
DOS MEUS ARQUIVOS PARA ACL'S:

--- --- --- --- --- --- --- --- --- ---
more /usr/local/etc/squid/ACL/IpsAcessoBusca
#####
#CPD#
#####
#192.168.254.18          #Oracle
192.168.254.19          # NB
#192.168.254.20          # CPD002

more /usr/local/etc/squid/ACL/IpsAcessoTotal
#######
#wi-fi#
#######
192.168.254.10          #wf1
192.168.254.11          #wf2
192.168.254.13          #wf3

more /usr/local/etc/squid/ACL/IpsAcessoMsn
###############
#Contabilidade#
###############
#192.168.254.31         #cont1
#192.168.254.32         #cont2
#192.168.254.33         #cont3
192.168.254.34          #cont4


#more /usr/local/etc/squid/ACL/SitesAcessoTotal
.

#more /usr/local/etc/squid/ACL/SitesAcessoBusca
google.com.br
br.yahoo.com
br.rd.yahoo.com
yahoo.com.br
cade.com.br

#more /usr/local/etc/squid/ACL/SitesAcessoMsn
hotmail.com
st.msn.com
ad.dc2.adtech.de
ads1.mediaops.com.br
st.msn.com
by2.omega.contacts.msn.com:443
shared.live.com
search.msn.com.br

#more /usr/local/etc/squid/ACL/SitesTodosAcessam
gov.br
gravames.com.br
tedracing.com.br
crcrs.org.br
evisteon.com.br
licitacao.locaweb.com.br
hcdconsultoria.com.br
keko.com.br
powerbass.com.br
trademotorsport.com.br

# more /usr/local/etc/squid/squid.conf

visible_hostname webproxy-interno.com.br
error_directory /usr/local/etc/squid/errors/Portuguese
icon_directory /usr/local/etc/squid/icons

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     43

http_port 192.168.254.207:3128 transparent
cache_mem 512 MB
cache_swap_low 95
cache_swap_high 98
maximum_object_size 16384 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 32 KB
cache_dir ufs /usr/local/squid/cache 20000 16 256
icp_port 0
ipcache_size 2048 KB
ipcache_low 90
ipcache_high 95
fqdncache_size 2048 KB
cache_replacement_policy heap LRU
memory_replacement_policy lru
cache_access_log /usr/local/squid/logs/access.log
request_header_max_size 5 KB
connect_timeout 120 seconds
client_lifetime 1 day
half_closed_clients off
pconn_timeout 240 seconds
shutdown_lifetime 10 seconds
memory_pools on
memory_pools_limit 32 MB
pipeline_prefetch on
ie_refresh on
coredump_dir /usr/local/squid/cache
ftp_passive off

acl todos src 192.168.254.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 20 21 25 53 70 80 81 110 113 143 210 280 443 445
488 514 563 591 777 783 995 1023 1025-65535
acl CONNECT method CONNECT

acl IpsAcessoTotal src "/usr/local/etc/squid/ACL/IpsAcessoTotal"
acl IpsAcessoMsn src "/usr/local/etc/squid/ACL/IpsAcessoMsn"
acl IpsAcessoBusca src "/usr/local/etc/squid/ACL/IpsAcessoBusca"

acl SitesAcessoTotal url_regex "/usr/local/etc/squid/ACL/SitesAcessoTotal"
acl SitesAcessoMsn url_regex "/usr/local/etc/squid/ACL/SitesAcessoMsn"
acl SitesAcessoBusca url_regex "/usr/local/etc/squid/ACL/SitesAcessoBusca"
acl SitesTodosAcessam url_regex "/usr/local/etc/squid/ACL/SitesTodosAcessam"

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow manager localhost
icp_access allow todos
miss_access allow todos
http_reply_access allow todos
reply_body_max_size 0 allow todos
ident_lookup_access allow todos
htcp_access allow todos
htcp_clr_access allow todos

http_access allow IpsAcessoTotal
http_access allow SitesTodosAcessam

http_access deny IpsAcessoMsn !SitesAcessoMsn
http_access deny IpsAcessoBusca !SitesAcessoBusca

http_access deny todos
---------------------------------------------------------------------------------------

Se alguem puder ajudar eu agradeco!

Obrigado antecipadamente a todos pelo seu tempo e paciencia!

Cleyton Bertolim.


Mais detalhes sobre a lista de discussão freebsd