Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Introducción a la seguridad de Firefox OS

Este documento proporciona una visión general del marco de trabajo de seguridad del sistema operativo de Mozilla Firefox OS, que está diseñado para proteger los dispositivos móviles de las amenazas a la plataforma, aplicaciones y datos. En Firefox OS, Mozilla ha implementado un modelo exhaustivo, integrado y de múltiples capas de seguridad que ofrece una protección mejor frente a los riesgos de seguridad en los teléfonos móviles.

Seguridad de la plataforma

Firefox OS en su plataforma utiliza un modelo de seguridad de varias capas que esta diseñado para reducir los riesgos de seguridad en todos los niveles. Contramedidas de primera línea se combinan con una estrategia de defensa en profundidad que proporciona protección completa contra amenazas.

Arquitectura de la seguridad

Firefox OS conecta las aplicaciones basadas en la web con el hardware subyacente. Se trata de una pila de tecnologías integradas que consiste en los siguientes niveles:

Mobile device es el teléfono móvil ejecutando Firefox OS. Gonk consiste en el kernel de Linux, las librerías del sistema, el firmware y los controladores del dispositivo. Gecko es la capa de tiempo de ejecución de aplicaciones que proporciona el marco de trabajo para la ejecución de aplicaciones, e implementa las API Web que se usan para acceder a las funciones del dispositivo móvil. Gaia es la colección de aplicaciones web que conforman la experiencia de usuario (aplicaciones que contienen desde HTML5, CSS, JavaScript, imágenes, medios, y así sucesivamente).

Gecko es el portero que hace cumplir las políticas de seguridad diseñadas para proteger el dispositivo móvil de un mal uso. La Capa Gecko actúa como intermediario entre las aplicaciones web (en la capa Gaia) y el teléfono. Gonk le ofrece las características del hardware del teléfono móvil directamente a la capa Gecko . Las aplicaciones web acceden a las funcionalidades del teléfono móvil sólo a través de las API Web, y sólo si Gecko permite la petición de acceso, no hay accesos directos ni "puertas traseras" en el teléfono. Gecko aplica los permisos e impide el acceso a las solicitudes no autorizadas.

Implementación del sistema de seguridad

Firefox OS viene instalado en el teléfono inteligente. la imagen original del sistema es creada por un conocido, una fuente de confianza que por lo general es el OEM del dispositivo, el cuál es responsable de ensamblar, construir, probar y firmar digitalmente el paquete que se distribuye.

