mobile

Tadaaa, Trusty débarque dans vos téléphones…

cadenas_pont_des_arts

TL;DR. Trusty débarque dans vos téléphones, c’est un framework d’execution sécurisé, c’est cool, vos données ou les opérations sensibles de vos appli mobiles en bénéficieront. Et je vous explique ici comment, avec des mots simples – pour les gens qui ne sont pas des geeks de la sécu.

Votre mobile et la sécurité (mise en jambe du sujet). Les téléphones mobiles accueillent de plus en plus de données sensibles, relatives à notre vie personnelle, sociale et professionnelle. Si l’on a longtemps considéré que les attaques les plus courantes et coûteuses se passaient sur des systèmes informatiques centralisés, tels que des serveurs ou des systèmes IT, force est de constater que l’attention se porte maintenant, aussi, sur les téléphones mobiles. Des applications chargées sur un téléphone peuvent embarquer du code silencieux et effectuer quelques opérations inappropriées sans l’accord de l’utilisateur. La plupart des applications officielles, disponibles sur les portails d’application populaires, subissent une vérification de code. Mais il se peut que le code d’une application malveillante exploite des vulnérabilités non-encore déclarées du téléphone. Bref. Ce renforcement des attaques logicielles sur les environnements embarqués, en plus grand nombre et plus pointues a forcé les concepteurs des environnements d’exécution, tels que Apple, Google, Microsoft à renforcer encore les outils pour protéger leurs produits des attaques logicielles. Ce sont ces outils que nous vous proposons de passer en revue dans cet article.

La sécurité intrinsèque des mobiles (pour ceux qui avaient un doute). Les environnements d’exécution comportent des mécanismes qui permettent de les protéger d’un chargement trop facile d’application malicieuse. Les applications officielles sont en général signées par le fournisseur de service et/ou par fabriquant de téléphone, cette signature inclut la vérification des permissions de l’application, à savoir les librairies auxquelles cette application pourra accéder pendant son exécution. Il arrive aussi fréquemment que avant même que l’OS du téléphone boote, l’OS vérifie la légitimité de chacun de ses constituants, driver de périphérique, middleware, librairie applicative. C’est le principe du secure boot.

Les fonctions de sécurité applicative. On trouve également dans les environnements iOS, android, WindowsPhone et BlackBerry OS des fonctions, mises à disposition des développeurs d’applications, qui leur permettent de renforcer leur application. On trouve ainsi dans la dernière version de android Marshmallow, des packages tels que android.hardware.fingerprint pour gérer les empreintes digitales, android.security.keystore pour générer des clés et effectuer des opérations cryptographiques. Il s’agit donc de mettre à disposition des développeurs des outils permettant de construire un modèle de sécurité plus robuste au sein même de leurs applications. On pourra donc rajouter une authentification de l’utilisateur par la vérification d’une empreinte digitale et la transmission de contenu entre le serveur et le client, chiffré ou signé pour en assurer la confidentialité ou l’intégrité (ou pourquoi pas les deux).

Le Trusted Execution Environement (nous y voilà). Les applications mobiles, intégrant les barrières de sécurité traditionnelles peuvent être soumises à des attaques de logiciel malveillants, résidant dans le téléphone, ou à proximité. Heureusement, l’art de sécuriser les environnements embarqués et ouverts, comme les téléphones, évolue et s’adapte. Ainsi, une nouvelle sorte de technologie a fait discrètement son apparition dans la planète mobile. Il s’agit du Trusted Execution Environment (environnement d’exécution de confiance, ou TEE). Penchons-nous quelques instants sur la définition de cette technologie. Quels en sont les mérites et les spécificités ? Le TEE est une technologie qui permet de garantir qu’un code d’application soit exécuté de manière sécurisé. Plus précisément, le TEE garantit que le code et les données d’une application ne soient pas modifiables ou lisibles par une application malveillante. Ainsi, l’intégrité et la confidentialité seront respectées pour une application, stockée dans le TEE. Cette technologie est définie par un organisme de normalisation nommé GlobalPlatform. Cette organisation regroupe des entreprises et industries provenant d’horizons différents, du fabriquant de composant pour téléphone, aux assembleurs de téléphone, en passant par les fournisseurs d’application bancaire ou les opérateurs téléphoniques. Les normes techniques du TEE décrivent donc les états possibles d’une application stockée dedans, le comportement en cas de détection de problème, les différentes librairies mises à disposition pour développer des applications. GlobalPlatform définit également des tests fonctionnels, permettant de démontrer une conformité fonctionnelle. Il existe également une méthodologie pour certifier la robustesse sécuritaire des produits embarquant cette technologie. Bref, le TEE est donc un objet technologique normé et certifiable.

