The Android security

Android was designed with a specific focus on security. Android as a platform offers and enforces certain features that safeguard the user data present on the mobile through multilayered security. There are certain safe defaults that will protect the user and certain offerings that can be leveraged by the development community to build secure applications. The following are issues that are to be kept in mind while incorporating the Android security controls:

  • Protecting user-related data
  • Safeguarding the system resources
  • Making sure that one application cannot access the data of another application

The next few sections will help us understand more about Android's security features and offerings.

Note

A detailed explanation on Android security can be found at http://source.android.com/devices/tech/security/.

Secure kernel

Linux has evolved as a trusted platform over the years, and Android has leveraged this fact using it as its kernel. The user-based permission model of Linux has in fact worked well for Android. As mentioned earlier, there is a lot of specific code built into the Linux kernel. With each Android version release, the kernel version has also changed. The following table shows Android versions and their corresponding kernel versions:

Android version

Linux kernel version

1

2.6.25

1.5

2.6.27

1.6

2.6.29

2.2

2.6.32

2.3

2.6.35

3.0

2.6.36

4.0

3.0.1

4.1

3.0.31

4.2

3.4.0

4.2

3.4.39

4.4

3.8

5.0

3.16.1

6.0

3.18.1

Linux kernel versions used in Android

The permission model

As shown in the following screenshot, any Android application must be granted permissions to access sensitive functionality, such as the Internet, dialer, and so on, by the user. This provides an opportunity for the user to know in advance which functionality on the device is being accessed by the application. Simply put, it requires the user's permission to perform any kind of malicious activity (stealing data, compromising the system, and so on).

This model helps the user to prevent attacks, but if the user is unaware and gives away a lot of permissions, it leaves them in trouble (remember, when it comes to installing malware on any device, the weakest link is always the user).

The permission model

The permission model in Android

Until Android 6.0, users needed to grant the permissions during install time. Users had to either accept all the permissions or not install the application. But, starting from Android 6.0, users grant permissions to apps while the app is running. This new permission system also gives the user more control over the app's functionality by allowing the user to grant selective permissions. For example, a user can deny a particular app to access his location but provide access to Internet. The user can revoke the permissions at any time, by going to the app's Settings screen.

Application sandbox

In Linux systems, each user is assigned a unique user ID (UID), and users are segregated so that one user cannot access the data of another user. However, all applications under a particular user are run with the same privileges. Similarly, in Android, each application runs as a unique user. In other words, a UID is assigned to each application and is run as a separate process. This concept ensures an application sandbox at the kernel level. The kernel manages the security restrictions between the applications by making use of existing Linux concepts, such as UID and GID. If an application attempts to do something malicious, say to read the data of another application, this is not permitted as the application does not have the user privileges. Hence, the operating system protects an application from accessing the data of another application.

Secure inter-process communication

Android offers secure inter-process communication through which one's activity in an application can send messages to another activity in the same application or a different application. To achieve this, Android provides inter-process communication (IPC) mechanisms: intents, services, content providers, and so on.

Application signing

It is mandatory that all of the installed applications be digitally signed. Developers can place their applications in Google's Play Store only after signing the applications. The private key with which the application is signed is held by the developer. Using the same key, a developer can provide updates to their application, share data between the applications, and so on.

Security-Enhanced Linux

Security-Enhanced Linux (SELinux) is a new security feature introduced in Android 4.3 and fully enforced in Android 5.0. Until this addition, Android security was based on Discretionary Access Control (DAC), which means applications can ask for permissions, and users can grant or deny those permissions. Thus, malware can create havoc on the phones by gaining those permissions. But SE Android uses Mandatory Access Control (MAC), which ensures that applications work in isolated environments. Hence, even if a user installs a malware app, the malware cannot access the OS and corrupt the device. SELinux is used to enforce MAC over all the processes, including the ones running with root privileges. SELinux operates on the principle of default denial-anything that is not explicitly allowed is denied. SELinux can operate in one of the two global modes: permissive mode, in which permission denials are logged but not enforced, and enforcing mode, in which denials are both logged and enforced. More details about SELinux can be found at https://source.android.com/security/selinux/concepts.html.

Full disk encryption

With Android 6.0 Marshmallow, Google has mandated full disk encryption for most devices, provided that the hardware meets certain minimum standards. Encryption is the process of converting data into cipher text using a secret key. On Android devices, full disk encryption refers to the process of encrypting all user data using a secret key. Once a device is encrypted, all user-created data is automatically encrypted before writing it to disk and all reads automatically decrypt data before returning it to the calling process. Full disk encryption in Android works only with an Embedded Multimedia Card (eMMC) and a similar flash devices that present themselves to the kernel as block devices.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset