viernes, 16 de noviembre de 2012

¿Porque tenemos incidentes de seguridad?

[…pensar estratégicamente implica
que uno se imagine en los zapatos del
enemigo. Entonces es posible amagar,
tomar por sorpresa, desbordar por los
flancos. Malinterpretar al enemigo
puede conducir, en el largo plazo, a la
derrota.]

- John Berger -



Este tema tiene su historia; surgió en un reunión  donde habíamos diferentes personas con diferentes niveles de conocimientos en seguridad. Discutíamos acaloradamente los errores mas comunes con los que nos hemos enfrentado y como los superaríamos. Después de una tensa platica, coloque una pregunta en la mesa: ¿porque surgen los incidentes de seguridad? "lo acabamos de hablar, fue lo que discutimos!...", me respondían.  "No me están entendiendo, que hay detrás de eso: antes de la fase en que se dispara el proceso, antes del código inyectado en el servidor web, antes del volumen anormal de peticiones al firewall, antes de que la cuenta de root sea comprometida ¿que hay que provoque y que de cierta forma prepare el terreno a que el incidente se materialice?". Realmente no obtuve una respuesta satisfactoria por lo que aborde el tema desde un enfoque mas formal.

Partamos de la clasificación de incidentes de seguridad según cuatro entidades diferentes: SANS, NIST y US-CERT:

SANS [1]: 
.Código malicioso
.Escaneo / Mapeo de red
.Uso inapropiado de recursos
.Denegación de servicio
.Espionaje
.Engaño / Fraude

NIST [2]:
.Acceso no autorizado
.Uso inapropiado de recursos
.Denegación de servicio
.Código malicioso

US-CERT [3]:
.Ejercicios de entrenamiento
.Acceso no autorizado
.Denegación de servicio
.Código malicioso
.Uso inapropiado de recursos
.Escaneo / Intentos de acceso

Aunque lo justo seria considerar criterios varios como ENISA y Proyecto Amparo por mencionar algunos, desde mi experiencia el NIST conglomera muy bien cuatro tipos bien definidos. Una vez sabiendo bien de que hablamos, admiremos la Tabla 1 como si fuera un cuadro de Picasso...


Tabla 1. Inconvenientes de seguridad durante el SDLC.



...aunque inicialmente la tabla pareciera no estar relacionada con el tema, observamos (que de acuerdo con Gartner [4]), el Ciclo de Vida de Desarrollo de Software (SDLC, por sus siglas en ingles), los desarrollos ya son vulnerables incluso antes de introducir la primera linea de código,  es decir, desde el DISEÑO la aplicación ya es vulnerable. Los reportes de OWASP 2007[5] y 2010[6] no me dejan mentir, en el Top 10 siguen prevaleciendo vectores por de mas conocidos, aunque no nos sorprenda que el reporte del 2013 no cambie mucho.



Tabla 2. De acuerdo a OWASP, de los reportes del Top 10 del 2007 al 2010, solo dos vectores han sido mitigados y dos mas han surgido.


Ahora bien, en blogs, newsletters y foros leemos noticias relacionadas a vulnerabilidades halladas, vectores y tendencias de ataques, malware ex profeso, APT's, pero finalmente entre lineas es posible identificar un patrón común en todo ese compendio de artículos: protocolos. Pensemos en DNS, ARP, HTTP, DHCP, SIP, IPv4 e IPv6. Inicialmente, y desde su concepción y su DISEÑO, fueron pesados para cubrir una necesidad, para ser flexibles, funcionales y prácticos,  pero NO para ser seguros. Para muestra basta un botón:  ¿Porque son tan prometedores, exitosos y amenazantes los ataques basados en DDoS/DoS? ¿Cual es la debilidad? ¿El ancho de banda? ¿El protocolo TCP o UDP?  ¿El router frontera? ¿El ISP? En general, estamos pasando (desde hace tiempo), por una crisis de modelado de protocolos, incluso hay un número considerable de tesis de maestría y doctorado que tratan de resolver estas preguntas. Cierto, tenemos enfoques como los clean pipes, F5 y Arbor Networks, pero ¿Estas soluciones son realmente la panacea para este problema en especifico?
Pensemos ahora en los stacks, en el del procesador y en el de la memoria. Son conceptos y diseños de antaño que han sufrido cambios muy mínimos, que casi no han cambiado. En este caso sucede lo mismo ¿por que el buffer overflow prevalece? ¿y que sucede con el stack overflow? En el caso de este ultimo, es un ataque tan viejo como efectivo. Esto sin mencionar que las nuevas tecnologías se basan en estas arquitecturas, ambas vulnerables, lo que las hace ser implementaciones vulnerables desde su nacimiento. Me vienen a la cabeza los IP phones, los smartphones, las Smart Tv's, los autos, los marca pasos, las casas inteligentes, etc.

Para concluir (por el momento), y pensándolo un poco mejor, la pregunta inicial debería de ser: ¿Cual es la causa-raíz de los ataques que provocan los incidentes de seguridad? lo anterior nos obliga a pensar en términos de INSEGURIDAD, razón por la cual invariablemente se desprenden los planes de recuperación de desastres, los planes de contingencias y los procesos de manejo de incidentes de (IN)seguridad, pero esto ya sera tema en otra ocasión.