Le TEE dans les téléphones, un mythe ? Non. Il a fait une discrète apparition dans les environnements de téléphone depuis quelques années, pour des fonctions internes au téléphone. Ainsi iOS mentionnait depuis quelques temps déjà une technologie appelée Secure Enclave, dont les vertus ressemblaient au TEE. Samsung indiquait que sa gamme de produit Knock dédiée dans un premier temps aux applications de production ou de gestion à distance de flotte de téléphone, reposait sur une technologie de type TEE. Récemment, c’est la plateforme android qui a clarifié l’usage de cette technologie. Ainsi, au début de l’année 2016, l’environnement android marshmallow met à disposition des développeurs un accès à la technologie TEE. Cette fonctionnalité est appelée Trusty TEE. Alors, en quoi consiste cette technologie ?

Trusty TEE, qu’est ce que c’est ? Tusty TEE, apparu dans Android 6.0  est une couche logicielle offrant les services d’un TEE. Trusty est composé de trois éléments : (1) un environnement d’exécution appelé le Trusty OS, (2) des librairies internes permettant d’accéder depuis le Trusty OS aux ressources linux, de manière sécurisée et de développer ainsi des applications sécurisées, et (3) une librairie permettant depuis l’environnement dit normal, d’accéder aux applications hébergées dans le Trusty OS. Il s’agit donc d’un environnement séparé du reste du téléphone, qui abritera des applications, dites sécurisées, pouvant être accédées par  des applications du monde normal, les traditionnelles applications android.

Quels sont les cas d’usage ? En théorie, un environnement d’exécution, privilégié, protégé contre les attaques logicielles comme l’est le TEE est très attractif pour protéger des applications sensibles. Plus exactement, puisque tout ne peut pas être exécuté dans un TEE, faute de ressource, on privilégiera d’utiliser le TEE pour l’exécution de fonctions sensibles. Par exemple, une comparaison de secret, une opération cryptographique comme la génération d’une signature, le stockage de secret, … La documentation d’android fournit une liste d’exemples pertinents, que sont les applications bancaires, les applications d’authentification, de DRM (oui, pardon..) …

