
		fabiosds
		
		(usa Debian)
		
		Enviado em 11/06/2013 - 16:41h 
		Montei Acl mas não funcionou, o link que retorna apos colocar a senha é esse 
https://bankline.itau.com.br/GRIPNET/bklcom.dll">
https://bankline.itau.com.br/GRIPNET/bklcom.dll
Squid.conf
http_port 3128
  2 visible_hostname fw-px
  3
  4 error_directory /usr/share/squid/errors/pt-br
  5
  6 cache_mem 200 MB
  7 maximum_object_size_in_memory 64 KB
  8 maximum_object_size 1024 MB
  9 minimum_object_size 0 KB
 10 cache_swap_low 80
 11 cache_swap_high 95
 12 cache_dir ufs /var/spool/squid 2048 16 256
 13 cache_access_log /var/log/squid/access.log
 14 refresh_pattern ^ftp: 15 20% 2280
 15 refresh_pattern ^gopher: 15 0% 2280
 16 refresh_pattern . 15 20% 2280
 17
 18 acl all src 0.0.0.0/0.0.0.0
 19 acl  manager proto cache_object
 20 acl localhost src 127.0.0.1/255.255.255.255
 21 acl SSL_ports port 443 563
 22 acl Safe_ports port 21 80 443 563 70 210 280 448 59 777 901 1025-65535
 23 acl purge method PURGE
 24 acl CONNECT method CONNECT
 25
 26 http_access allow manager localhost
 27 http_access deny manager
 28 http_access allow purge localhost
 29 http_access deny purge
 30 http_access deny !Safe_ports
 31 http_access deny CONNECT !SSL_ports
 32
 33 acl macti arp "/etc/squid/listas/macti.txt"
 34 http_access allow macti
 35
 36 acl diretoria arp "/etc/squid/listas/diretoria.txt"
 37 http_access allow diretoria
 38
 39 acl itau dstdomain 
https://bankline.itau.com.br
 40 http_access allow itau
 41
 42 acl bancosepublicos url_regex -i "/etc/squid/listas/bancosepublicos.txt"
 43 http_access allow bancosepublicos
 44
 45 acl redes-sociais-deny url_regex -i "/etc/squid/listas/redes-sociais-deny.txt"
 46 acl almoco time MTWHF 12:00-14:00
 47 http_access deny redes-sociais-deny !almoco
 48
 49 acl palavrasproibidas dstdom_regex "/etc/squid/listas/palavrasproibidas.txt"
 50 http_access deny palavrasproibidas
 51
 52 #acl arquivosproibidos url_regex -i "etc/squid/listas/arquivosproibidos.txt"
 53 #http_access deny arquivosproibidos
 54
 55 acl bloqueados url_regex -i "/etc/squid/listas/bloqueados.txt"
 56 http_access deny bloqueados
 57
 58 acl redelocal src 192.168.1.0/24
 59 http_access allow localhost
 60 http_access allow redelocal
 61 http_access deny all
Firewall
#!/bin/bash
  2
  3 # EXEMPLO DE SCRIPT DE FIREWALL PARA ARTIGO NO SITE 
www.vivaolinux.com.br
  4 # MODIFICADO PARA USO EM ANTLIA CONSUTORIA.
  5 # DECLARANDO AS VARIÃEIS #
  6
  7 iniciar(){
  8
  9 # Interface de rede ligada a internet
 10 IFACE_WEB="eth0"
 11
 12 # Interface de rede ligada a rede interna
 13 IFACE_REDE="eth2"
 14
 15 # Rede interna - ALTERAR PARA O IP DA REDE REAL DA ANTLIA 192.168.1.0/24
 16 REDE_INTERNA="192.168.1.0/24"
 17
 18 # Portas liberadas TCP
 19 PORTAS_TCP="20,21,53,80,443"
 20
 21 # Portas liberadas UDP
 22 PORTAS_UDP="53"
 23
 24 # Portas liberadas para a rede interna
 25 PORTAS_REDE_INTERNA="25,110"
 26
 27 #LIMPA AS REGRAS EXISTENTES #
 28         iptables -F
 29         iptables -t nat -F
 30                         ICAS PADRÃS DO IPTABLES COMO DROP #
 32         iptables -P INPUT ACCEPT
 33         iptables -P OUTPUT ACCEPT
 34         iptables -P FORWARD ACCEPT
 35
 36         # HABILITA O ROTEAMENTO NO KERNEL #
 37         echo 1 > /proc/sys/net/ipv4/ip_forward
 38
 39         iptables -t nat -A POSTROUTING -s $REDE_INTERNA -o $IFACE_WEB -j MASQUERADE
 40
 41         # Libera o acesso SSH de qualquer origem
 42         iptables -A INPUT -p tcp --dport 22 -j ACCEPT
 43
 44         # Libera o squid a partir da rede interna
 45         iptables -A INPUT -p tcp --dport 3128 -j ACCEPT
 46
 47         # Aceita ping apenas da rede interna
 48         iptables -A INPUT -s $REDE_INTERNA -p icmp --icmp-type 8 -j ACCEPT
 49         ################
 50         # REGRAS DE OUTPUT #
 51         ################
 52
 53          # Libera as portas constantes na variál $PORTAS_TCP (para liberar mais portas, basta inserir as mesmas na variál citada)
 54          iptables -A OUTPUT -p tcp -m multiport --dports $PORTAS_TCP -j ACCEPT
 55
 56          # Libera ping para qualquer lugar
 57          iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
 58
 59         # REGRAS DE FORWARD SERVIDOR VPN - 10-06-2013
 60         #iptables -t nat -A PREROUTING -p tcp -m tcp -i eth0 --dport 1723 -j DNAT --to-destination 192.168.1.10:1723
 61         #iptables -t nat -A PREROUTING -p 47 -i eth0 -j DNAT --to-destination 192.168.1.10
            # Caso queira manter as regras de NAT favor copiar as regras de nat
 64         # e as correspondentes as mesmas de forward aqui
 65
 66         echo "Regras de Firewall e Compartilhamento Ativados"
 67 }
 68
 69 parar(){
 70         iptables -F
 71         iptables -t nat -F
 72         iptables -P INPUT ACCEPT
 73         iptables -P OUTPUT ACCEPT
 74         echo 0 > /proc/sys/net/ipv4/ip_forward
 75         echo "Regras de Firewall e Compartilhamento Desativados"
 76 }
 77 case "$1" in
 78         "start") iniciar ;;
 79         "stop") parar ;;
 80         "restart") parar; iniciar ;;
 81         *) echo "Use os parametros start, stop ou restart"
 82 esac