Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of sandbox model in Android

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "what is the use of sandbox model in Android", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "what is the use of sandbox model in Android" can help you solve your doubts.

A brief introduction to the principle of sandbox model

The real sandbox (SandBox) is a kind of children's toy, such as a container full of balls in KFC, in which children can play at will to protect children. (it can also be understood as a secure environment. )

In recent years, with the increasingly prominent problem of network security, more and more sandbox technology is applied to surfing the Internet. From the perspective of technical implementation, it is changed from preventing suspicious programs from accessing the system to redirecting the access of suspicious programs to the disk, registry and so on to the designated folder, so as to eliminate the harm to the system.

For example, GreenBorder builds a secure virtual execution environment for IE and FireFox. Any write to disk made by the user through the browser will be redirected to a specific temporary folder. In this way, even if the web page contains viruses, Trojans, advertisements and other malicious programs, after being forcibly installed, it is only installed in a temporary folder, which will not cause harm to the user's pc.

For Java technology in program development, sandbox also has a very important security significance. Whenever the sandbox loads code on a remote Web site and executes it locally, security is a critical issue. Click a link to launch the Java Web Start application. When you visit a web page, all Applet in it will also start automatically. If you click on another link, or visit a web page, you can install arbitrary code on the user's machine, then criminals may eavesdrop on confidential information, read financial data, or take over the user's machine to send ads. In order to ensure that Java technology will not be used for evil purposes, SUN designed a sophisticated security model when designing Java; that is, the Security Manager (Security Manager) will check all system resources that are entitled to use. By default, only harmless operations are allowed. To allow other operations, the code needs to be digitally signed and the user must be digitally authenticated.

In particular, the procedures in the sandbox have the following restrictions:

You cannot run any local executable programs.

You cannot read any information from the local computer file system or write any information to the local computer file system.

You cannot view any information about the local computer other than Java version information and a few harmless operating system details. In particular, the code in the sandbox cannot view information such as user name, E-mail address, and so on.

Remotely loaded programs cannot communicate with any host other than the server where the downloader is located, which is called the source host (originating host). This rule, often referred to as "remote code can only talk to family", will ensure that users are not probed into internal network resources by the code (in Java SE 6, Java Web Start applications can connect to other networks, but only with the user's consent).

Therefore, in recent years, sandbox technology is very popular, such as 360browser, all claim to use sandbox technology to ensure Internet security, and for the Android system, also consciously introduced such a concept.

2. Sandbox model in Android

In Linux, a user ID identifies a given user; on Android, a user ID identifies an application. The application is assigned a user ID during installation, and the user ID remains the same for the duration of the application on the device. Permissions are about allowing or restricting applications, not users, to access device resources.

In essence, Android implements separation and permissions between applications by using the concept of sandboxing to allow or deny an application access to a device's resources, such as files and directories, networks, sensors, and API. To do this, Android uses some Linux utilities (such as process-level security, application-related user and group ID, and permissions) to implement the actions that the application is allowed to perform.

Conceptually, the sandbox can be represented as shown in figure 1. You can clearly see that the two Android applications are each on their own basic sandbox or process.

Figure 1

Android applications run on their own Linux processes and are assigned a unique user ID. By default, applications running in a basic sandbox process are not assigned permissions, thus preventing such applications from accessing the system or resources. However, Android applications can request permissions through the application's manifest file.

Android applications can allow other applications to access their resources by doing two things:

1) declare the appropriate manifest permissions

2) run in the same process as other trusted applications to share access to their data and code (as shown in figure 2).

Figure 2

Different applications can run in the same process. For this approach, the applications must first be signed with the same private key, and then they must be assigned the same Linux user ID using the manifest file, which can be done by defining the manifest attribute android:sharedUserId with the same value / name.

After reading this, the article "what is the use of sandbox models in Android" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report