[Previo por Fecha] [Siguiente por Fecha] [Previo por Hilo] [Siguiente por Hilo]

[Hilos de Discusión] [Fecha] [Tema] [Autor]

Re: [Ayuda] SEGURIDAD que hacer?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 30 August 2003 23:44, Anibal J. Avelar (Fixxxer) wrote:

>
> > 2.1) Debo colocar un firewall en Linux cuando navegue?
>
> Para navegar? ... no, no es necesario ...  si tuvieras un servidor con
> Linux si, pero como usuario normal, con la seguridad normal que trae
> Linux basta ...

Estoy de acuerdo con todo lo demás, pero aquí mi paranoia me pide a gritos que 
intervenga ;-)

Es cierto que no hay nada que temer por navegar con linux, pero antes de 
conectarte a la red de redes deberías desactivar todos los servicios que 
arranca Linux por defecto como ssh, telnet (algunas veces lo trae por 
default), smtp, rpc, DNS, etc, etc, etc, sobre todo si tienes una conexión 
constante a internet (DSL, cable, etc).

Para saber cuáles servicios estás "ofreciendo" al exterior, abre una consola 
(no necesariamente como root) y ejecuta
$ netstat -tul

Ahí podrás ver todos los servicios que están recibiendo conexiones y será más 
fácil desactivarlos.

Por ejemplo, si ves la siguiente línea:

udp        0      0 *:domain

tienes corriendo el named o DNS. Para desactivarlo, dependiendo de tu 
distribución puedes utilizar alguna herramienta para editar el runlevel, 
utilizar algún script o eliminar los enlaces de /etc/rc?.d

Por ejemplo, en un SuSe necesitarías entrar a Yast->system->Runlevel Editor
En RedHat (por lo menos hasta la 7.3 que fué la última que utilicé) había un 
editor de runlevel (SysV editor creo que se llamaba).

Una manera más fácil de hacerlo sería crear un script de iptables que negara 
toda conexión entrante como éste (creado por Brian Hatch):

#!/bin/sh
#
# Copyright 2003, Brian Hatch, released under the GPL.
#
# Very minimalistic host firewall:
#
#   allows all outbound access
#
#   allows inbound
#          DNS replies (udp) but no other UDP packets
#          important ICMP packets (time exceeded, etc)
#          TCP packets that are responses to our outbound connections
#              (prevents inbound connections to ssh servers, active FTP, 
etc)
#
#   doesn't muck with forward chain, nor do any connection tracking, etc.
#   easy to modify to support older ipchains - replace INPUT with input,
#        and DROP with DENY

# Flush all tables
iptables -F INPUT

# Set the default policy for the INPUT chain to be 'DROP'
# which means that the packets are discarded, and no message
# is sent to the remote machine in response.
iptables -P INPUT DROP

# enable Reverse Path filtering
for interface in /proc/sys/net/ipv4/conf/*/rp_filter
  do
     echo 1> $interface
  done

# Allow unrestricted connections over the local interface
iptables -A INPUT  -i lo -j ACCEPT

# Allow tcp packets associated with established connections (and Nmap 
scans...)
iptables -A INPUT -p tcp ! --syn -j ACCEPT

# Allow all DNS replies
# This will break UDP-based streaming media protocols, etc.
iptables -A INPUT -p udp --source-port 53 -j ACCEPT

# If your machine doesn't uses BOOTP or DHCPD, comment out the following 
line
iptables -A INPUT -p udp --destination-port 68 -j ACCEPT

# Allow helpful ICMP packets.  (Feel free to remove some of these)
iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
iptables -A INPUT -p icmp --icmp-type source-quench -j ACCEPT
iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
iptables -A INPUT -p icmp --icmp-type parameter-problem -j ACCEPT
iptables -A INPUT -p icmp --icmp-type redirect -j ACCEPT
iptables -A INPUT -p icmp --icmp-type router-advertisement -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT

# If you want to see dropped packets, uncomment the following
# iptables -A INPUT -j LOG

# Yes, this is redundant since the policy is to DROP, but I'm paranoid.
iptables -A INPUT -j DROP

# Show our tables for grins.
iptables -vnL
#
# End of script.


Suerte!!

- -- 
                        Benjamín Ubach Nieto
Reality is acceptable...         |      spamfree at tutopia.com
if practiced with moderation...  |           ICQ: 66021618
Linux Registered User: 310305    | MSN: exmetallifan at hotmail.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/UlL1n/37kYXielsRAveTAJ9o/JE937BwDVdEaY5Xkt6UugYf3QCfSLkE
/+FNqnvKbghY/UushDUAG/A=
=xTLp
-----END PGP SIGNATURE-----

_______________________________________________
Ayuda mailing list
Ayuda en linux org mx
Para salir de la lista: http://mail.linux.org.mx/mailman/listinfo/ayuda/



[Hilos de Discusión] [Fecha] [Tema] [Autor]