willifds
(usa Ubuntu)
Enviado em 10/05/2011 - 13:41h
olha eu fiz um que a varios grupos com bloqueio de horario e acesso diferentes talvez te ajude
#Recommended minimum configuration per scheme:
#auth_param negotiate program <uncomment and complete this line to activate>
#auth_param negotiate children 5
#auth_param negotiate keep_alive on
#auth_param ntlm program <uncomment and complete this line to activate>
#auth_param ntlm children 5
#auth_param ntlm keep_alive on
#auth_param digest program <uncomment and complete this line>
#auth_param digest children 5
#auth_param digest realm Squid proxy-caching web server
#auth_param digest nonce_garbage_interval 5 minutes
#auth_param digest nonce_max_duration 30 minutes
#auth_param digest nonce_max_count 50
#auth_param basic program <uncomment and complete this line>
#auth_param basic children 5
#auth_param basic realm Squid proxy-caching web server
#auth_param basic credentialsttl 2 hours
#auth_param basic casesensitive off
# ACCESS CONTROLS
#Recommended minimum configuration:
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
#acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
#
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 403 # msn
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl Safe_ports port 1863 # msn
acl Safe_ports port 5148 # msn
acl purge method PURGE
acl CONNECT method CONNECT
#Recommended minimum configuration:
# Only allow cachemgr access from localhost
#http_access allow manager localhost
http_access deny manager
# Only allow purge requests from localhost
http_access allow purge localhost
http_access deny purge
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl msn url_regex -i "/etc/squid/conf/msn"
http_access allow msn
acl ips_liberados src "/etc/squid/conf/ips_liberados"
auth_param basic realm Capuani Proxy Server
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd
acl autenticados proxy_auth REQUIRED
#*** autenticação******
acl diretor proxy_auth "/etc/squid/conf/diretor"
acl comercial_diurno proxy_auth "/etc/squid/conf/grupos/comercial_diurno"
acl comercial_diurno_msn proxy_auth "/etc/squid/conf/grupos/comercial_diurno_msn"
acl comercial_noturno proxy_auth "/etc/squid/conf/grupos/comercial_noturno"
acl comercial_noturno_msn proxy_auth "/etc/squid/conf/grupos/comercial_noturno_msn"
acl sabado_diurno proxy_auth "/etc/squid/conf/grupos/sabado_diurno"
acl sabado_diurno_msn proxy_auth "/etc/squid/conf/grupos/sabado_diurno_msn"
acl sabado_noturno proxy_auth "/etc/squid/conf/grupos/sabado_noturno"
acl sabado_noturno_msn proxy_auth "/etc/squid/conf/grupos/sabado_noturno_msn"
#*** bloqueios de sites ****
acl nega_palavras url_regex -i "/etc/squid/conf/nega_palavras"
acl nega_downloads urlpath_regex "/etc/squid/conf/nega_downloads"
acl bloq_orkut_twiter_msn url_regex -i "/etc/squid/conf/bloq_orkut_twiter"
acl bloq_dominio dstdom_regex "/etc/squid/conf/bloq_dominio"
acl nega_palavras_msn url_regex -i "/etc/squid/conf/nega_palavras_msn"
acl msn url_regex -i "/etc/squid/conf/msn"
acl msnn dstdomain loginnet.passport.com
acl msnmessenger url_regex -i gatway.dll
acl h_comercial_diurno time MTWHF 05:59-17:40
acl h_comercial_noturno time MTWHF 05:59-23:59
acl h_sabado_diurno time MTWHFA 05:59-17:40
acl h_sabado_noturno time MTWHFA 05:59-23:59
#*** regra de bloqueios dos usr ****
#*---- diurno
http_access deny comercial_diurno nega_downloads h_comercial_diurno
http_access deny comercial_diurno nega_palavras h_comercial_diurno
http_access allow comercial_diurno !nega_palavras h_comercial_diurno
http_access allow comercial_diurno h_comercial_diurno
http_access allow comercial_diurno_msn msnn h_comercial_diurno
http_access allow comercial_diurno_msn msnmessenger h_comercial_diurno
http_access deny comercial_diurno_msn nega_downloads h_comercial_diurno
http_access deny comercial_diurno_msn nega_palavras_msn h_comercial_diurno
http_access allow comercial_diurno_msn !nega_palavras_msn h_comercial_diurno
http_access allow comercial_diurno_msn h_comercial_diurno
#*---- noturno
http_access deny comercial_noturno nega_downloads h_comercial_noturno
http_access deny comercial_noturno nega_palavras h_comercial_noturno
http_access allow comercial_noturno !nega_palavras h_comercial_noturno
http_access allow comercial_noturno h_comercial_noturno
http_access allow comercial_noturno_msn msnn h_comercial_noturno
http_access allow comercial_noturno_msn msnmessenger h_comercial_noturno
http_access deny comercial_noturno_msn nega_downloads h_comercial_noturno
http_access deny comercial_noturno_msn nega_palavras_msn h_comercial_noturno
http_access allow comercial_noturno_msn !nega_palavras_msn h_comercial_noturno
http_access allow comercial_noturno_msn h_comercial_noturno
#*---- sabado diurno
http_access deny sabado_diurno nega_downloads h_sabado_diurno
http_access deny sabado_diurno nega_palavras h_sabado_diurno
http_access allow sabado_diurno !nega_palavras h_sabado_diurno
http_access allow sabado_diurno h_sabado_diurno
http_access deny sabado_diurno_msn nega_downloads h_sabado_diurno
http_access deny sabado_diurno_msn nega_palavras_msn h_sabado_diurno
http_access allow sabado_diurno_msn !nega_palavras_msn h_sabado_diurno
http_access allow sabado_diurno_msn h_sabado_diurno
#*---- sabado noturno
http_access deny sabado_noturno nega_downloads h_sabado_noturno
http_access deny sabado_noturno nega_palavras h_sabado_noturno
http_access allow sabado_noturno !nega_palavras h_sabado_noturno
http_access allow sabado_noturno h_sabado_noturno
http_access deny sabado_noturno_msn nega_downloads h_sabado_noturno
http_access deny sabado_noturno_msn nega_palavras_msn h_sabado_noturno
http_access allow sabado_noturno_msn !nega_palavras_msn h_sabado_noturno
http_access allow sabado_noturno_msn h_sabado_noturno
http_access allow diretor
#http_access deny bloq_orkut_twiter_msn
#http_access deny bloq_dominio
http_access deny all
icp_access deny all
# NETWORK OPTIONS
# -----------------------------------------------------------------------------
# MEMORY CACHE OPTIONS
# -----------------------------------------------------------------------------
cache_mem 8 MB
maximum_object_size_in_memory 8 KB
# DISK CACHE OPTIONS
cache_dir ufs /var/spool/squid 100 16 256
minimum_object_size 0 KB
maximum_object_size 4096 KB
cache_swap_low 90
cache_swap_high 95
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
logfile_rotate 10
#Suggested default:
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
visible_hostname Capuani
error_directory /usr/share/squid/errors/Portuguese