DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 2
  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 1
  • SOC 2 Made Simple: Your Guide to Certification
  • Securing Federal Systems

Trending

  • The Future of Java and AI: Coding in 2025
  • Scaling Microservices With Docker and Kubernetes on Production
  • Rust, WASM, and Edge: Next-Level Performance
  • Event Driven Architecture (EDA) - Optimizer or Complicator
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. Security Controls in the Android Operating System (OS)

Security Controls in the Android Operating System (OS)

In this post, we will learn the different security controls provided by the Android operating system (OS) to protect the applications running on the device.

By 
Sheshananda Reddy Kandula user avatar
Sheshananda Reddy Kandula
·
Feb. 10, 25 · Analysis
Likes (2)
Comment
Save
Tweet
Share
2.2K Views

Join the DZone community and get the full member experience.

Join For Free

As part of the Android Application Security series, we are going to understand the security controls provided by Android OS (operating system) to protect the applications that are running on the device. Without these security controls in place, the data on the devices or transmitted by apps could be easily accessed by other apps or devices in the network. 

Before getting started, if you haven't read the first part of this series, I highly recommend reading it.

Before the rise of mobile devices, OS (operating system) security primarily focused on desktop computers, servers, and enterprise systems. Below are a few important controls implemented by OS. 

  • Role-based access control (RBAC) and multi-user environments
  • Network security to protect against DoS (Denial of Service) attacks, firewalls, antivirus, etc.
  • Memory protection mechanisms to prevent buffer overflow (BoF) attacks, including DEP (Data Execution Prevention) and ASLR (Address Space Layout Randomization)
  • File system security, including file permissions, file encryption, and disk encryption

Like these, different operating systems (Windows, Linux, Unix, Solaris, etc.) came up with several protection mechanisms by the time the mobile device era started. 

Mobile operating systems like Android and iOS started building mobile platforms by keeping these security controls. But still, in the earlier days, there were not many controls available on Android/iOS. They added the required controls pretty fast. 

Defense in Depth

Android security followed a defense-in-depth model to protect confidentiality, integrity, and availability (CIA). In the defense-in-depth approach, they have implemented several controls. Below are important:

  • Android Users and Groups
  • SELinux (Security Enhanced Linux)
  • Permissions
  • DEP, ASLR, etc
  • SECCOMP
  • App Sandbox
  • Device Encryption
  • Trusted Execution Environment (TEE)

The below list shows the improvements:

  • Android 4.2 (API level 16) in November 2012 (introduction of SELinux)
  • Android 4.3 (API level 18) in July 2013 (SELinux became enabled by default)
  • Android 4.4 (API level 19) in October 2013 (several new APIs and ART introduced)
  • Android 5.0 (API level 21) in November 2014 (ART used by default and many other features added)
  • Android 6.0 (API level 23) in October 2015 (many new features and improvements, including granting; detailed permissions setup at runtime rather than all or nothing during installation)
  • Android 7.0 (API level 24-25) in August 2016 (new JIT compiler on ART)
  • Android 8.0 (API level 26-27) in August 2017 (a lot of security improvements)
  • Android 9 (API level 28) in August 2018 (restriction of background usage of mic or camera, introduction of lockdown mode, default HTTPS for all apps)
  • Android 10 (API level 29) in September 2019 (access location "only while using the app," device tracking prevention, improve secure external storage)

Android App Security Features

Apart from these regular operating system controls, Android will provide the following security controls for an app running on Android OS. 

  • App Sandboxing
  • Permissions
  • App Signing
  • Keystore

App Sandboxing

Application sandboxing is one of the critical features provided by Android OS. It allows you to keep your data or process in a sandbox environment and won't allow other apps (malicious or normal). This will protect data inside the app. 

Linux-based security mechanisms, file system permissions, and runtime restrictions ensure that apps operate independently without unauthorized access to system resources or other apps. As we have seen in the previous article, the application data will be in the /data/data/ folder.

Shell
 
