Ver la versión completa : Mas Unix
Alguien sabe como filtrar el ssh a traves del tcp-wrappers?
Mirando en el librillo (http://www.absolutebsd.com/) hay que activar primero tcp-wrappers y luego hay que poner la lista de clientes y servidores.
Para activar tcp-wrapper se cambia la configuracion de inetd en /etc/rc.conf ( en BSD se pone inetd_flags="-Ww" ). Luego creas la lista de servicios y clientes en /etc/host.allow con un formato del tipo servicio:cliente:opcion en la parte servidor, y del tipo servicio:direccion de host::accion. Por ejemplo en la parte servidor pon una linea sshd:all:allow y una linea cliente como sshd:haX0r.com:deny.
Lo ideal seria que miraras un libro para ver todas las opciones posibles ( twist, spawn, paranoid, ...) aunque hay una pequeña explicacion de algunas en el manual de FreeBSD (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/tcpwrappers.html).
Mirando en el librillo (http://www.absolutebsd.com/) hay que activar primero tcp-wrappers y luego hay que poner la lista de clientes y servidores.
Nada, al final no ha habido manera. El problema (despues de mucho darle vueltas) es que en el Unix que intento configurar (un Alphaserver con un Tru64) el ssh no puede configurarse de ninguna forma a traves del inetd.conf o equivalente. Despues de mucho dejarme los cuernos consegui contactar con el servicio tecnico y me dijeron que intentarian solucionarlo en la siguiente tanda de patchs. Amos, que nada de nada...
Una solucion seria filtrar los IPs entrantes directamente a traves de la tarjeta ethernet, pero creo que no tengo tanto buen humor :lol:
Despues de mucho dejarme los cuernos consegui contactar con el servicio tecnico y me dijeron que intentarian solucionarlo en la siguiente tanda de patchs. Amos, que nada de nada...
Una solucion seria filtrar los IPs entrantes directamente a traves de la tarjeta ethernet, pero creo que no tengo tanto buen humor :lol:
Como decia el autor del libro de BSD "no sirve de nada pagar a un servicio tecnico que sabe menos que tu". El tcp-wrapper, ipfilter y demas son herramientas propias de BSD por lo que tendrias que instalarlas buscando los tar, en vez de formar parte del sistema base (como en BSD).
Segun el manual de buenas practicas de Tru64:
19 Install IP filter or TCPwrappers if you need to get strict control of network access
19. Install kernel-level packetfiltering or IP filter and for other services, use TCPwrappers to get control of network access.
19.1. Kernel-level packetfiltering
19.1.1. Edit /usr/sys/conf/MACHINENAME, in the options list add: options PACKETFILTER
19.1.2. Recompile the kernel with # doconfig –c
19.1.3. Save the old kernel aside and copy the new kernel to the root directory
19.1.4. Create the packetfilter devices: # cd /dev ; ./MAKEDEV pfilt
19.1.5. Set the network card to auto-negotiate for the correct speed and duplexing in /etc/inet.local
19.1.6. Set the interface to filter in /etc/rc.config: in the line where you specify the IP of the interface and netmask, add the word “filter” as the last argument
19.1.7. Create a file, /etc/ifaccess.conf, see “# man 4 ifaccess.conf” for more informatoin, but you can start with a file like:
# deny localhost, allow from 128.95.150.0/24 subnet, deny and log everyone else
ee0 127.0.0.1 255.255.255.255 deny
ee0 128.95.150.0 255.255.255.0 permit
ee0 0.0.0.0 255.255.255.255 deny log
19.1.8. Reboot the machine and test the filtering: pfconfig to reconfigure packetfiltering, pfstat to get packetfiltering statistics.
19.2. IP Filter (alternative)
19.2.1. If you need to get strict control of network access, install IP filter.
19.2.2. You can get IP filter from ftp://coombs.anu.edu.au/pub/net/ip-filter
19.2.3. Read the INSTALL and README file to learn how to use it
19.3. TCP wrapper
19.3.1. TCP wrappers (ftp://ftp.porcupine.org/pub/security) can control the ways the available network services are accessed by configuring the following files
19.3.1.1. /etc/hosts.deny
19.3.1.2. /etc/hosts.allow
Powered by vBulletin® Version 4.1.6 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.