faiko14
(usa Debian)
Enviado em 17/05/2011 - 16:47h
squid.conf
http_port 3128
visible_hostname AUTOMATECH
error_directory /usr/share/squid/errors/Portuguese/
auth_param basic children 5
auth_param basic realm AUTOMATECH, para acessar a internet Digite sua senha.
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive on
auth_param basic realm Squid proxy-caching web server
cache_mem 512 MB
maximum_object_size_in_memory 128 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 80
cache_swap_high 85
cache_dir ufs /var/spool/squid 4096 16 256
access_log /var/log/squid/access.log
cache_access_log /var/log/squid/access.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 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 70 210 280 488 59 777 901 1025-65535
acl purge method PURGE
acl CONNECT method CONNECT
acl bloqueados url_regex -i "/etc/squid/regras/bloqueados.txt"
acl liberados url_regex -i "/etc/squid/regras/liberados.txt"
acl users proxy_auth "/etc/squid/passwd"
acl sinalarte proxy_auth REQUIRED
acl super_users proxy_auth "/etc/squid/super-users"
acl msn url_regex -i "/etc/squid/libera_msn"
http_access allow msn
http_access allow liberados
http_access allow bloqueados super_users
http_access allow users
http_access allow manager localhost
http_access allow manager
http_access allow purge localhost
http_access allow purge
http_access allow !Safe_ports
http_access allow CONNECT !SSL_ports
http_access deny bloqueados
acl redelocal src 192.168.1.0/24
http_access allow localhost
http_access allow redelocal
http_access allow all
firewall
# arquivo de configuracao do firewall
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -F
iptables -Z
iptables -t nat -F
iptables -t nat -A POSTROUTING -s 192.168.1.1/24 -j MASQUERADE
#TomCat
iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth1 --dport 8080 -j DNAT --to-destination 192.168.1.250
iptables -t nat -A PREROUTING -s 189.36.137.68 -m tcp -p tcp -i eth1 --dport 8080 -j DNAT --to-destination 192.168.1.250
#Acesso Remoto
iptables -t nat -A PREROUTING -s 0/0 -p tcp -i eth1 --dport 3389 -j DNAT --to-destination 192.168.1.250
iptables -t nat -A PREROUTING -s 189.36.137.68 -m tcp -p tcp -i eth1 --dport 3389 -j DNAT --to-destination 192.168.1.250
#servidor de cameras
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 5004 -j DNAT --to 192.168.1.70:5004
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 4550 -j DNAT --to 192.168.1.70:4550
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 5550 -j DNAT --to 192.168.1.70:5550
#cameras ip
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 5002 -j DNAT --to 192.168.1.191:5002
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 5005 -j DNAT --to 192.168.1.191:5005
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 5003 -j DNAT --to 192.168.1.192:5003
iptables -t nat -A PREROUTING -p tcp -d 189.36.137.68 --dport 5006 -j DNAT --to 192.168.1.192:5006
#Vono
iptables -t nat -I PREROUTING -s 192.168.1.165 -j ACCEPT
iptables -t nat -I POSTROUTING -s 192.168.1.165 -o eth1 -j MASQUERADE
iptables -I FORWARD -s 192.168.1.165 -j ACCEPT
# Libera Voip
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 5060 -j DNAT --to-dest 192.168.1.165
iptables -A FORWARD -i eth1 -s 0/0 -p tcp -d 192.168.1.165 --dport 5060 -j ACCEPT
#iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
#echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
#iptables -A INPUT -m state --state INVALID -j DROP
#iptables -A INPUT -i lo -j ACCEPT
#iptables -A INPUT -i eth0 -j ACCEPT
#iptables -A INPUT -p tcp --dport 22 -j ACCEPT
#iptables -A INPUT -p tcp --syn -j DROP
#ignora ping
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
# Protecao contra IP Spoofing
for i in /proc/sys/net/ipv4/conf/*/rp_filter; do
echo 1 >$i
done
# Desabilitar pacotes com source routing ligado - complementa contra IP Spoofing
for i in /proc/sys/net/ipv4/conf/*/accept_source_route; do
echo 0 >$i
done
# Desabilitar os efeitos de ICMP redirects - pode ser usado por atacantes com o objetivo de desvirtuar rotas.
for i in /proc/sys/net/ipv4/conf/*/accept_redirects; do
echo 0 >$i
done
#regra de bloqueio
#iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 80 -j REDIRECT --to-port 3128
#iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 5000 -j REDIRECT --to-port 3128
#iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 5685 -j REDIRECT --to-port 3128
#iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 1863 -j REDIRECT --to-port 3128
no access.log nao tem nenhuma entrada do ip do voip