wiliampegoraro
(usa Outra)
Enviado em 27/08/2014 - 11:45h
andrecanhadas escreveu:
wiliampegoraro escreveu:
andrecanhadas escreveu:
Qual DNS esta usando nas estações?
Usa proxy?
Usei o DNS 8.8.8.8
Não utilizo proxy, no squid está transparente
Poste seu firewall como ficou agora e também seu squid.conf
#!/bin/sh
#ip-guardian
echo ""
uname -s -r -m -o
echo ""
echo " FIREWALL RAFITEC -- Firewall Iptables"
echo ""
firewall_start(){
echo ""
echo " Iniciando as Regras do Firewall .............................................."
echo ""
echo " Ativando o IP forward ................................................. [ OK ]"
echo 1 > /proc/sys/net/ipv4/ip_forward
echo " Protegendo contra Pings ( ignorando ) ................................. [ OK ]"
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo " Protegendo contra IP spoofing ......................................... [ OK ]"
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
echo " Protegendo contra diversos ataques .................................... [ OK ]"
echo 1 > /proc/sys/net/ipv4/conf/all/accept_source_route
echo " Protegendo contra bogus responses ..................................... [ OK ]"
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo " Protegendo contra IP synflood ......................................... [ OK ]"
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo " Protegendo contra ICMP Broadcasting ................................... [ OK ]"
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo " Protegendo contra alteracao de rota ................................... [ OK ]"
echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
echo " Protegendo contra Pings da Morte ...................................... [ OK ]"
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT
echo " Definindo Politica Padrao ...................................................."
echo ""
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
echo " Limpando Regras Anteriores ............................................ [ OK ]"
echo ""
iptables -t filter -F
iptables -t nat -F
iptables -t mangle -F
iptables -t raw -F
echo " Compartilhando a internet via IPTABLES .................................[ OK ]"
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo " Redirecionando portas para o SQUID (Proxy Transparente) ............... [ OK ]"
iptables -t nat -A PREROUTING -i eth1 -m multiport -p tcp --dports 21,80,443 -j REDIRECT --to-port 3128
echo " Liberando acesso FTP, HTTP, HTTPS, DNS, através do SQUID .............. [ OK ]"
iptables -A INPUT -p tcp -i eth1 -m multiport --dports 21,80,443 -j ACCEPT
iptables -A FORWARD -p udp --dport 53 -j ACCEPT
echo " Liberando acesso NTP .................................................. [ OK ]"
iptables -A FORWARD -p tcp -i eth1 --dport 123 -j ACCEPT
echo " Liberando acesso a E-MAIL ............................................. [ OK ]"
iptables -A FORWARD -p tcp -i eth1 -m multiport --dports 25,110,143,465,587,993,995 -j ACCEPT
echo " Protegendo contra traceroute .......................................... [ OK ]"
iptables -A INPUT -p udp --dport 33435:33525 -j LOG --log-prefix "_BLOCKED_: "
iptables -A INPUT -p udp --dport 33435:33525 -j DROP
echo " Protegendo contra portscanners, ping of death, ataques DoS, etc. ...... [ OK ]"
iptables -A INPUT -m state --state INVALID -j LOG --log-prefix "_BLOCKED_: "
iptables -A INPUT -m state --state INVALID -j DROP
echo " Liberando conexao SSH ..................................................[ OK ]"
iptables -A INPUT -p tcp -m tcp --dport 22 -i eth0 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 22 -i eth1 -j ACCEPT
echo " Fechando portas UDP 1:1024 ............................................ [ OK ]"
iptables -A INPUT -p udp --dport 1:1024 -j LOG --log-prefix "_BLOCKED_UDP_: "
iptables -A INPUT -p udp --dport 1:1024 -j DROP
echo " Permitindo respostas a conexoes iniciadas pela maquina ................ [ OK ]"
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
echo " Permitindo respostas a conexoes iniciadas pela rede ................... [ OK ]"
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
echo " Liberando a interface de loopback ..................................... [ OK ]"
iptables -A INPUT -i lo -j ACCEPT
echo " Bloqueando qualquer conexao que nao tenha sido permitida acima ........ [ OK ]"
iptables -A INPUT -p tcp --syn -j LOG --log-prefix "_BLOCKED_: "
iptables -A INPUT -p tcp --syn -j DROP
echo " Firewall em operacao .................................................. [ OK ]"
sleep 1
}
firewall_stop(){
iptables -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t filter -F
iptables -t nat -F
iptables -t mangle -F
iptables -t raw -F
}
case "$1" in
"start")
firewall_start
;;
"stop")
firewall_stop
echo " Desativando todas as Regras do Firewall ................................ [ OK ]"
echo " firewall disabled "
sleep 1
;;
status)
echo -e " ============================== Table Filter ============================ ";
iptables -t filter -vnL
echo -e " ============================== Table Nat ============================= ";
iptables -t nat -vnL
echo -e " ============================== Table Mangle =========================== ";
iptables -t mangle -vnL
echo -e " ============================== Table Raw ============================ ";
iptables -t raw -vnL
;;
"restart")
echo " Reativando todas as Regras do Firewall ................................ [ OK ]"
sleep 1
firewall_stop; firewall_start
;;
*)
iptables -vnL
esac
http_port 3128 transparent
maximum_icp_query_timeout 2000
cache_mem 2048 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 600 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid 30000 128 128
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl redelocal src 192.168.100.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 21 80 443 563
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !Safe_ports
acl liberar_root src "/etc/squid/liberar_root"
acl extensoes url_regex -i \.vbs \.bat \.avi \.mp3 \.scr \.cmd \.rmvb \.wmv \.wma \.mpg \.mpeg \.mp4 \.iso \.zip \.rar \.cab \.rpm \.tar \.gz \.tgz. \.tgz \.exe \.msi \.flv \.pls \.cpl
acl proibir_palavras_na_url url_regex -i "/etc/squid/proibir_palavras_na_url"
acl proibir_palavras_no_dominio dstdom_regex -i "/etc/squid/proibir_palavras_no_dominio"
http_access deny extensoes
http_access deny proibir_palavras_na_url !liberar_root
http_access deny proibir_palavras_no_dominio !liberar_root
http_access allow localhost
http_access allow liberar_root
http_access deny redelocal !liberar_root
http_access deny all