___________________________________________________________________________


Why we face security incidents?



[…thinking strategically involves
imagine you are in the shoes of
the foe. So, it´s posible hide,
take by surprise, overflowing the
flanks. Misreading the enemy
may lead, in the long term,
the defeat.]

- John Berger -



This topic have a background; it comes in the middle of a meeting where were people with different security knowledge and skills. We were discussing vehemently about the common issues that we face and how we overcome them. After the intense talk, I put a question over the table: Why the security incidents occurrs? "Dude, we talk about already, is just what we were discussing!...", they answered me.  "You guys don't understand, what we have behind the security incident? before we trigger the incident response process, before the injected code in the web server, before the abnormal volume of requests to the firewall, before the root account will be compromised, what produce and somehow make ready the way for materialize the security incident?". I really did not get a satisfactory answer, so I decided to address it from more formal approach.


Let's starting from the security incident clasification according four different entities: SANS, NIST y US-CERT:

SANS [1]: 
.Malicious code
.Scanning / Network map
.Inappropiate use of resources
.Denial of service
.Spionage
.Deception / Fraud

NIST [2]:
.Unauthorized access
.Inappropiate use of resources
.Denial of service
.Malicious code

US-CERT [3]:
.Training exercises
.Unauthorized access
.Denial of service
.Malicious code
.Inappropiate use of resources
.Scanning / Access attempts

Although, it's fair consider other criterias like ENISA and Proyecto Amparo just to mention a few, from my experience the NIST categorize four well defined tyes. Once we know what we talking about, let's take a look the next table like a Picasso's paint...



Table 1. Security issues during the SDLC.



...Maybe the previous table looks like don't have any relation with this topic, but (according to Gartner [4]), the Software Develoment Life Cycle (SDLC), the sotware develoments are vulnerable even before to write the first code line,  I mean from the scratch, from the application DESIGN it's already vulneable. The OWASP reports 2007[5] y 2010[6], don't let me lie, in Top 10 charts still prevail most konwn vectors. Don't will be a surprise find out the same vectors.





Table 2. According to OWASP, the Top 10 reports from 2007 and 2010, only two vectors have been mitigated and two more have emerged.




Now, in blogs, newsletters and forums we read news related to finded vulnerabilities, vector attacks and attack trends, ex profeso malware, APT's, but finally, between the reading lines it's possible  to identify a common pattern: protocols. Let's take a look on  DNS, ARP, HTTP, DHCP, SIP, IPv4 and IPv6. Initially, and from it's conception and DESIGN of each previous protocol, they were designed to cover a necessity: to be flexible, functionals and practical,  but NOT tu be secures. As the proverb says, "one example will suffice to prove it":  Why the DoS/DDoS based attacks are so promising, threatening and successful? What is the weakness? it will be the bandwidth? maybe the TCP or UDP protocols?  the edge router? the ISP? In general, we are experiencing (from a long time), a protocol modeling crisis, even exist a acceptable number of pHD and Master thesis in order to try answer this questions. Right, we count with approaches like the clean pipes, F5 and Arbor Networks, but, are these solutions, the panacea for solve this specific problem?
Now, let's think about the stacks; the processor stack and the memory stack. Both are old fashion concepts and designs with minimum changes. In this case the same happens, why the buffer overflow prevails? and what about with the stack overflow? The last one,  is as antique as effective, without mention the new technologies based on these two arqutectures, both weak, what makes them vulnerable implementations. It coming to my mind IP phones, smartphones, Smart Tv's, cars, pacemakers, smart houses, etc.

To conclude (at the moment), and thinking a little bit better, the initial question should be: Which is the root cause of the attacks that provokes the security incidents? All the adove let us think in terms of INSECURITY,  rason whereby invariably emerge the recovery disaster plans, contingency plans and the (IN)security incident response plans, but that is another set of issues.





Bibliography / Bibliografía:
[1]Northcutt, Stephen. “COMPUTER SECURITY INCIDENT HANDLING: An Action Plan for Dealing with Intrusions, Cyber-Theft, and Other Security-Related Events”. (Marzo, 2003). SANS PRESS.

[2]US-CERT, Federal Agency Incident Categories. Tomado de:
http://www.us-cert.gov/government-users/reporting-requirements.html

[3]Cichonski, Paul. Millar, Tom. Grance, Tim. Scarfone, Karen. "Special Publication 800-61: Revision 2 (Draft) Computer Security, Incident Handling Guide". (January, 2012). National Institute of Standards and Technology. Tomado de:
http://csrc.nist.gov/publications/drafts/800-61-rev2/draft-sp800-61rev2.pdf

[4]"Integrating Security Into the Application Life Cycle". (Abril, 2007). Gartner. Tomado de:
http://www.conei.sp.gov.br/soa/integrating_security_into_the_application_life_cicle.pdf

[5]"THE TEN MOST CRITICAL WEB APPLICATION SECURITY VULNERABILITIES". 2007 UPDATE". (2007). OWASP Foundation.

[6] "OWASP Top 10 - 2010: The Most Critical Web Application Security Risk". (2010). OWASP Foundation.


No hay comentarios:

Publicar un comentario