Comment ça marche ? En pratique, pour le moment Trusty ne permet pas le développeur lambda de charger des applications sécurisées. Ceci reste le privilège du fabriquant de téléphone, au moment où il assemble les composants et intègre son code. Ainsi on pourra imaginer des applications permettant de gérer les empreintes digitales (capture, stockage et vérification) ou des applications bancaires pré-chargées. Pour utiliser des services sécurisés par l’environnement Trusty, il faut que chaque application soit déjà chargée dans l’environnement Trusty. Une fois chargée, l’application déclare les services qu’elle offre, grâce à une déclaration de nom (sous forme de domaine inversé, par exemple « com.mabanque.payment». Ce service est alors mis à disposition des applications dites normales, tournant sur l’environnement normal, dit non sécurisé.

Comment utiliser les services offerts dans Trusty (sinon, vous pouvez aussi lire la doc). Il existe une API Client et une API Serveur, qui permettent de mettre en relation une application sécurisée avec une application du monde dit non-sécurisé. A noter qu’il est également possible pour une application sécurisée de mettre ses services à disposition d’une autre application sécurisée. Voici en résumé comment tout cela se passe. Du côté de l’API Serveur, on déclare les ports grâce à port_create(), et on écoute l’arrivée d’événements grâce à une fonction wait(). Du côté de l’API Client, on ouvre une connexion avec un port connu par le biais de la méthode connect(), on se voit attribué un numéro de canal (dit channel). Une fois la connexion acceptée par l’application sécurisée offrant le fameux service, les applications peuvent échanger des messages en utilisant l’API Messenger pour transférer ses données, grâce aux fonctions send_msg() et get_msg().  Il n’existe pas de formatage particulier attendu pour le transfert de ces données puisque elles seront spécifiques aux applications. Néanmoins, au moment de l’ouverture du port et du chanel, on pourra spécifier si on souhaite une communication avec plusieurs buffers, et/ou de manière asynchrone.

En conclusion. La technologie permettant d’exécuter des morceaux de code de manière sécurisée, garantissant confidentialité et intégrité est en expansion. Preuve en est puisqu’elle se retrouve utilisable par des développeurs d’applications mobiles. On attend maintenant avec impatience les premiers services que les fabricants de téléphone mettront à disposition dans cet environnement Trusty.

Quelques références importantes. Oui.

Normes de TEE définies à GlobalPlatform : http://globalplatform.org/specificationsdevice.asp

Documentation Trusty https://source.android.com/security/trusty/

Note :

Picture by “Un savoisien à Paris” (http://savoieinparis.over-blog.com/article-cadenas-du-pont-des-arts-57653780.html)

 

Trusted Execution Environment, millions of users have one, do you have yours?

mobile phone

I have been spending few years monitoring the development of a technology named Trusted Execution Environment in standard. Switching from a quest, to a technical concept and now starting to be embedded in devices, I felt it is time to share few things about that security enabler. At the time I discovered that strange stuff, it was just a question ‘how can we make the mobile more secure?’. That question was extensively discussed in OMTP, a dead consortium of mobile network operators and device makers. They wrote some security requirements, based on well know existing attacks on mobile environments and expected someone to solve the problem. (more…)

OWASP in Paris : Diving in Firefox OS Security !

You might have heard about it, a new mobile operating system was announced few months ago : Firefox OS, by Mozilla.This mixing of a browser product together with the ‘OS’ word is not a typo. It is a new type of operating system, web based, which will get rid of the open-but-proprietary mobile operating systems. On a web-based operating system, web apps will be the application bringing the services to the user. And Mozilla, is offering to have HTML5/CSS3 web apps running on their Firefox OS. Together with special APIs, names Web APIs that will enable some mobile-phone related features, such as access to phone call, SMS, and few other nice things.

So, yes, Firefox OS has landed in the mobile area … and its security challenges too. Imagine : a web engine, on which you execute applications, based on the web security model, which main security constraint is the single origin policy (any resource used by a web app must be from the same origin). If the ambition is really to port any kind of service on the web, including the highly sensitive ones, this imposes to have more constraints on the application and execution model. And this is what Mozilla has been integrating in their OS design and application deployment scheme. This is this nice story that Paul Theriault @creativemisuse, Mozilla Corporation, came to tell in Mozilla Paris offices this week, during a meeting organized by OWASP French Chapter. Here are the basics to remember about the Firefox OS security model :

– There will be several categories of web app : normal web apps, privileged web apps, certified web apps.

– Normal webapps are the ones with the lowest right, they can *only* use HTML5 and CSS3.

– Privileged and certified web apps are accessing the Web APIs, and will be submitted to the user permissions. The user will have to grant access when the web apps will actually access those APIs.

– Certified web apps will the ones accessing sensitives Web API, related to the mobile phone system. At the moment, certified apps are only developed by Mozilla and built in the mobile device, before going on the field. The so-preserved APIs are the ones related to TCP socket, mobile network, system XHR, alarms…

– Each web app will have dedicated cache and cookies memory.

– Web apps and browser will run in a separate thread, allowing to preserve the permissions and isolation during execution.

A video is available there, and will definitely make you better understand the main challenges that Mozilla is facing with their crazy idea to put the web on a mobile.

And, as all the activities of Mozilla are public and open to contributors, the ones interested in security aspects can stay tuned on https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security

Microsoft message to the developers…

techdays2013This week is the Paris Microsoft TechDays 2013 #mstechdays. And tuesday was the first day dedicated mainly to developers. Here is a view from a non-developer girl attending this event (in other words, an alien here).

The key message was : we love you and we want you to make money.

Microsoft and its dynamic team of francophone evangelists demonstrated during the morning session series of well calibrated messages (rolling out an average cooking scenario, but this is another story). With Microsoft platform and tools, developers were promised to be able to have cool design of applications, compatible with the multi-screen user requirements, driven by mobility today. In addition developers will benefit from easy coding of new user habits, like sharing content from an app, using touch screen in the Surface, scrolling in every direction,  easy to create. And last but not least, any language would be supported from native C++ to web, with a great re-usability of code in both cases. Consistency of the features across the different environment of Windows 8, Windows Phone 8 and Windows RT was also repeated on a regular basis. Last but not least all applications can be distributed on the Windows Store App, where a team will make sure it is compatible with the rules (no worry you can pre-test it);.

As a mobile oriented person, I was greatly interested in  the features related to mobile. Lets review some differentiators of the Windows Phone 8 platform.

A locked screen, just made for you. Locked screen of WP8 can be customized. Developers, if lucky enough to have their app chosen by the user, will be the user companion, being display as a background of the mobile screen. And MS development software enable seamless integration of the the data to be used when being elected as a locked screen.

The wallet is your chance. It is an aggregation of loyalty services and allows to directly access applications. In addition the application can embed some promotional mesage to the user and raise his attention on your super app.

Even the camera is an opportunity. The camera can easily offer the user to play with applications providing filters when he is taking picture.

Whatever is your favorite language, you can play. Web technologies were as present as old good technos. And the message was clear, make web app, make native app, make hybrid app, and we will make sure you will have visibility of our platforms.

Be innovative think NFC. The NFC technology was also promoted by the team, in the person of the only girl – Julie Knibbe @julieknibbe – who demonstrated the strength of integrated technologies with an NFC coupon transmitted from one device to another by peer to peer NFC, and was finally present into the wallet previously demonstrated.

In all cases, the simplicity of the code was amazing – well we all know that Microsoft evangelists are magicians.

A last word about security. The Microsoft solutions were promoted as highly secured. With new tools to control devices, new operating systems capabilities like the well known combination of bitlocker, secure bootloader and early antimalware, insuring integrity of the platform from a to z. But this will be detailed in later posts.

Code must also be a fun. The tradition in the tech days is to have a crazy session about codes. It is a session where evangelists are just demonstrating that any idea they think about can be easlily coded. Pushing back the limits of creativity. We had a chance to review a movie-generic a la Star Wars prepared in HTML5 and CSS3 by David Rousset @davrous, a machine to generate World-dictionnary-compatible sentences by David Catuhe @deltakosh , a fractal generator by Eric Mittelette, a super graphic application to manage form overlapping by Mitsu Furuta @mitsufu, and a joint Bluetooth/geolocalisation sandwich finder by Pierre Lagarde @pierlag and Julie Knibbe @julieknibbe. And-it-was-really-fun.

To sumup, that first developer’s day was enthusiastic, a lots of things learned, even if the continuous flow of positive messages was a bit scary – well there might be a problem somewhere, no ?

Stay tuned for other posts related to cloud, innovation, social media and obviously security…

Note to tech girls : a great advantage of being a girl in TechDays is that you never queue to go to the toilet : )

Grasping mood of the security industry during Chip to Cloud

Nice, the italian french town, with its car and boat parking lying in front of gigantic buildings, with amazing sea view. Nice with its old town and its awful modern contrast. Nice, with its World Smart Week [1], made of buzz words such as NFC, identity and cloud, held in Acropolis, offering a common exhibition area, demonstrating maturity of any-form-of-NFC solutions. An interesting initiative was conducted aside, called Université NFC des Territoires [2], allowing different french cities going NFC to share their experience and brainstorm in workshops.

I attended the Chip To Cloud Security Forum which tries every year to show a state of the art in terms of security (hardware, software), or progress on any tricky topics such as authentication (of machine, people, devices) and smart secure distributed services, including cloud. I captured this year, several interesting topics that fed the conversations during the coffee breaks.

(more…)

One day, Mobile WebApps will be Super WebApps !

A new step in the evil strategy to have the open web platform becoming the universal development framework for mobile app developers has been unveiled this summer by the World Wide Web Consortium (W3C).

Up to now ,W3C plan was to have mobile web app executed in smartphone and tablet browsers, offering features based on HTML5, CSS and some additional javascript features developed by the Device API Working Group (so called DAP for the people attending this club). Features like : network information – (how is the device connected ? 3G, 2G, Wifi…), battery status information, service discovery (is there any payment webapp on the device another webapp can use ?), vibration capability (bzzz, bzzz), management of media from the webapp … A complete list of items and corresponding specifications are publicly available on DAP wiki [1]. And in addition, if you want to follow when this will land in your favorite browsers, Dominique Hazaël-Massieux @dontcallmedom from W3C Office, is maintaining all devices and browsers implementing the standard HTML and javascript APIs [2]. Great. That was 2012 year plan roll out.

(more…)

Can I drive my smartphone safely ?

On the matter of safety, it may happen that the old and established car industry has things to teach to the young and dynamic mobile industry.

 Middle social class passengers getting into their car do not even think that their car security may be a problem. This peace of mind was not given from the beginning of this industry. We all know that first cars were dangerous. But due to citizen and governments pressure – driven by a willpower to protect lives and save national health budget – combined with automotive manufacturing collaboration – agreeing on a minimal barrier to access the safe and comfortable car market – a vehicle has now to survive several security steps, including crash tests, before being driven by a smiling father of a family (well know that only fathers are conducting in families, right ?).

(more…)