PF Firewall

Víctor Pasten V. victor en aciertonet.com
Mie Sep 10 10:25:21 CLT 2003


Claro que apunta para otro lado, el capitulo "Dinamics Rulesets" se refiere
puntualmente a mantener configuraciones dinámicas de las reglas utilizando
macros, anchors, tables, y todos los valores que estos puedan
almacenar/manejar segun scripts o shells que el administrador cree, es
decir, hay que saber harto s.o y de sus herramientas de networking, un
ejemplo puede ser:

tenemos un IDS que detecta un hosts que está realizando algun tipo de
tráfico extraño, entonces al tener la IP de este host, mediante shell creado
por el admin le pase este valor al set de reglas (mediante un tables por
ejemplo) para que el fw bote cualquier intento de conexión proveniente de la
IP que le paso el IDS.

Bueno en realidad el capitulo te explica lo que puedes hacer, pero quizás le
falto un ejemplo real, con la shell y todo el monito.

Aqui va un trozo de texto del capitulo:

".... more flexible solutions are those designed to react to dynamic,
unpredictable events. These events can be friendly o unfriendly. A friendly
event could be an attemp by one of the authorized users to log on the
firewall authentication herself/himself , Such solutions are described in
chapter12, Using authpf. An unfriendly event could be a port scan done on
your firewall by the attacker looking for a way into your network. If such
attempt was registered by your NIDS, the IP address of such host colud be
automatically added to the list of banned hosts, from wich all connections
are blocked. such actions could be done automatically, without human
intervention.

Both kinds of automation require custom solutions as this territory is
largely uncharted. Since each firewall is different, administrators write
their own scripts that perform such tasks. Readers interested in building
such solutions ought to have a good working knowledge of Unix an the
following features of pf(4):

- the (interface) notation: ej: $ext_if=ne3
- Macros (described in chapter 5)
....


For example, if you wanted to write a script that automatically switches
from one interface to another in the event of a failure of the first
interface, your script could call ping(1) with the -I option to force pings
trouhg separate intefaces, and when the results are different than 0, your
script would call route(8) to change the default route. Then, the script
would call pfctl(8) to redefine the macro that stores tha names of the
external interface and the macro that stores the address of the interfaces,
e.g:
pfctl -D ext_if=ne2
pfctl -D ´ext_ad=192.168.25.34´        "


bueno, ahí va una muestra.




----- Original Message -----
From: "INF. Jefe Div. Ingenieria (Enrique Maldonado)"
<enrique en directemar.cl>
To: <bsd en inf.utfsm.cl>
Sent: Wednesday, September 10, 2003 8:23 AM
Subject: RE: PF Firewall


> Puede ser, pero el libro también tiene un capitulo para authpf, por lo que
> se podría esperar algo distinto.....
>
> Enrique Maldonado
>
> > -----Mensaje original-----
> > De: Rodrigo Cuevas A. [mailto:rcuevas en netbsd.cl]
> > Enviado el: Tuesday, September 09, 2003 19:14
> > Para: bsd en inf.utfsm.cl
> > Asunto: RE: PF Firewall
> >
> >
> > Quoting "INF. Jefe Div. Ingenieria (Enrique Maldonado)"
> > <enrique en directemar.cl>:
> >
> > > yo he estado tentado por comprarlo, pero me gustaría antes
> > escuchar algún
> > > comentario de alguien que lo tenga primero, mira que el
> > índice se ve muy
> > > bien, pero quizá en las 200 paginas no se alcance a entrar en muchos
> > > detalles.
> > >
> > > Viendo en el índice, el capitulo 9 habla de reglas
> > dinámicas, podrías leer
> > > de que se trata y nos cuentas ;)
> > >
> > > Saludos,
> > >
> > > Enrique Maldonado
> > >
> > > > --
> >
> >
> > se referira al authpf?
> > que permite autenticar conexiones, o sea fijar reglas por
> > autenticacion,
> > que obviamente es una forma de setear reglas de forma dinamica...
> >
> >
> > --
> > Rodrigo Cuevas A.
> >