{"id":85,"date":"2010-11-11T00:51:36","date_gmt":"2010-11-11T03:51:36","guid":{"rendered":"http:\/\/blog.digavoip.com.br\/2010\/11\/11\/squidconf-exemplo-com-autenticacao-pam\/"},"modified":"2010-11-11T00:59:34","modified_gmt":"2010-11-11T03:59:34","slug":"squidconf-exemplo-com-autenticacao-pam","status":"publish","type":"post","link":"https:\/\/blog.abratel.com.br\/?p=85","title":{"rendered":"Squid.conf Exemplo com autenticacao PAM"},"content":{"rendered":"<p>http_port 3128 transparent<br \/>\nvisible_hostname debian<\/p>\n<p>################################################################################<br \/>\nmemory_pools on<\/p>\n<p>cache_mem 512 MB<br \/>\nmaximum_object_size_in_memory 1024 KB<\/p>\n<p>maximum_object_size 2512 MB<br \/>\nminimum_object_size 10 KB<\/p>\n<p>cache_swap_low 95<br \/>\ncache_swap_high 98<\/p>\n<p>cache_replacement_policy heap GDSF<br \/>\nmemory_replacement_policy heap GDSF<\/p>\n<p>fqdncache_size 20240<br \/>\nipcache_size 20240<br \/>\nipcache_low 90<br \/>\nipcache_high 95<br \/>\ndiskd_program   \/usr\/lib\/squid\/diskd<br \/>\nunlinkd_program \/usr\/lib\/squid\/unlinkd<br \/>\ncache_dir ufs \/var\/spool\/squid 819200 16 256<br \/>\ncache_access_log \/var\/log\/squid\/access.log<br \/>\ncache_log \/var\/log\/squid\/cache.log<br \/>\ncache_store_log \/var\/log\/squid\/store.log<\/p>\n<p>#mime_table \/etc\/squid\/mime.conf<br \/>\npid_filename \/var\/log\/squid\/squid.pid<br \/>\nlog_fqdn on<br \/>\ncache_mgr admin@abratel.com.br<br \/>\ndns_nameservers 200.165.132.147 8.8.8.8<br \/>\nlogfile_rotate 10<br \/>\nie_refresh on<br \/>\nforwarded_for off<\/p>\n<p>refresh_pattern ^ftp: 1440 20% 10080<br \/>\nrefresh_pattern ^gopher: 1440 0% 2280<br \/>\nrefresh_pattern . 15 20% 4280<\/p>\n<p>################################################################################<br \/>\nauth_param basic children 15<br \/>\nauth_param basic realm Abratel Proxy Server<\/p>\n<p>auth_param basic program \/usr\/lib\/squid\/pam_auth<\/p>\n<p>###############################################################################<\/p>\n<p>acl proibidos url_regex -i &#8220;\/etc\/squid\/bloqueados\/proibidos.txt&#8221;<br \/>\nacl liberados url_regex -i &#8220;\/etc\/squid\/bloqueados\/liberados.txt&#8221;<\/p>\n<p>## ACL USUARIOS ##<\/p>\n<p>acl ulisses.pass proxy_auth &#8220;\/etc\/squid\/bloqueados\/ulisses.user&#8221;<br \/>\nacl ulisses.unblock url_regex -i &#8220;\/etc\/squid\/bloqueados\/ulisses.unblock.txt&#8221;<\/p>\n<p>acl all src 192.168.254.0\/255.255.255.0<\/p>\n<p>#regras necessarias<br \/>\nacl manager proto cache_object<br \/>\nacl localhost src 127.0.0.1\/255.255.255.255<br \/>\nacl to_localhost dst 127.0.0.0\/8<br \/>\nacl SSL_ports_443 port 443 8080<br \/>\nacl SSL_ports port 443 563 8080 10000 2038<br \/>\nacl Safe_ports port 80 443 # http<br \/>\n#acl Safe_ports port 20<br \/>\n#acl Safe_ports port 21 # ftp<br \/>\nacl Safe_ports port 443 563 10000 # https, snews<br \/>\nacl Safe_ports port 70 # gopher<br \/>\nacl Safe_ports port 210 # wais<br \/>\nacl Safe_ports port 1025-65535 # unregistered ports<br \/>\nacl Safe_ports port 280 # http-mgmt<br \/>\nacl Safe_ports port 488 # gss-http<br \/>\nacl Safe_ports port 591 # filemaker<br \/>\nacl Safe_ports port 777 # multiling http<br \/>\nacl Safe_ports port 8080 # multiling http<br \/>\nacl Safe_ports_msn port 1863<br \/>\nacl CONNECT method CONNECT<\/p>\n<p>http_access deny proibidos<br \/>\nhttp_access allow liberados<\/p>\n<p>http_access allow ulisses.pass ulisses.unblock<\/p>\n<p>####################################################<br \/>\nhttp_access deny !ulisses.unblock<br \/>\nhttp_access deny !liberados<\/p>\n<p>###################################################<\/p>\n<p>http_reply_access allow all<br \/>\n#<br \/>\nhttp_access allow all<\/p>\n<p>#################################################<br \/>\nicp_access allow all<br \/>\nmiss_access allow all<br \/>\nicon_directory \/usr\/share\/squid\/icons<br \/>\nerror_directory \/usr\/share\/squid\/errors\/Portuguese<br \/>\nvisible_hostname       Abratel Proxy Server<br \/>\nhalf_closed_clients     off<br \/>\nstore_dir_select_algorithm      round-robin<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nEstrutura do \/etc\/squid\/bloqueados<br \/>\n-rw-r&#8211;r&#8211; 1 root root 9 Nov 11 01:42 liberados.txt  &#8211;> sites liberados para todos<br \/>\n -rw-r&#8211;r&#8211; 1 root root 5 Nov 11 01:46 proibidos.txt &#8211;>  sites proibidos para todos<br \/>\n-rw-r&#8211;r&#8211; 1 root root 8 Nov 11 01:53 ulisses.unblock.txt &#8211;> sites liberados para esse usuario (se por um ponto &#8220;.&#8221; dentro do arquivo, libera tudo)<br \/>\n-rw-r&#8211;r&#8211; 1 root root 8 Nov 11 01:43 ulisses.user &#8211;> nome do usuario na tabela do mysql<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http_port 3128 transparent visible_hostname debian ################################################################################ memory_pools on cache_mem 512 MB maximum_object_size_in_memory 1024 KB maximum_object_size 2512 MB minimum_object_size 10 KB cache_swap_low 95 cache_swap_high 98 cache_replacement_policy heap GDSF memory_replacement_policy heap GDSF fqdncache_size 20240 ipcache_size 20240 ipcache_low 90 ipcache_high 95 diskd_program \/usr\/lib\/squid\/diskd unlinkd_program \/usr\/lib\/squid\/unlinkd cache_dir ufs \/var\/spool\/squid&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/85"}],"collection":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":0,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}