Android Security Framework: Enabling Generic and Extensible Access Control on Android

Michael Backes, Sven Bugiel, Sebastian Gerling, Philipp von Styp-RekowskyarXiv 2014

Abstract

We introduce the Android Security Framework (ASF), a generic, extensible security framework for Android that enables the development and integration of a wide spectrum of security models in form of code-based security modules. The design of ASF reflects lessons learned from the literature on established security frameworks (such as Linux Security Modules or the BSD MAC Framework) and intertwines them with the particular requirements and challenges from the design of Android's software stack. ASF provides a novel security API that supports authors of Android security extensions in developing their modules. This overcomes the current unsatisfactory situation to provide security solutions as separate patches to the Android software stack or to embed them into Android's mainline codebase. As a result, ASF provides different practical benefits such as a higher degree of acceptance, adaptation, and maintenance of security solutions than previously possible on Android. We present a prototypical implementation of ASF and demonstrate its effectiveness and efficiency by modularizing different security models from related work, such as context-aware access control, inlined reference monitoring, and type enforcement.

Introduction

Android security research has historically been hindered by the lack of a modular framework for access control. Novel security models—such as context-aware access control (CRePE) or Chinese Wall policies (XManDroid)—are typically implemented as extensive, hard-coded patches to the Android Open Source Project (AOSP). This approach creates a significant maintenance burden, as researchers must manually port complex patches to each new Android release. Furthermore, these solutions are often mutually exclusive; users cannot easily combine different security models because they are hard-wired into separate OS forks.

Stock Android security architecture showing hard-coded permission checks and kernel-level MAC.

As illustrated in the stock architecture, security logic is deeply embedded within system services and the kernel. Android lacks a standardized equivalent to the Linux Security Modules (LSM) framework, which would allow security logic to be loaded dynamically without rewriting the core operating system.

The Android Security Framework (ASF)

To address these challenges, we developed the Android Security Framework (ASF). ASF shifts security logic from the core OS infrastructure into loadable, independent Security Modules. This architecture enables modular security that is easier to maintain and combine than traditional "security forks."

The ASF architecture, featuring middleware and LSM hooks that communicate with a centralized Security Framework.

Technical Pillars

The framework is built upon several key technical innovations:

  • Multi-Tiered Hooks: ASF implements 139 enforcement hooks across the Linux Kernel (via LSM), Android Middleware (system services like GPS and SMS), and the Application layer (using Inlined Reference Monitors).
  • Policy-as-Code: Unlike static configuration-based systems, ASF modules are written in Java or C, allowing for complex, stateful security logic.
  • Edit Automata: Beyond simple "allow/deny" decisions, ASF supports "Edit" policies. Modules can modify data returned to an app—for instance, providing fake GPS coordinates to a suspicious library instead of crashing the host application.
  • Unified Security API: A standardized interface allows modules to register for events and make decisions based on rich middleware semantics, such as identifying the intent of a broadcast.

Evaluation and Results

We evaluated ASF on a Nexus 7 tablet running Android 4.3. The framework's effectiveness was demonstrated by modularizing four major existing security projects: AppGuard (IRM), CRePE (Context-aware), XManDroid (Chinese Wall), and FlaskDroid (Type Enforcement).

Performance

The system exhibits low performance overhead. In a baseline scenario with the framework active but no modules loaded, the overhead was measured at approximately 11.8% (129.8µs compared to 116.2µs in stock Android). Cumulative frequency distributions of execution times with complex modules like FlaskDroid remained very close to stock Android, indicating that the delay is largely imperceptible to end-users.

Code Efficiency

The entire ASF infrastructure was implemented in 4,606 lines of code. Porting existing models proved highly efficient; for example, porting XManDroid required changes to only ~6% of its original logic to integrate with the ASF API, effectively decoupling security logic from OS plumbing.

Conclusion and Future Work

ASF provides a practical path toward extensible security on Android. By providing a generic API and modular architecture, it reduces the "delta" required for researchers to deploy new security models. Future work will focus on enhancing module integrity against root-level attackers and integrating information flow control mechanisms, such as taint tracking, to monitor data after access has been granted.

Summary updated

BibTeX
@misc{backes2014android,
  author = {Michael Backes and Sven Bugiel and Sebastian Gerling and Philipp von Styp-Rekowsky},
  title = {{Android Security Framework: Enabling Generic and Extensible Access Control on Android}},
  year = {2014},
  eprint = {1404.1395},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1404.1395},
}
Figure