[opensuse-es] [Info] Nuevo modulo Apache, para combatir los DOS
El nuevo modulo es bajo licencia gnu, y está disponible en: http://www.zdziarski.com/projects/mod_evasive/ El articulo apareció en Linux Magazine: http://www.linux-mag.com/id/3389/ Aqui va el texto en ingles para los que no están registrados: Recent "Tech Support" articles have shown a variety of "LAMP" optimization tips, from tweaking PHP, to installing a PHP opcode cache, to ensuring MySQL is firing on all cylinders. If your Web site traffic merits these efforts, you can glean real benefits — but remember that premature optimizations is the root of all evil. Now that you have a tuned, well-trafficked site, what should you think about next? High on your list should be security. Hopefully, you've adopted the best practices for locking down your Apache and PHP installations, but beyond that, there are many Apache modules that can further bolster a hardened configuration and therefore increase uptime. One module that comes to mind is mod_security, an embeddable Web application firewall. Another is mod_evasive. Available from http://www.zdziarski.com/projects/mod_evasive/ and licensed under the GNU Public License, mod_evasive is an Apache module that provides evasive action in the event of an HTTP denial of service (DoS), distributed denial of service (DDoS), or brute force attack. mod_evasive is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, and routers. Moreover, it can report abuses via email and syslog. To detect potential problems, mod_evasive creates an internal dynamic hash table of IP Addresses and URIs and denies any single IP address if it requests the same page more than X times per Y seconds, makes more than N concurrent requests per X seconds, or makes any requests while temporarily blacklisted. If any of these conditions are met, mod_evasive sends a 403 Forbidden response (the server understood the request, but refuses to fulfill it) and stops processing the request. While refusal to comply serves to conserve bandwidth and resources, mod_evasive can only help up to the point that your bandwidth and other resources are saturated. Once a 403 is sent, the offending IP is automatically blocked for a configurable amount of time (the default is ten seconds). Additionally, you can send an email and/or run a system command to integrate the solution into your existing security infrastructure. mod_evasive can be installed statically or as a DSO module, and supports both Apache 1.3 and Apache 2.x. The README has detailed instructions for both configurations. Here, let's install mod_evasive as an Apache 2.x DSO. After you've unpacked the download, apxs makes installing as a DSO trivial. Run the following command: $ $APACHE_ROOT/bin/apxs -i -a -c mod_evasive20.c This builds the module, copies it to the appropriate directory, and loads it in your httpd.conf file using the LoadModule directive. If you restart httpd immediately after apxs, mod_evasive will run with its default settings. However, for clarity, add the following, which are all defaults, to httpd.conf. <IfModule mod_evasive> DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 </IfModule> Explicitly spelling out the defaults provides a baseline to start from. Busy sites will likely need to raise some of the defaults, specifically the DOSPageCount, DOSPageInterval, DOSSiteCount, and DOSSiteInterval directives. There is a detailed description of each directive in the README, but to summarize, the trigger for blocking is X count per Y interval. The default is to block after 2 requests for the exact same URI from the same IP in under 1 second. Once you implement mod_evasive, watch your logs extremely closely and modify your settings as necessary. You don't want to block legitimate traffic, especially if that traffic is Googlebot or some other search engine spider that can bring welcome traffic. You can easily validate your setup with the included test.pl script. If you have legitimate reasons for specific IP's to exceed your general thresholds, you can use the DOSWhitelist directive to ensure those never get blocked. Once you have things working to your satisfaction, use the DOSSystemCommand directive to run commands to integrate mod_evasive into your existing infrastructure. Any application or device that can be controlled by a script or command running on the machine you have mod_evasive installed on can be integrated in this manner. Optimization is only the first step in tuning a popular site. Protecting yourself from attacks using mod_evasive is yet another piece in the seemingly unending puzzle. --------------------------------------------------------------------- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2007-06-01 a las 08:37 -0300, Juan Erbes escribió: ...
To detect potential problems, mod_evasive creates an internal dynamic hash table of IP Addresses and URIs and denies any single IP address if it requests the same page more than X times per Y seconds, makes more than N concurrent requests per X seconds, or makes any requests while temporarily blacklisted. If any of these conditions are met, mod_evasive sends a 403 Forbidden response (the server understood the request, but refuses to fulfill it) and stops processing the request.
¿Y que pasa con los que están detrás de un proxy o un router con NAT? Sobre todo en el segundo caso harán peticiones duplicadas, triplicadas, o más. - -- Saludos Carlos E.R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFGYBMatTMYHG2NR9URAowgAJwLp2v99w/dsxzjr9ok03T03gubSQCfdDL3 dxVNW1wuc0pUPDnG2unwwuI= =nHFR -----END PGP SIGNATURE-----
Hola :) El Friday 01 June 2007, Carlos E. R. escribió:
El 2007-06-01 a las 08:37 -0300, Juan Erbes escribió:
...
To detect potential problems, mod_evasive creates an internal dynamic hash table of IP Addresses and URIs and denies any single IP address if it requests the same page more than X times per Y seconds, makes more than N concurrent requests per X seconds, or makes any requests while temporarily blacklisted. If any of these conditions are met, mod_evasive sends a 403 Forbidden response (the server understood the request, but refuses to fulfill it) and stops processing the request.
¿Y que pasa con los que están detrás de un proxy o un router con NAT? Sobre todo en el segundo caso harán peticiones duplicadas, triplicadas, o más.
El Viernes, 1 de Junio de 2007 14:37, Carlos E. R. escribió:
To detect potential problems, mod_evasive creates an internal dynamic hash table of IP Addresses and URIs and denies any single IP address if it requests the same page more than X times per Y seconds, makes more than N concurrent requests per X seconds, or makes any requests while temporarily blacklisted. If any of these conditions are met, mod_evasive sends a 403 Forbidden response (the server understood the request, but refuses to fulfill it) and stops processing the request.
¿Y que pasa con los que están detrás de un proxy o un router con NAT? Sobre todo en el segundo caso harán peticiones duplicadas, triplicadas, o más.
* Nada, que si desde esa ip se hacen mas de los X impactos en Y segundos, que le interesen al sysadmin, pues no pasa.
2007/6/1, Carlos E. R.:
¿Y que pasa con los que están detrás de un proxy o un router con NAT? Sobre todo en el segundo caso harán peticiones duplicadas, triplicadas, o más.
Que nos fastidiamos :-(. No es la primera vez que me encuentro con páginas que me dicen que mi ip ha excedido el límite de conexiones máximas permitidas y nos quedamos a dos velas. Saludos, -- Camaleón --------------------------------------------------------------------- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
El 01/06/2007 18:16:42 Camaleón escribió: noelamac> No es la primera vez que me encuentro con páginas que me dicen que mi noelamac> ip ha excedido el límite de conexiones máximas permitidas y nos noelamac> quedamos a dos velas. Eso era antes, cuando existía el proxy transparente de TimoAfónica, hace como dos o tres años que pasó a mejor vida. Afectaba a las conexiones de (T) y de todos los que subcontrataban con ellos. -- Saludos, Josep M. Queralt
El 1/06/07, Josep M. Queralt escribió:
Eso era antes, cuando existía el proxy transparente de TimoAfónica, hace como dos o tres años que pasó a mejor vida.
Afectaba a las conexiones de (T) y de todos los que subcontrataban con ellos.
Con el proxy de telefónica era día sí día no el no poder acceder a varios sitios, pero ahora también nos pasa, no tan a menudo, y en menos páginas, pero pasa. Depende de la configuración que tenga cada servidor web, pero al utilizar routers con ip fija y con nat "pos ya la hemos liao", sobre todo en páginas que ofrecen servicios de consultas (proxys, dominios, dns, ip...) y que suelen ser más estrictos. Saludos, -- Camaleón --------------------------------------------------------------------- Para dar de baja la suscripción, mande un mensaje a: opensuse-es+unsubscribe@opensuse.org Para obtener el resto de direcciones-comando, mande un mensaje a: opensuse-es+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2007-06-01 a las 19:15 +0200, Camaleón escribió:
El 1/06/07, Josep M. Queralt escribió:
Eso era antes, cuando existía el proxy transparente de TimoAfónica, hace como dos o tres años que pasó a mejor vida.
Afectaba a las conexiones de (T) y de todos los que subcontrataban con ellos.
Y afecta a todos los que estén en una empresa, también tendrán un proxy de salida.
Con el proxy de telefónica era día sí día no el no poder acceder a varios sitios, pero ahora también nos pasa, no tan a menudo, y en menos páginas, pero pasa.
Depende de la configuración que tenga cada servidor web, pero al utilizar routers con ip fija y con nat "pos ya la hemos liao", sobre todo en páginas que ofrecen servicios de consultas (proxys, dominios, dns, ip...) y que suelen ser más estrictos.
A eso me refería yo antes. Y con IPs dinámicas, como se resetea de vez en cuando, te puede tocar la IP de alguien que ha estado haciendo pirulas y la tienes armada... lo mismo que cuando estoy yo con el borrico, pierdo la IP, se la dan a otro, y a ese otro le lloverán las bofetadas, esto es, las peticiones de los cientos de clientes potenciales... - -- Saludos Carlos E.R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFGYHqstTMYHG2NR9URAuUrAJwLJcOPV9GnTfu7fI8xOn/aGBX1zgCghl8S E6b60lJ+IJjtx96yrPnNhiQ= =1Wtg -----END PGP SIGNATURE-----
participants (6)
-
Camaleón
-
Carlos E. R.
-
jose maria
-
Josep M. Queralt
-
Juan Erbes
-
Rafa Grimán