1 Sistemas de protección en Gentoo Hardened Francisco Blas Izquierdo Riera (klondike) Miembro del equipo de Gentoo Hardened
2 THE SKRIVAPÅ CASE ”A tailored software service”
3 The Service 6. Virality A free account is auto created for recipients. This way marketing is built into the app and we autoaquire customers. 1. Choose document Customer upload their own document or use an existing template. 2. Define, sign & send User defines details of signing parties, signing method and signs and/or sends document for signature through email. Logging SkrivaPå records and stores all user actions for future proof to support the legal validity of the document. 3. Process admin User can monitor if the document has been viewed, nag signatories and stop or restart the process. 4. Finalization When signed by all signatories SkrivaPå stamps the document with a digital signature to seal the doc. 5. Confirmations After digital signing the document is sent to all parties by email or by signal to integrated systems. 8. Proof extraction If a conflict cannot be resolved peacefully extra proof materials can be downloaded to strengthen the court case. 7. Archive admin The document is stored for each signatory. Users can sort and share documents and use the archive to solve conflict. The service is provided as a cloud solution (SaaS) It is a stand alone service but can also easily be integrated into other systems € = This is where we make money
4 Service solution analysis - Overview
5 Service solution analysis – Features
6 Solution: Automation “Cuts administration costs drastically” Significantly lower manual administration time by: Automated filling. Fill the details of a contract by uploading an xls. Users can do it with thousands of contract at the same time. Thus eliminating repeat work. Automated filling. Fill the details of a contract by uploading an xls. Users can do it with thousands of contract at the same time. Thus eliminating repeat work. Mass signing and sending. Sign hundreds of contracts and send by just a few clicks. Mass signing and sending. Sign hundreds of contracts and send by just a few clicks. Automated digitalization and archiving. Automated data sorting and saving makes digitalization automatic. Removes the need for retyping details back into data format. Automated digitalization and archiving. Automated data sorting and saving makes digitalization automatic. Removes the need for retyping details back into data format. Automated reminders. Lowers time needed to control and nag. Automated reminders. Lowers time needed to control and nag. Automated search. By having a simple search box it becomes efforless to browse the archive. Automated search. By having a simple search box it becomes efforless to browse the archive. Automated erase. By presetting the date of erasing old documents the revision and erase can be made in just a few minutes by reading the report and accepting the erase. Automated erase. By presetting the date of erasing old documents the revision and erase can be made in just a few minutes by reading the report and accepting the erase. Automated share. Share a folder with other user so that they automatically get updated document access. Makes work of ex. economy department more efficient. Automated share. Share a folder with other user so that they automatically get updated document access. Makes work of ex. economy department more efficient. Share 24/7. Manual admin work to share documents across organization is automated as digitalization of the documents allows them to be availiable globally 24/7. Share 24/7. Manual admin work to share documents across organization is automated as digitalization of the documents allows them to be availiable globally 24/7.
7 Solution: Digitalization “Lower the cycle time costs” Minimize cycle time by: Instant transactions Instant transactions Concurrent signing. The same document can be signed from different geographical locations at the same time. In cases of 2+ signatories or in cases where there is a secretary involved the hassle of mail chains can be removed. Concurrent signing. The same document can be signed from different geographical locations at the same time. In cases of 2+ signatories or in cases where there is a secretary involved the hassle of mail chains can be removed. Sign 24/7. Digitalization allows users to sign whenever fits them. Very useful in the case of mail chains involving busy people likely not to be reached by DHL at first try. Sign 24/7. Digitalization allows users to sign whenever fits them. Very useful in the case of mail chains involving busy people likely not to be reached by DHL at first try. Come to contract. The document is never sent out, only an invitation is sent out. Thus the document cant get lost on the way and the process doesn’t have to be restarted. Come to contract. The document is never sent out, only an invitation is sent out. Thus the document cant get lost on the way and the process doesn’t have to be restarted. Automatic reminders. User can set automatic date and time of reminders. Automatic reminders. User can set automatic date and time of reminders. Monitoring functionality. Exact and updated lists of which signatory is where in the process. This makes it easier for contract sender to monitor counterparty actions and efficiently take action. Because of the tediousness of doing this today many procrastinate and thus cycle time risk to increase. Monitoring functionality. Exact and updated lists of which signatory is where in the process. This makes it easier for contract sender to monitor counterparty actions and efficiently take action. Because of the tediousness of doing this today many procrastinate and thus cycle time risk to increase. Ease of use. To sign with SkrivaPå is very simple. Therefore less contracts are put aside to be handled later. Ease of use. To sign with SkrivaPå is very simple. Therefore less contracts are put aside to be handled later.
8 Solution: Smarter Storage “Increase control to 100%” Eliminate risk of loosing contracts by: Secure third party storage. We guarantee that we wont loose user contracts. Secure third party storage. We guarantee that we wont loose user contracts. Delete management. We make it difficult to remove contracts by accident. Delete management. We make it difficult to remove contracts by accident. Recover functionality. If your counterparty has stored their contract copy it´s still possible to retrieve the contract. Recover functionality. If your counterparty has stored their contract copy it´s still possible to retrieve the contract.
9 Solution: Smarter system “Lower system cost” Eliminate the need for multiple contract admin systems by making a system that fit all use cases: Multiple methods of verification. We offer verification at signing by e-mail, mobile, credit card, digital screen signature (ex. iPad) and e-legitimation. These different forms of verification have different strength of identification and ease of use for counterparty. By being able to use one system to choose the method of verification that best suits the specific use case the user doesn’t have to use different systems such as mail, e-mail and fax to satisfy different use cases - this includes adjustment of level of verification, ease of use and space (contracting on distance or at meeting) – thus reducing administration costs of keeping multiple systems. Multiple methods of verification. We offer verification at signing by e-mail, mobile, credit card, digital screen signature (ex. iPad) and e-legitimation. These different forms of verification have different strength of identification and ease of use for counterparty. By being able to use one system to choose the method of verification that best suits the specific use case the user doesn’t have to use different systems such as mail, e-mail and fax to satisfy different use cases - this includes adjustment of level of verification, ease of use and space (contracting on distance or at meeting) – thus reducing administration costs of keeping multiple systems. Low setup costs. The alternative to SkrivaPå is to build your own tailored system. That’s costly.* We charge much much less for setup. Low setup costs. The alternative to SkrivaPå is to build your own tailored system. That’s costly.* We charge much much less for setup. Updates included. Minimize costs of maintenance as updates and bug fixes are included in the yearly licence fee. Updates included. Minimize costs of maintenance as updates and bug fixes are included in the yearly licence fee.
10 Solution: Better Legal Infrastructure “Lower legal risk” Lower legal risk by: Third party automatic attesting. We act as a third party verifying and attesting each transaction. No extra cost or effort is required from the user, no notary or lawyers need to be booked. Third party automatic attesting. We act as a third party verifying and attesting each transaction. No extra cost or effort is required from the user, no notary or lawyers need to be booked. Third party manual attesting. As an extra security layer we also offer the possibility for the user to invite personal attestants electronically. Third party manual attesting. As an extra security layer we also offer the possibility for the user to invite personal attestants electronically. Ease of use. When its simpler to sign contracts with more secure verification technology (such as e-leg) its also more probable that the user will choose a more secure technology. Ease of use. When its simpler to sign contracts with more secure verification technology (such as e-leg) its also more probable that the user will choose a more secure technology. Proof collection and storage. We collect and securely store all transaction data to increase provability of all actions taken through SkrivaPå. Thus again we make it simpler for the user to collect good transaction proof. Proof collection and storage. We collect and securely store all transaction data to increase provability of all actions taken through SkrivaPå. Thus again we make it simpler for the user to collect good transaction proof. Recording signing location. We add an extra layer of identification to all verification technology by identifying place of signing by IP. Recording signing location. We add an extra layer of identification to all verification technology by identifying place of signing by IP.
11 ¿Qué es Gentoo Hardened? Gentoo Hardened es un projecto de Gentoo destinado a proveer opciones de seguridad avanzadas y punteras a sus usuarios.
12 ¿Por qué no es parte de Gentoo en sí? Porque las mejoras en seguridad suelen tener costes tanto en el rendimiento del sistema como en la dificultad del mantenimiento de los mismos.
13 ¿Qué sistemas de protección ofrece? ● A nivel de compilación ● -D_FORTIFY_SOURCE=2 ● SSP ● PIC/PIE ● A nivel de enlazador: ● RELRO ● BIND_NOW
14 ¿Qué sistemas de protección ofrece? ● A nivel de kernel: ● ASLR ● RANDMMAP ● RANDKSTACK ● UDEREF ● MIN_MMAP_ADDR ● Memoria no ejecutable ● Restricciones sobre mprotect ● Protección contra overflow en contadores de referencias
15 ¿Qué sistemas de protección ofrece? ● A nivel de kernel: ● Sanitización de memoria liberada ● Comprobación de límites en las transferencias entre kernel y espacio de usuario ● Denegación de escrituras en /dev/mem /dev/kmem y /dev/port ● Restricción del modo VM86 ● Desactivación de I/O privilegiada ● Eliminación de direcciones de smaps maps y stat ● Detención de explotación por fuerza bruta
16 ¿Qué sistemas de protección ofrece? ● A nivel de kernel: ● Endurecimiento de la carga automática de módulos ● Ocultación de símbolos del kernel ● Ocultación de procesos del kernel ● Restricción de /proc al usuario ● Restricciones adicionales en /proc ● Restricciones sobre sysfs y debugfs ● Restricciones de enlazado ● Restricciones en FIFOs ● Protección de particiones de sólo lectura
17 ¿Qué sistemas de protección ofrece? ● A nivel de kernel: ● Restricciones en jaulas basadas en chroot ● Forzado del limite de procesos en el exec (aparte del fork) ● Restricciones sobre dmesg ● Detención de ptraces sobre procesos no hijos ● Ejecución de código sólo en directorios confiables ● Protección mediante blackholing en TCP/UDP y protección contra ataques LAST_ACK
18 ¿Qué sistemas de protección ofrece? ● A nivel de kernel: ● Restricciones de socket ● Thread_info está fuera de la pila ● Respuesta activa frente a explotación ● Auditoría de kernel ● MACs (RBAC/SELinux)
19 Stack overflows para novatos
20
21
22
23
24 ¿Qué necesitamos? ● Clásico: ● Pila ejecutable ● Dirección de la pila ● Acceso a la dirección de retorno ● Ret2libc: ● Dirección de la función ● Acceso a la dirección de retorno
25 SSP
26 PIE/PIC Permiten la ejecución del código en posiciones independientes.
27 -D_FORTIFY_SOURCE=2 Realiza varias operaciones para detectar vulnerabilidades en tiempo de compilación y ejecución
28 ASLR y RANDMMAP Estas funciones fuerzan el uso de direcciones aleatorias en los segmentos del programa y en las direcciones de retorn del MMAP (cuando esto sea posible).
29 RANDKSTACK Aleatoriza la ubicación de la pila entre diferentes llamadas al sistema.
30 Memoria no ejecutable Permite separar código (memoria eejecutable) de datos. Hay alternativas basadas en segmentatción y en paginación.
31 Restricciones sobre mprotect Evita la introducción de código nuevo al impedir los mapeos ejecutables y escribibles.
32 Eliminación de direcciones de smaps maps y stat Estos ficheros en /proc suelen contener información sobre la ubicación de la pila o las librerías.
33 Restricción de /proc al usuario Esto hace que sólo el propietario (y si se desea un grupo) pueda acceder a información sobre los procesos en /proc
34 Detención de fuerza bruta Si un demonio aborta o recibe alguna señal peligrosa (por ejemplo SIGILL) no puede tener hijos durante 30 segundos. Adivinar el canario se vuelve más complicado. Lo mismo respecto a las direcciones de la pila.
35 RELRO y BIND_NOW RELRO marca como de sólo lectura algunas secciones críticas como las tablas GOT y PLT. BIND_NOW fuerza la carga de símbolos en el arranque de la aplicación de modo que las tablas GOT y PLT puedan marcarse completamente de sólo lectura.
36 Condiciones de carrera Algunas vulnerabilidades se basan en escribir antes que el proceso legítimo cierta información, por ejemplo una FIFO.
37 Restricciones de enlazado y FIFOs Estas restricciones impiden seguir enlaces y escribir a FIFOs que no sean propiedad del usuario en directorios escribible por todos con el bit sticky (a menos que el propietario posea el directorio también). También impide enlaces duros a ficheros que no se posean.
38 Ataques a referencias en espacio de usuario El kernel a veces hace referencias a espacio de usuario (principalmente a NULL) de forma „descontrolada” como forma de detectar bugs y valores inválidos.
39 UDEREF Imposibilita los accesos a funciones y datos en espacio de usuario.
40 MIN MMAP ADDR Imposibilita la reserva de memoria en las direcciones más bajas.
41 Infoleaks Un info leak es una vulnerabilidad que permite obtener información sobre el kernel que puede ser usada por el atacante
42 Reescritura de datos Algunas vulnerabilidades permiten escribir datos de forma arbitraria lo que puede causar cosas como una escalada de privilegios.
43 Protección contra overflows en contadores de referencias Evita que se libere memoria cuando el contador de referencias pasa al valor máximo. En vez de esto nos quedamos con un objeto no liberable.
44 Comparación de límites en usercopy El objetivo de esto es evitar que se copien más datos de los del propio tamaño del objeto.
45 Sanitización de memoria Borra las páginas de memoria liberada para evitar que otros procesos puedan leerla.
46 Obtención de información El atacante puede intentar obtener información sobre las vulnerabilidades que afectan al keernel o la ubicación de ciertos registros.
47 Restricciones de dmesg Esto impide el uso de dmesg por usuarios que no sean root.
48 Ocultación de símbolos del kernel Esto hace que kallsyms sólo pueda ser leído por root y se requiera la capacidad SYS_MODULE para acceder a dicha información.
49 Ocultación de procesos del kernel Esto permite evitar que los procesos puedan saber cuales son los hilos del núcelo.
50 Restricciones adicionales sobre /proc El sistema de archivos /proc contiene información sensible. Esto sólo permite que root pueda acceder a esta información.
51 Restricciones sobre sysfs y debugfs Esta funcionalidad evita el acceso a usuarios distintos de root a estos sistemas de ficheros.
52 Rootkits en el kernel Una vez se ha conseeguido escalar privilegios es posible insertar código malicioso en el kernel que pase desapercibido.
53 Denegación de escrituras en /dev/mem /dev/kmem y /dev/port Estos dispositivos permiten la inserción de código en el kernel.
54 Desactivar I/O privilegiada Esto deshabilita las funciones ioperm y iopl que permiten el acceso a puertos de I/O
55 Otros ataques Hasta ahora hemos visto ataques „estándar” sin embargo existen otros ataques mucho más creativos y modelados para explotar bugs de todo tipo.
56 Restricción del modo VM86 El modo VM86 es conocido por haber provocado bugs serios en la mayoría de sistemas operativos. Esta funcionalidad hace que sea necesario la capacidad de RAWIO para poder activarlo.
57 Endurecimiento de la carga automática de módulos Esto evita que procesos no privilegiados puedan cargar módulos.
58 Restricciones en las jaulas chroot Esto permite por un lado restringir acciones que pueden usarse para escapar de la jaula y por otro acceder a procesos fuera de la misma así como utilizar ciertas capabilities.
59 Thread_info está fuera de la pila Esto permite evitar la mayoría de las escaladas de privilegios pues al pasar al SLAB los accesos desde espacio de usuario son controlados con más fuerza.
60 Respuesta activa frente a explotación La explotación por parte de usuarios no privilegiados causa un baneo hasta el reinicio de los mismos de modo que no pueden usar el sistema, por otro lado si se detecta una explotación por parte de root o en una interrupción producen un kernel panic.
61 Ejecución de código sólo en directorios confiables Esto evita la inserción de nuevo código que el atacante puede usar para ejecutar exploits de forma local. Una versión extendida evita también condiciones de carrera.
62 Detención de ptrace sobre procesos no hijos Esto evita que un proceso pueda ejecutar ptrace sobre otros lo que puede ser explotado para obtener información del mismo o modificar su memoria.
63 Forzado del límite de procesos en el exec Esto permite evitar cierto tipo de fork bombs.
64 Protección mediante blackholing en TCP/UDP y protección contra ataques LAST_ACK Esto se evita simplemente eliminando el estado LAST_ACK y evitando responder a paquetes no esperados.
65 Protecciones tras el ataque Algunas protecciones evitan los ataques después de que ocurran restringiendo lo que el atacante puede hacer.
66 Restricciones de socket Evitan que ciertos usuarios puedan abrir sockets en modo cliente servidor u ambos.
67 Auditoría de kernel Permite registrar las acciones realizadas por un grupo de usuarios o por todos ellos.
68 MACs Las MACs permiten restringir las acciones disponibles incluso para root.
69 Restricción de particiones de sólo lectura Una vez activada impide que se monten nuevas particiones con permisos de escritura (o se remonten) y las escrituras a los dispositivos de bloques.
70 Gracias por atender Contacto: klondike ( e n ) xiscosoft.es Material: http://klondike.xiscosoft.es/charlas/Hardened Webs de interés: http://www.gentoo.org/proj/en/hardened/http://pax.grsecurity.net/docs/