linux kernel hardening - bugcon 2013
DESCRIPTION
Slides for BugCON 2013 Security ConferencesTRANSCRIPT
![Page 1: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/1.jpg)
Linux Kernel Hardening
Alvaro Soto ( @alsotoes )http://headup.ws - [email protected]
Friday, February 15, 13
![Page 2: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/2.jpg)
Alvaro que?
• Developer
• Infraestructura // Arquitecturas OpenSource
• Hardening & Tuning geek... freak
• Linux (Gentoo Lover)
• Kernel Vanilla Sources
Friday, February 15, 13
![Page 3: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/3.jpg)
• Por triste que suene... el Kernel de Linux no posee herramientas contra muchos tipos de ataques.
• En cuanto a la memoria, por defecto deja hacer lo que se antoje.
• Y en controles de acceso DAC estrictamente no cuenta como esquema de seguridad... avanzado
Por que hardening al Kernel ?
Friday, February 15, 13
![Page 4: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/4.jpg)
Estatus de vulnerabilidades
Integer Overflows
Buffer Overflows
Race/tmpfiles
Race/non-tmpfiles
Bad malformed data handling
Lack of environment checks
Generic bugs and bad design
Kernel/Generic
Kernel/Buffer Overflow
0 12.50 25.00 37.50 50.00
USN AnalysisFriday, February 15, 13
![Page 5: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/5.jpg)
Entonces:
¿ Es seguro el Kernel de Linux ?¿ Que tan seguro es ?
Friday, February 15, 13
![Page 6: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/6.jpg)
Entonces:
¿ Se puede asegurar ?¿ Que tanto ?
Friday, February 15, 13
![Page 7: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/7.jpg)
Estatus de vulnerabilidades
Integer Overflows
Buffer Overflows
Race/tmpfiles
Race/non-tmpfiles
Bad malformed data handling
Lack of environment checks
Generic bugs and bad design
Kernel/Generic
Kernel/Buffer Overflow
0 12.50 25.00 37.50 50.00
USN AnalysisFriday, February 15, 13
![Page 8: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/8.jpg)
Contra que necesitamos protección?
?Friday, February 15, 13
![Page 9: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/9.jpg)
Contra que necesitamos protección?
Friday, February 15, 13
![Page 10: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/10.jpg)
Contra que necesitamos protección?
Friday, February 15, 13
![Page 11: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/11.jpg)
Contra que necesitamos protección?
• Controles de acceso
• DAC v/s MAC..... no mas chmod 777 a todo lo que se pueda.
• El usuario root es omnipotente.
• Memoria.
• Modificación del address space.
• Ejecución de codigo arbitrario.
• Filesystem.
• Races (tmp races).
• chroot
Friday, February 15, 13
![Page 12: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/12.jpg)
Condideraciones “básicas”
• De bajo a alto nivel.
• Configurar cada rincón del sistema.
• Estándares y politicas de seguridad.
• Instalar parches de seguridad continuamente.
• Auditar cada acción del sistema.
Friday, February 15, 13
![Page 13: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/13.jpg)
RTFMFriday, February 15, 13
![Page 14: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/14.jpg)
DAC v/s MAC
Friday, February 15, 13
![Page 15: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/15.jpg)
DAC v/s MAC
• Usuarios no pueden cambiar sus politicas de seguridad.
• Se puede separar el espacio de trabajo de los usuarios con distintos contextos.
• Politicas muy bien definidas:
• Usuarios, archivos, directorios
• Memory, Sockets, tcp/udp ports... etc., etc.
Friday, February 15, 13
![Page 16: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/16.jpg)
Memory Protection
• DEP (Data execution prevention).
• Se divide la memoria en ejecutable y lectura.
• ASLR (Address space layout randomization).
• Tareas del kernel.
• Posición de las librerias.
• Tareas del usuario (userland stack).
• UNA VIOLACION DE ALGUNA DE ESTAS POLITICAS PRODUCE QUE EL KERNEL MATE EL PROCESO, CAMBIANDO UN POSIBLE ACCESO POR UN DOS.
Friday, February 15, 13
![Page 17: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/17.jpg)
GRSecurity & PAX
V/S
SELinux
Friday, February 15, 13
![Page 18: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/18.jpg)
GRSecurity & PAX
• Control de acceso Mandatorio por medio de RBAC definidas en ACL.
• Generación automatica de reglas.
• Proteccion del filesystem con bloqueos de:
• chroot
• mount
• mknod
Friday, February 15, 13
![Page 19: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/19.jpg)
SELinux
• Un ejemplo de Mandatory Access Control para Linux.
• Etiquetar todo a lo que necesita aplicar una politica.
• user:role:type:level(opcional)
• Comandos con argumentos extendidos ----->>>> -Z
• ls -Z
• id -Z
• ps -Z
• netstat -Z
Friday, February 15, 13
![Page 20: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/20.jpg)
Preguntas ????
Friday, February 15, 13
![Page 21: Linux Kernel Hardening - BugCON 2013](https://reader033.vdocuments.us/reader033/viewer/2022052505/55614edfd8b42a857d8b4d5a/html5/thumbnails/21.jpg)
GRACIAS !!!!!
Friday, February 15, 13