Las medidas de seguridad se utilizan en toda la pila de tecnologías. Los privilegios del sistema de archivos son impuestas por las listas del control de acceso de Linux`s (ACLs). Las aplicaciones del sistema se instalan en un volumen que es de solo lectura (excepto durante las actualizaciones, donde es temporalmente tienen lectura y escritura ). Sólo las áreas que contienen los datos de usuario son de lectura y escritura. Varios componentes del hardware del dispositivo tiene una función de protección que se aplican de forma predeterminada como la práctica estándar de la industria. Los fabricantes de Chipset, por ejemplo, emplean técnicas de endurecimiento para reducir las vulnerabilidades. El núcleo de la plataforma (Gecko and Gonk) se endurece para reforzar su defensa contra las amenazas potenciales, utilizándose en su caso las características de endurecimiento del compilador. Para más detalles ver Seguridad en tiempo de ejecución.

Actualizaciones seguras del sistema

Las actualizaciones y parches a la plataforma Firefox OS se implementan usando un proceso seguro de Mozilla que asegura la integridad de la imagen del sistema en el teléfono móvil. La actualización es creada por un conocido, una fuente de confianza que por lo general es el OEM del dispositivo, el cuál es responsable de ensamblar, construir, probar y firmar digitalmente el paquete que se distribuye.

Las actualizaciones del sistema pueden incluir la totalidad o una parte de la pila de Firefox OS. Si cambios en Gonk son incluidos en la actualización, entonces FOTA (Firmware sobre el aire ) es el proceso de instalación utilizado. La actualización por FOTA puede incluir cualquier otra parte de la pila de Firefox OS, incluyendo la gestión del dispositivo(FOTA, firmware / drivers), gestión de la configuración(configuraciones de Firefox OS), actualizaciones de seguridad, Gaia, Gecko y otros parches.

Actualizaciones que no involucren a Gonk pueden hacerse usando la utilidad de actualización de sistemas de Mozilla. Firefox OS utiliza el mismo marco de trabajo de actualizaciones, los procesos y el formato de archivos de Mozilla (MAR)  (usado para actualizar los paquetes) como el producto Firefox para Escritorio. Para más información, consulte https://wiki.mozilla.org/Software_Update.

Al integrar el servicio de actualización que puede ser proporcionado por el fabricante, en el teléfono móvil comprueba periódicamente si hay actualizaciones del sistema. Una vez que un paquete del sistema esta disponible y es detectado por el servicio de actualizaciones, se solicita al usuario que confirme la actualización. Antes de instalar las actualizaciones en dispositivo móvil, se comprueba que haya suficiente espacio para aplicar la actualización y la distribución se verifica para:

  • Origen de las actualizaciones (verifica la ubicación de la fuente (protocolo:dominio:puerto) de la actualización del sistema y el manifiesto)
  • Integridad del archivo (SHA-256 verificación del hash)
  • Firma del código (ver certificado contra una raíz de confianza)

Las siguientes medidas de seguridad son utilizadas durante el proceso de actualización:

  • Mozilla recomienda y espera que las actualizaciones sean a través de una conexión SSL.
  • Se requiere una fuerte verificación de criptografía antes de instalar un paquete de firmware.
  • La actualización completa debe ser descargada en una ubicación específica y segura antes de que comience el proceso de actualización.
  • El sistema debe estar en un estado seguro cuando se inicia el proceso de actualización, sin aplicaciones web en ejecución.
  • Las claves deben ser almacenadas en una ubicación segura en el dispositivo.

Rigurosas comprobaciones se llevan a cabo para asegurar que la actualización es aplicada correctamente en teléfono móvil.

Seguridad en aplicaciones

Firefox OS utiliza una estrategia de seguridad de tipo defensa en profundidad apara proteger el teléfono móvil de las aplicaciones intrusivas o maliciosos. Esta estrategia cuenta con una variedad de mecanismos, incluyendo los niveles de permisos implícitos basados en un modelo de aplicaciones de confianza, la ejecución de recinto de seguridad en tiempo de ejecución, únicamente acceso al hardware subyacente teléfono móvil a través del API, un modelo de permisos robusto y seguridad en la instalación y los procesos de actualización. Para obtener información técnica, consulte: Seguridad de las aplicaciones.

En Firefox OS, todas las aplicaciones son aplicaciones web - programas escritos utilizando HTML5, JavaScript, CSS, media y otras tecnologías web abiertas (las páginas que se ejecutan en el navegador no se conocen como aplicaciones Web en este contexto). Porque no hay binario ("nativo") las aplicaciones instaladas por el usuario, todo acceso al sistema está mediada estrictamente a través de las API Web. Incluso el acceso al sistema de archivos es sólo a través de las API de Web y una base de datos SQLite de fondo - no hay acceso directo desde las aplicaciones a los archivos almacenados en la tarjeta SD.

Firefox OS limita y hace cumplir el ámbito de los recursos que pueden ser accedidos o utilizados por una aplicación, mientras que también apoya una amplia gama de aplicaciones con diferentes niveles de permisos. Mozilla implementa controles estrictos sobre qué tipo de aplicaciones pueden acceder a qué APIs. Por ejemplo, sólo las aplicaciones certificadas (se suministran con el teléfono) pueden tener acceso a la API de telefonía. La aplicación Marcador tiene privilegios para acceder a la API de telefonía para hacer llamadas telefónicas, pero no todas las aplicaciones certificadas se puede acceder a esta API. Esto evita que un escenario, por ejemplo, en el que se instala una aplicación de terceros arbitraria, marca un número de teléfono de pago por uso (900 y 910), y por debajo te consume gran cantidad del saldo del teléfono celular. Sin embargo, otras aplicaciones OEM pueden darse de forma selectiva el acceso a la API de telefonía. Por ejemplo, un operador podría proporcionar una aplicación de gestión de sistemas que permite a los clientes administrar su cuenta, incluyendo la posibilidad de llamar a la facturación del operador o de la oficina de apoyo directamente.

Aplicaciones confiables y no confiables

Firefox OS clasifica las aplicaciones de acuerdo a los siguientes tipos:

Tipo

Nivel de confianza

Descripción

Certificadas

Altamente confiable

Aplicaciones del sistema que han sido aprobadas por el operador o el OEM (debido al riesgo de corrupción para el dispositivo o riesgo para las funcionalidades críticas). Aplicaciones y servicios del sistema solamente, no destinadas a aplicaciones de terceros.
Esta designación se reserva para sólo un pequeño número de aplicaciones críticas. Ejemplos: SMS, Bluetooth, cámara, reloj del sistema, la telefonía y el marcador por defecto (para garantizar que los servicios de emergencia siempre están accesibles).

Privilegiadas

Confiables

Aplicaciones de terceros que han sido revisados, aprobados y firmados digitalmente por un mercado autorizado.

Web (todo lo demás)

No confiables

Contenido web regular. Incluye tanto las aplicaciones instaladas (almacenadas en el teléfono móvil) y las aplicaciones de servidor (almacenados remotamente, con sólo un archivo de manifiesto de aplicación almacenada en el teléfono móvil). El manifiesto para aplicaciones de servidor se puede obtener a través de un mercado de aplicaciones.

El nivel de confianza de una aplicación determina, en parte, su capacidad para acceder a la funcionalidades en el teléfono móvil.

  • Las aplicaciones certificadas tienen permiso para la mayoría de operaciones de la API Web
  • Las aplicaciones privilegiadas tienen permisos a un subconjunto de las operaciones de la API Web accesibles para las aplicaciones certificadas.
  • Las aplicaciones no confiables tienen permisos para un subconjunto de las operaciones de la API Web accesibles para las aplicaciones con privilegios. Estas son sólo las APIs Web que contiene suficientes medidas de mitigación de seguridad para estar expuesta a contenido web que no se confía.

Algunas operaciones, como el acceso a la red, se supone de un permiso implícito para todas las aplicaciones. En general, cuanto más sensible es la operación (por ejemplo, marcar un número de teléfono o el acceso a la lista de contactos), mayor es el nivel de confianza requerido en la aplicación para ejecutarla.

Principle of Least Permissions

For web apps, the Firefox OS security framework follows the principle of least permissions: start with the absolute minimum permissions, then selectively grant additional privileges only when required and reasonable. By default, an app starts with very low permissions, which is comparable to untrusted web content. If the app makes Web API calls that require additional permissions, it must enumerate these additional permissions in its manifest (described later in this document). Gecko will consider granting Web API access to an application only if the applicable privileges are explicitly requested in its manifest. Gecko will grant the requested permission only if the type of the Web App (certified, trusted, or web) is sufficiently qualified for access.

Review Process for Privileged Apps in the Marketplace

In order for an app to become privileged, the app provider must submit it for consideration to an authorized Marketplace. The Marketplace subjects the app to a rigorous code review process: verifying its authenticity and integrity, ensuring that requested permissions are used for the purposes stated (in the permission rationale), verifying that the use of implicit permissions is appropriate, and validating that any interfaces between privileged app content and unprivileged external content have the appropriate mitigations to prevent elevation of privilege attacks. The Marketplace has the responsibility to ensure that the web app will not behave maliciously with the permissions that it is granted.

After an app passes this review, it is approved for use, its app manifest is digitally signed by the Marketplace, and it is made available for mobile users to download. The signature ensures that, if the web store were somehow hacked, the hacker could not get away with installing arbitrary content or malicious code on users’ phones. Due to this vetting process, Firefox OS gives privileged apps obtained from a Marketplace a higher degree of trust than everyday (untrusted) web content.

Packaged and Hosted Apps

Apps for Firefox OS can be either packaged (stored on the mobile phone) or hosted (stored on a remote web server, with just a manifest stored on the mobile phone). There are some differences in the way in which security is managed for each. Nonetheless, packaged and hosted apps are both subject to application sandboxing, which is described later in this document.

Packaged Apps

A packaged app consists of a ZIP file containing application resources (HTML5, CSS, JavaScript, images, media), as well as a manifest that provides an explicit list of assets and their corresponding hashes. Certified and privileged apps must be packaged apps because the app manifest needs to be digitally signed. When a user obtains a packaged app, the ZIP file is downloaded onto the mobile phone, and the manifest is read from a known location inside the ZIP file. During the install process, app assets are verified and remain stored locally in the package. All explicit permissions are requested at runtime, showing the user the app's data usage intentions, and persisted by default.

To refer to app resources in a packaged app, the URL begins with app: using the following format:

app://identifier/path_within_zipfile/file.html

where app:// represents the mount point for the ZIP file, and identifier is a UUID that is generated when the app is installed on the mobile phone. This mechanism ensures that resources referred to with an app: URL are contained in the ZIP file. The path within an app: is relative, so relative links to resources in the ZIP file are allowed.

While packaged apps are primarily intended to be used for Certified or Privileged apps, regular web apps can also be packaged. However, they do not gain any increase in trust or permissions access simply because they are packaged.

Hosted Apps

Hosted apps are located on a web server and loaded via HTTP. Only the app manifest is stored on the mobile phone. Everything else is stored remotely. Certain APIs are available only to privileged and certified apps, which requires the app to be packaged due to signing requirements. Therefore, a hosted app will not have access to any of the Web APIs operations that require privileged or certified app status.

From a security point of view, hosted apps work very much like normal websites. A hosted app is loaded by invoking a hard-coded, fully-qualified URL that points to the startup page in the root directory of the app on that web server. Once a hosted app is loaded, the mobile phone links to pages using the same URLs that are used when browsing the web site.

App Manifest

An Open Web App manifest contains information that a Web browser needs in order to interact with an app. A manifest is a JSON file with (at a minimum) a name and description for the app. For further details, refer to FAQs about app manifests.

Example Manifest

The following code listing shows an example manifest with just basic settings:

{
  "name": "My App",
  "description": "My elevator pitch goes here",
  "launch_path": "/",
  "icons": {
    "128": "/img/icon-128.png"
  },
  "developer": {
    "name": "Your name or organization",
    "url": "https://your-homepage-here.org"
  },
  "default_locale": "en"
}

Security Settings in the App Manifest

The manifest can also contain other settings, including the following security settings:

Field

Description

permissions

Permissions required by the app. An app must list every Web API it intends to use that requires user permission. Most permissions make sense for privileged apps or certified apps, but not for hosted apps. Properties per API:

  • description - A string specifying the intent behind requesting use of this API. Required.
  • access - A string specifying the type of access required for the permission. Implicit permissions are granted at install time. Required for only a few APIs. Accepted values: read, readwrite, readcreate, and createonly.

installs_allowed_from

Origin of the app. Array of origins (scheme+unique hostname) that are allowed to trigger installation of this app. Allows app providers to restrict installs from only an authorized Marketplace (such as https://marketplace.firefox.com/).

csp

Content Security Policy (CSP). Applied to all pages loaded in the app. Used to harden the app against bugs that would allow an attacker to inject code into the app. If unspecified, privileged and certified apps have system-defined defaults. Syntax:
https://developer.mozilla.org/en-US/docs/Apps/Manifest#csp

Note that this directive can only increase the CSP applied. You cannot use it, for example, to reduce the CSP applied to a privileged App.

type

Type of application (web, privileged, or certified).

Firefox OS requires that the manifest be served with a specific mime-type ("application/x-web-app-manifest+json") and from the same fully-qualified host name (origin) from which the app is served. This restriction is relaxed when the manifest app (and thus the app manifest) is same-origin with the page that requested the app to be installed. This mechanism is used to ensure that it's not possible to trick a website into hosting an application manifest.

Sandboxed Execution

This section describes application and execution sandboxes.

Application Sandbox

The Firefox OS security framework uses sandboxing as a defense-in-depth strategy to mitigate risks and protect the mobile phone, platform, and data. Sandboxing is a way of putting boundaries and restrictions around an app during run-time execution. Each app runs in its own worker space and it has access only to the Web APIs and the data it is permitted to access, as well as the resources associated with that worker space (IndexedDB databases, cookies, offline storage, and so on). For details, see https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Security/Security_model.

The following figure provides an overview of this security model.

By isolating each app, its impact is contained within its own worker space. It cannot interfere with anything (such as other apps or their data) outside of that worker space.

Execution Sandbox

B2G (Gecko) runs in a highly-privileged system process that has access to hardware features in the mobile phone. At run-time, each app runs inside an execution environment that is a child process of the B2G system process. Each child process has a restricted set of OS privileges – for example, a child process cannot directly read or write arbitrary files on the file system. Privileged access is provided through Web APIs, which are mediated by the parent B2G process. The parent ensures that, when a child process requests a privileged API, it has the necessary permission to perform this action.

Apps communicate only with the B2G core process, not with other processes or apps. Apps do not run independently of B2G, nor can apps open each other. The only “communication” between apps is indirect (for example, when a listener process detects an event generated by some other process), and is mediated through the B2G process.

Hardware Access Only via the Web API

Web apps have only one entry point to access mobile phone functionality: the Firefox OS Web APIs, which are implemented in Gecko. Gecko provides the sole gateway to the mobile device and underlying services. The only way to access device hardware functionality is to make a Web API call. There is no “native” API and there are no other routes (no “back doors”) to bypass this mechanism and interact directly with the hardware or penetrate into low-level software layer.

Security Infrastructure

The following figure shows the components of this security framework:

  • Permission Manager: Gateway to accessing functionality in the Web API, which is the only access to the underlying hardware.
  • Access Control List: Matrix of roles and permissions required to access Web API functionality.
  • Credential Validation: Authentication of apps/users.
  • Permissions Store: Set of privileges required to access Web API functionality.

Permissions Management and Enforcement

Firefox OS security is designed to verify and enforce the permissions granted to web apps.
The system grants a particular permission to an app only if the content requests it, and only if it has the appropriate permissions requested in the app’s manifest. Some permissions require further authorization from the user, who is prompted to grant permission (as in the case of an app requesting access to the user’s current location). This app-centric framework provides more granular control over permissions than traditional role-centric approaches (in which individual roles are each assigned a set of permissions).

A given Web API has a set of actions and listeners. Each Web API has a required level of permission. Every time a Web API is called, Gecko checks permission requirements (role lookup) based on:

  • permissions associated with calling app (as specified in the manifest and based on the app type)
  • permissions required to execute the requested operation (Web API call)

If the request does not meet the permission criteria, then Gecko rejects the request. For example, untrusted apps cannot execute any Web APIs that are reserved for trusted apps.

Prompting Users for Permission

In addition to permissions that are implicitly associated with the web apps, certain operations require explicit permission from the user before they can be executed. For these operations, web apps are required to specify, in their manifest, their justification for requiring this permission. This data usage intention informs users about what the web app intends to do with this data if permission is granted, as well as any risk involved. This allows users to make informed decisions and maintain control over their data.

Secure App Update Process

For app upgrades and patches to a privileged app, app providers submit the updated package to an authorized Marketplace, where it is reviewed and, if approved, signed and made available to users. On Firefox OS devices, an App Update Utility periodically checks for app updates. If an update is available, then the user is asked whether they want to install it. Before a update is installed on the mobile device, the package is verified for:

  • update origin (verify the source location protocol:domain:port of the update and manifest)
  • file integrity (SHA-256 hash check)
  • code signature (certificate check against a trusted root)

Rigorous checks are in place to ensure that the update is applied properly to the mobile phone.
The complete update package must be downloaded in a specific and secure location before the update process begins. Installation does not overwrite any user data.

Device Security (Hardware)

Security mechanisms for the mobile device hardware are typically handled by the OEM. For example, an OEM might offer SIM (Subscriber Identity Module) card locks, along with PUK (PIN Unlock Key) codes to unlock SIM cards that have become locked following incorrect PIN entries. Contact the OEM for details. Firefox OS does allow users to configure passcodes and timeout screens, which are described in the next section.

Data Security

Users can store personal data on their phone that they want to keep private, including contacts, financial information (bank & credit card details), passwords, calendars, and so on. Firefox OS is designed to protect against malicious apps that could steal, exploit, or destroy sensitive data.

Passcode and Timeout Screens

Firefox OS allows users to set a passcode to their mobile phone so only those who supply the passcode can use the phone. Firefox OS also provides a timeout screen that is displayed after a configurable period of phone inactivity, requiring passcode authentication before resuming use of the phone.

Sandboxed Data

As described earlier, apps are sandboxed at run time. This prevents apps from accessing data that belongs to other apps unless that data is explicitly shared, and the app has sufficient permissions to access it.

Serialized Data

Web apps do not have direct read and write access to the file system. Instead, all access to storage occurs only through Web APIs. Web APIs read from, and write to, storage via a an intermediary SQLite database. There is no direct I/O access. Each app has its own data store, which is serialized to disk by the database.

Data Destruction

When a user uninstalls an app, all of the data (cookies, localStorage, Indexeddb, and so on) associated with that application is deleted.

Privacy

Mozilla is committed to protecting user privacy and user data according to its privacy principles (https://www.mozilla.org/privacy/), which stem from the Mozilla Manifesto (https://www.mozilla.org/about/manifesto.html). The Mozilla Firefox Privacy Policy describes how Mozilla collects and uses information about users of the Mozilla Firefox web browser, including what Firefox sends to websites, what Mozilla does to secure data, Mozilla data practices, and so on. For more information, see:

Firefox OS implements these principles by putting the control of the user data in the hands of the user, who gets to decide where this personal information goes. Firefox OS provides the following features:

  • Do Not Track option
  • ability to disable Firefox browser cookies
  • ability to delete the Firefox OS browsing history

 

Etiquetas y colaboradores del documento

 Colaboradores en esta página: chrisdavidmills, AngelFQC, Pochy
 Última actualización por: chrisdavidmills,