barbet:/data/data # ls
alpha.mydevices.in                                               com.google.android.apps.internal.betterbug
android                                                          com.google.android.apps.maps
android.auto_generated_rro_product__                             com.google.android.apps.messaging
android.auto_generated_rro_vendor__                              com.google.android.apps.nbu.files
android.autoinstalls.config.google.nexus                         com.google.android.apps.nexuslauncher
android.myshop.release                                           com.google.android.apps.photos


While installing the app on the device, the OS generates a unique code for the app and performs Base64 encoding on it. Then, create a folder name with that. Before Oreo, Android used a normal package name. But, after Oreo, Android started creating unique folder names to provide better unique names and security. 

Shell
 
barbet:/data/data # ls /data/app/
~~-09YTqMLYcn7FwT_vUBMOA==  ~~AK82hlWJIrFJf2cgbVRR3g==  ~~KvDoAodAiN0LD2UILHaetg==  ~~QOHLg7084hj8rNBvVYHYeg==  ~~gndAwbGNwp0mzMUTP556Sg==  ~~uoiS3mnMS4L3QfsR0uwqPA==
~~1GBi7xnRkkWDvnnXZaZHPQ==  ~~CeEiKh1AzGKF9Y9x76zs5A==  ~~L6i9NBP_E_AWx0xH9YqlTA==  ~~Qdd7zzYfVflMMaAGBQ8ZMw==  ~~hfTx_FzGJ_VJ0ixIGudCZg==  ~~vD_rgwS55aJpet3R2BZmPw==
~~21GSMTYpPGbmfo2J0pktSQ==  ~~DBpe3alZqtqzhzbsPsiIMg==  ~~LBtCo2pnLZRNu_bG1KmjIQ==  ~~RBZl37VivVPAu4ovxRpX3Q==  ~~j4XtEDAErb_X2lAXlXgHvA==  ~~vM80pt2jacKCCUjiKCh9UA==
~~2WLzdU9faNRtTWTH9veuiw==  ~~DbXAPRM1sjmHHYWO4BER0w==  ~~MSw6x4JmrypY_E2G71wchw==  ~~TU9zLt0XNPdlo26BAr_aIw==  ~~jMmQ6FtaqWQ_HmLd85T_pQ==  ~~vqp1MM_cfzUyOEucWflhDg==
~~2eFNNEK0J5-bfUpxfOnNGw==  ~~DxOUwLmCdEqkM_2UXXDo-g==  ~~Ma7GQ-mgVbviiz1NVUECiQ==  ~~U4EbGiTCND1jmF3wZdkRYw==  ~~j_HCTKzJrbJ7OVjNxm45Dw==  ~~vvRXqZtaVpDagq6KtxMXQg==
~~2zp6xn7KRnCY7KP-eL1uDw==  ~~En-qhd9ZYwBn2WR5JTYBcg==  ~~MhXEKEfd9PxBFoHtcXMAMA==  ~~WmA6pQdCwVlAa5kxwhRaYA==  ~~kAhQi7P28dfkIgqlK8Ytmw==  ~~wTH3BJqtk3T8SePQmQw3Zg==


Permissions

Android permissions are critical controls that dictate how an app interacts with system resources, such as accessing the internet, reading contacts, or accessing files on the device. Apps must declare required permissions in the AndroidManifest.xml file. Users are informed about the requested permissions during installation (or runtime for dangerous permissions) and can decide whether to grant them, ensuring transparency and control over app behavior.

  • Install time permissions
  • Normal Permissions
  • Special Permissions
  • Permission groups

App Signing

To install any app (APK file) on the device, it has to be digitally signed. Without proper signature verification, the OS won't allow the installation. This helps the user to see the authenticity of the developer or organization. 

Keystore

A Keystore in Android is a secure container used to store cryptographic keys and certificates. It plays a vital role in app signing, securing sensitive data, and enabling cryptographic operations like encryption, decryption, and authentication.

Conclusion

We can see how these controls help Android applications protect themselves from malicious apps in upcoming posts.

Android OS Security controls apps security

Opinions expressed by DZone contributors are their own.

Related

  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 2
  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 1
  • SOC 2 Made Simple: Your Guide to Certification
  • Securing Federal Systems

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!