Authority management method and device of vehicle-mounted system
By assigning target identities to applications dynamically installed in the vehicle system and determining their permissions, the problem of difficult user information management under static management is solved, ensuring normal startup of applications and controlling permissions, and improving system security.
Patent Information
- Application Number
- CN202410895091.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-22
AI Technical Summary
When in-vehicle systems dynamically install applications, they cannot effectively manage user information through static management, which makes application startup and permission control difficult. In addition, static management methods have a high risk of modifying system files to avoid information leakage, which reduces system security.
When the application is dynamically installed in the vehicle system, the target identity is assigned to the application, and the matching user information is queried in the static identity configuration file through the name resolution service. If it does not exist, it is determined as an ordinary user identity through the name service module to ensure that the application starts normally. And perform permission control to avoid modification of system files.
It ensures the normal startup and permission control of applications without modifying system files, improves the security of the vehicle system and avoids the risk of information leakage.
Smart Images

Figure CN118821091A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a method and device for managing permissions of an in-vehicle system. Background Art
[0002] The in-vehicle system is usually a multi-user system (such as the Linux system), that is, multiple users can exist on the same device. The Linux system usually manages user identities and file permissions based on the Discretionary Access Control (DAC) strategy. In the DAC strategy, users in the Linux system are mainly divided into super administrators (root) and ordinary users. Root has all permissions and unrestricted access to resources. Ordinary users have limited permissions and can only access resources within the permissions.
[0003] At present, the Linux system manages user information in a static way. That is, user information is preset in the / etc / passwd file during the system development phase. After the application process is started, the system will call the Name Service Switch (NSS) to identify the application process, that is, call the getpwent() function to search the / etc / passwd file to determine whether the / etc / passwd file includes the user information corresponding to the application process. If it does, the application can be started normally and permission control can be performed on the application. If it does not, the application cannot be started normally and permission control cannot be performed on the application.
[0004] However, the in-vehicle system involves frequent installation and uninstallation of applications. Dynamically installed applications cannot manage the application-related information (i.e. user information) through static management, and cannot guarantee the normal startup and permission control of applications. If system files such as passwd, group, and shadow are modified in order to manage user information through static management, there will be a risk of leaking key information, reducing the security of the in-vehicle system. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium, and computer program product for managing permissions of an in-vehicle system, which can avoid information leakage and ensure the security of the in-vehicle system.
[0006] In a first aspect, an embodiment of the present application provides a method for managing permissions of an in-vehicle system, the method comprising:
[0007] During the process of dynamically installing an application in the vehicle system, assigning a target identity to the application;
[0008] When the process of the application is started, querying the target user information matching the target identity in the static identity configuration file through the name resolution service, wherein the static identity configuration file includes a plurality of user information set in the development stage of the vehicle-mounted system;
[0009] In the case that the target user information does not exist in the static identity configuration file, determining whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system through a name service module;
[0010] In a case where the target identity is the common user identity dynamically allocated by the vehicle-mounted system, starting the application;
[0011] The application is subjected to permission control according to the target identity.
[0012] In a possible implementation manner, allocating a target identity to the application includes:
[0013] Acquiring a first application name of the application during scanning of the installation package of the application;
[0014] Determining whether the application is in a privileged whitelist according to the first application name, wherein the privileged whitelist includes a plurality of privileged applications;
[0015] In the case where the application is in the privileged whitelist, determining the application to be the privileged application, and determining the super administrator identity corresponding to the privileged application as the target identity;
[0016] In the case that the application is not in the privileged whitelist, the application is determined to be a common application, and the common user identity is dynamically allocated to the application to obtain the target identity.
[0017] In a possible implementation manner, dynamically allocating the common user identity identifier to the application to obtain the target identity identifier includes:
[0018] Determine whether a historical application with the first application name has been installed in the vehicle system;
[0019] In the case that the historical application has been installed in the vehicle-mounted system, the identity of the historical application is determined as the target identity.
[0020] In a possible implementation manner, the common user identity identifier is a numerical identifier.
[0021] In a possible implementation manner, dynamically allocating the common user identity identifier to the application to obtain the target identity identifier further includes:
[0022] In the case where the historical application is not installed in the vehicle-mounted system, obtaining a first identity identifier with the largest value that has been dynamically allocated by the vehicle-mounted system;
[0023] Add 1 to the value of the first identity identifier to obtain a second identity identifier;
[0024] When the second identity identifier is not greater than a preset threshold, the second identity identifier is determined as the target identity identifier.
[0025] In a possible implementation manner, after obtaining the second identity identifier, the method further includes:
[0026] The value of the first identity identifier is replaced by the value of the second identity identifier.
[0027] In a possible implementation, determining, by a name service module, whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system includes:
[0028] Calling the name service module integrated in the form of a dynamic library through the name resolution service;
[0029] Traversing multiple common user identities dynamically allocated by the vehicle-mounted system through the name service module;
[0030] Determine whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system according to the traversal result.
[0031] In a possible implementation manner, before allocating a target identity to the application, the method further includes:
[0032] Setting a correspondence between a plurality of common user identities and permission information, wherein the plurality of common user identities include the target identity;
[0033] The performing permission control on the application according to the target identity includes:
[0034] The application is subjected to permission control according to the permission information corresponding to the target identity.
[0035] In a possible implementation, the permission information includes multiple permission groups, and the permission groups set read and write permissions for resources. The setting of the correspondence between multiple common user identity identifiers and permission information includes:
[0036] Determining the correspondence between the plurality of common user identifications and the plurality of applications according to the installation order of the plurality of applications;
[0037] According to the permission requirement of each application, adding the common user identity corresponding to the application to at least one of the permission groups corresponding to the permission requirement;
[0038] The performing permission control on the application according to the permission information corresponding to the target identity includes:
[0039] Determining at least one target permission group corresponding to the target identity in at least one of the plurality of permission groups;
[0040] The application is subjected to permission control according to the permission information corresponding to the target permission group.
[0041] In a second aspect, an embodiment of the present application provides a rights management device for a vehicle-mounted system, the device comprising:
[0042] An allocation module, used to allocate a target identity to an application during dynamic installation of the application in the vehicle system;
[0043] a query module, configured to query target user information matching the target identity in a static identity configuration file through a name resolution service when the process of the application is started, wherein the static identity configuration file includes a plurality of user information set during the development stage of the vehicle-mounted system;
[0044] a determination module, configured to determine, through a name service module, whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system when the target user information does not exist in the static identity configuration file;
[0045] A starting module, used for starting the application when the target identity is the common user identity dynamically allocated by the vehicle-mounted system;
[0046] A control module is used to perform permission control on the application according to the target identity.
[0047] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0048] When the processor executes the computer program instructions, the processor implements any possible implementation method of the first aspect described above.
[0049] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implements a method in any possible implementation method of the first aspect described above.
[0050] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a method as any possible implementation method in the first aspect above.
[0051] The permission management method, device, equipment, computer-readable storage medium and computer program product of the vehicle-mounted system of the embodiment of the present application can determine a unique identity for the application and determine the permission access scope of the application based on the target identity by assigning a target identity to the application during the process of dynamically installing the application in the vehicle-mounted system. By starting the application when the name service module determines that the target identity is the ordinary user identity dynamically assigned by the vehicle-mounted system, the normal startup of the application can be guaranteed. In this way, by controlling the permissions of the application based on the target identity, the normal startup and permission control of the application can be guaranteed without modifying the system files, thereby avoiding information leakage and ensuring the security of the vehicle-mounted system. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0053] Figure 1 It is a flowchart of a method for managing permissions of an in-vehicle system provided in an embodiment of the present application;
[0054] Figure 2 It is a flowchart of a method for dynamically allocating target identity identifiers provided in an embodiment of the present application;
[0055] Figure 3 It is a flowchart of another method for managing permissions of an in-vehicle system provided in an embodiment of the present application;
[0056] Figure 4 This is a flow chart of obtaining application process information during the application startup phase provided by an embodiment of the present application;
[0057] Figure 5 It is a structural diagram of a permission management device for an in-vehicle system provided in an embodiment of the present application;
[0058] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0060] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0061] As described in the background technology section, in the DAC policy, users in the Linux system are mainly divided into two types: super administrators (root) and ordinary users. Among them, whether a user can access a file in the system is related to the file's permissions (including read, write, and execute), and whether a program can access a file in the system is related to whether the owner of the program has the access rights to the file.
[0062] In addition, NSS is a tool that can provide various sources for common configuration databases and name resolution mechanisms. Sources can include local operating system files (such as / etc / passwd, / etc / group, and / etc / hosts), Domain Name System (DNS), Network Information Service (NIS), and Lightweight Directory Access Protocol (LDAP).
[0063] Currently, after the application process is started, NSS can call the getpwent() function to search the / etc / passwd file to determine whether the / etc / passwd file contains the user information corresponding to the application process. If it does, the application can be started normally and permission control can be performed on the application. If it does not, the application cannot be started normally and permission control cannot be performed on the application.
[0064] However, the in-vehicle system involves frequent installation and uninstallation of applications. Dynamically installed applications cannot manage the relevant information of the application (i.e., user information) through static management, and cannot guarantee the normal startup and permission control of the application. If system files such as passwd, group, and shadow are modified in order to manage user information through static management, there is a risk of leaking key information, reducing the security of the in-vehicle system. Specifically, under the existing management method of the Linux system, in order to manage user information through static management, it is necessary to add user information corresponding to the application after the dynamic installation of the application. Adding users involves setting and accessing system files such as passwd, group, and shadow, which are at risk of leaking key information. For example, the information in the passwd file contains the user name, which can be used to customize the dictionary or perform secure shell (SSH) blasting.
[0065] In addition, during the operation of the vehicle system, the root user identity is granted to the application by default when the application is installed on the vehicle side, which will also reduce the security of the vehicle system.
[0066] Thus, in order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, computer-readable storage medium and computer program product for managing permissions of an in-vehicle system. The method for managing permissions of an in-vehicle system can be a method for setting and managing permissions for dynamically installed applications under the mechanism of a DAC policy.
[0067] Before introducing the permission management method of the vehicle-mounted system provided in the embodiment of the present application, the application in the embodiment of the present application is first introduced.
[0068] In the embodiment of the present application, applications can be divided into privileged users and ordinary users according to their functions and requirements. Among them, applications started as privileged users can be privileged applications. During the development stage of the vehicle system, the application information of privileged applications can be pre-set in the privileged whitelist to ensure the security management of privileged applications. During the system startup stage, it can be determined whether the application is a privileged application. If the application is a privileged application, it can be started as root. If the application is a non-privileged application, it can be started as an ordinary user.
[0069] The following is an introduction to the permission management method of the vehicle-mounted system provided in the embodiment of the present application.
[0070] Figure 1 FIG. 1 is a flow chart showing a method for managing permissions of a vehicle-mounted system provided by an embodiment of the present application. Figure 1 As shown, the permission management method of the vehicle system provided in the embodiment of the present application includes steps S110 to S150.
[0071] S110, during the process of dynamically installing applications in the vehicle system, a target identity is assigned to the application. Here, the target identity can be the identity (user identity, uid) corresponding to the dynamically installed application. Among them, the identity can be the super administrator identity corresponding to the privileged user, or it can be the ordinary user identity corresponding to the ordinary user, which is not limited here. Among them, privileged users can access resources without restriction. Ordinary user a can perform read and write operations on folders owned by a in the application installation path and data read and write path. In addition, if the identity is recorded as U and the fixed string is recorded as APP, the unique user name APP_U of the application can be determined based on the identity and the fixed string.
[0072] Based on this, in some embodiments, the above-mentioned allocation of a target identity to an application may include:
[0073] Obtaining a first application name of the application during scanning of the application installation package;
[0074] Determining whether the application is in a privileged whitelist according to the first application name, where the privileged whitelist includes a plurality of privileged applications;
[0075] If the application is in the privileged whitelist, the application is determined to be a privileged application, and the super administrator identity corresponding to the privileged application is determined as the target identity;
[0076] When the application is not in the privilege whitelist, the application is determined to be a common application, and a common user identity is dynamically allocated to the application to obtain a target identity.
[0077] Here, the privilege whitelist may include privileged application names corresponding to a plurality of privileged applications.
[0078] As an example, when the vehicle-mounted system scans the installation package of the application, it can first traverse the privileged whitelist. If the multiple privileged application names in the privileged whitelist include the first application name, it can be determined that the dynamically installed application is in the privileged whitelist, and then the application can be determined to be a privileged application. In this way, the application can have a super administrator identity, that is, the super administrator identity identifier can be determined as the target identity identifier. If the multiple privileged application names do not include the first application name, it can be determined that the dynamically installed application is not in the privileged whitelist, and the application can be determined to be an ordinary application, and then an ordinary user identity identifier can be dynamically assigned to the application to obtain the target identity identifier of the application.
[0079] Based on this, in some embodiments, the above-mentioned dynamically allocating a common user identity identifier to the application to obtain a target identity identifier may include:
[0080] Determine whether a historical application with the same application name as the first application name has been installed in the vehicle system;
[0081] In the case where a historical application has been installed in the vehicle system, the identity identifier of the historical application is determined as the target identity identifier.
[0082] Here, the target identity identifier may be an ordinary user identity identifier, wherein the ordinary user identity identifier may be a numerical identifier, a text identifier, or a character identifier, which is not limited here.
[0083] As an example, before the above application is dynamically installed, multiple historical applications may have been installed in the vehicle system. After obtaining the first application name, multiple historical applications currently installed in the vehicle system may be compared. If it is found that the first application name is the same as the application name of a historical application, that is, the application has been installed (involving a version update of the application), the identity of the historical application whose application name is the first application name may be obtained, and the identity may be determined as the target identity.
[0084] In addition, when the common user identity identifier is a numerical identifier, the value range of the common user identity identifier can be preset. The value range of the common user identity identifier can be, for example, 0-1000.
[0085] Based on this, in order to improve the security of the vehicle-mounted system, in some embodiments, the above-mentioned dynamically allocating a common user identity identifier to the application to obtain a target identity identifier may also include:
[0086] When no historical application is installed in the vehicle system, obtaining a first identity identifier with the largest value that has been dynamically allocated by the vehicle system;
[0087] Add one to the value of the first identity identifier to obtain a second identity identifier;
[0088] When the second identity identifier is not greater than a preset threshold, the second identity identifier is determined as the target identity identifier.
[0089] Here, the preset threshold value may be the identity identifier with the largest value among a plurality of pre-set ordinary user identity identifiers. A plurality of ordinary user identity identifiers may be allocated in ascending order of value. For example, if the value range of the ordinary user identity identifier is 0-1000, the preset threshold value may be 1000. The first identity identifier may be the ordinary user identity identifier with the largest value among the ordinary user identity identifiers dynamically allocated by the vehicle-mounted system. The value of the first identity identifier may be less than or equal to the preset threshold value. In the above example, the value of the first identity identifier may be less than or equal to 1000. The second identity identifier may be the next identifier of the first identity identifier.
[0090] As an example, in the case where the common user identity is a numerical identifier, the common user identity can be dynamically allocated to the application according to the dynamic installation order of the application and the numerical value of the common user identity in ascending order. For example, the identity of the first common application installed can be 0, the identity of the second common application installed can be 1, and so on, which will not be described in detail here.
[0091] After determining the second identity, it can be determined whether the second identity is greater than a preset threshold. If so, it can be determined that the number of applications installed in the vehicle system has exceeded the limit, and an illegal identity can be returned. If not, the second identity can be determined as the target identity. After determining the target identity, the target identity can be recorded in the dynamically allocated uid directory.
[0092] In addition, the value of the first identity identifier may be updated once each time an application is installed in the vehicle system.
[0093] Based on this, in some embodiments, after obtaining the second identity identifier, the following may also be included:
[0094] The value of the first identity identifier is replaced by the value of the second identity identifier. That is, after determining the target identity identifier (ie, the second identity identifier), the first identity identifier can be updated with the target identity identifier.
[0095] In order to better describe the above process of dynamically allocating target identities to applications, an embodiment of the present application provides a flowchart of a method for dynamically allocating target identities.
[0096] like Figure 2 As shown, the method for dynamically allocating target identity identifiers provided in the embodiment of the present application includes the following steps:
[0097] S21, obtaining the application name N1 of the application;
[0098] S22, judging whether the application is a newly installed application according to N1, if not, executing S23, if yes, executing S24;
[0099] S23, determining the value of the uid of the installed application with the application name N1 as U1;
[0100] S24, query the maximum value U2 of the dynamically allocated uid;
[0101] S25, determine whether U2+1 is greater than a preset threshold, if so, execute S26, if not, execute S27;
[0102] S26. Determine that the uid of N1 is an illegal value;
[0103] S27. Determine that the uid of N1 (i.e., U1) is U2+1, and the user name is APP_U1.
[0104] In this way, since the target identity is one of the multiple pre-set common user identities, the controllability of the target identity can be guaranteed by dynamically allocating common user identities to dynamically installed applications in the above manner, that is, the controllability of the resource access rights of the application can be guaranteed, providing convenient conditions for the permission management of the application. In addition, by dynamically allocating common user identities to dynamically installed applications to dynamically manage the user information corresponding to the application, rather than statically managing the user information corresponding to the application by modifying system files, the risk of information leakage of system files can be avoided, thereby improving the security of the vehicle-mounted system.
[0105] S120, when the application process is launched, query the static identity configuration file for target user information matching the target identity identifier through the name resolution service, where the static identity configuration file includes multiple user information set during the development stage of the vehicle system.
[0106] Here, the Name Service Switch (NSS) can identify the application process. The static identity configuration file can be the / etc / passwd file.
[0107] As an example, when the application process is launched, the identity of the process can be set to the target identity. The vehicle system can identify the target identity by calling the NSS service. Specifically, the NSS service can query the / etc / passwd file through the getpwent() function to find the target user information corresponding to the target identity, that is, query the statically allocated uid information.
[0108] In fact, since the application is installed dynamically and its target identity is dynamically allocated, the / etc / passwd file does not include the target identity and its corresponding target user information. Therefore, after traversing the / etc / passwd file through the NSS service, the target identity and its corresponding target user information cannot be found, and an illegal value will be returned, causing the application to fail to start. In other words, a conflict (crash) will occur when the system spontaneously verifies the target identity.
[0109] S130: When the target user information does not exist in the static identity configuration file, determine through the name service module whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system.
[0110] Here, the name service module (Name service module) can be integrated in the form of a dynamic library, wherein the dynamic library can be GIO lib.
[0111] As an example, since the system crashes when it spontaneously verifies the target identity, a new search mechanism can be added based on the original search strategy to resolve this conflict. Specifically, the Name service module can be called after the original NSS service strategy returns a failure, and then returns the application identity corresponding to the target identity. In other words, the Name service module can query the dynamically allocated uid information.
[0112] Based on this, in some embodiments, the above S130 may include:
[0113] The name service module integrated in the form of a dynamic library is called through the name resolution service;
[0114] Traverse multiple common user identities dynamically allocated by the vehicle system through the name service module;
[0115] Determine whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system based on the traversal result.
[0116] Here, after the getpwent() function fails to query the / etc / passwd file, the NSS service can call the Name service module integrated in the form of a dynamic library. The Name service module can traverse the dynamically allocated uid information and return it to ensure that the application starts without exception. This process does not involve the modification and access of system files such as / etc / passwd.
[0117] As an example, multiple common user identities dynamically allocated by the vehicle system can be set in the dynamically allocated uid directory. The Name service module can traverse the dynamically allocated uid directory to determine whether the target identity is a common user identity dynamically allocated by the vehicle system. If so, the target identity or the user name corresponding to the target identity can be returned to ensure the normal startup of the application.
[0118] S140: When the target identity is a common user identity dynamically allocated by the vehicle-mounted system, start the application.
[0119] Here, as described above, after determining the target identity, the target identity can be recorded in the dynamically allocated uid directory, so the dynamically allocated uid directory can include the target identity. Therefore, the Name service module can ensure that the application is started normally without modifying or accessing system files such as / etc / passwd.
[0120] S150: Perform permission control on the application according to the target identity.
[0121] Here, the application may have a unique identity (ie, a target identity) when running in the system, and the application can only access its own resources (ie, resources corresponding to the target identity).
[0122] Based on this, in order to ensure the rationality of the application access rights, in some embodiments, before the above S110, the following steps may also be included:
[0123] Setting a correspondence between multiple common user identities and permission information, wherein the multiple common user identities include a target identity;
[0124] Based on this, the above S150 may include:
[0125] The application is controlled according to the permission information corresponding to the target identity.
[0126] Here, multiple common user identities may be identities to be dynamically allocated. Permission information may include permission groups. Among them, permission groups may set read and write permissions for resources. The number of permission groups may be one or more, which is not limited here. If the number of permission groups is one, multiple common user identities may have the same permissions. If the number of permission groups is multiple, the same user may join different permission groups to obtain corresponding file permissions.
[0127] Based on this, in order to achieve more fine-grained permission management, in some embodiments, the above-mentioned setting of the correspondence between multiple common user identity identifiers and permission information may include:
[0128] Determining a correspondence between multiple common user identities and multiple applications according to an installation order of the multiple applications;
[0129] According to the permission requirements of each application, add the common user identity corresponding to the application to at least one permission group corresponding to the permission requirements;
[0130] Based on this, the above-mentioned permission control of the application according to the permission information corresponding to the target identity identifier may include:
[0131] Determining at least one target permission group corresponding to the target identity from among the plurality of permission groups;
[0132] The permission control is performed on the application according to the permission information corresponding to at least one target permission group.
[0133] Here, the security order of the multiple applications can be predetermined. Since the multiple common user identities can be allocated in ascending order of value, after the installation order of the multiple applications is determined, the corresponding relationship between the applications and the common user identities can be determined.
[0134] In actual development, applications can have different degrees of access to system resources based on different functions. Therefore, according to the permission requirements of each application, the ordinary user identity corresponding to the application can be added to at least one permission group corresponding to the permission requirements (that is, the application can be more accurately privileged according to the permission requirements of the application). Since the same user can join different permission groups, the target identity can correspond to one target permission group or multiple target permission groups, which is not limited here. After determining at least one target permission group corresponding to the target identity, the application can be controlled according to the permission information corresponding to the at least one target permission group.
[0135] In this way, more fine-grained permission management can be achieved through permission groups.
[0136] The permission management method for the vehicle system of the embodiment of the present application can determine a unique identity for the application and determine the permission access scope of the application according to the target identity by assigning a target identity to the application during the process of dynamically installing the application in the vehicle system. By starting the application when the name service module determines that the target identity is the ordinary user identity dynamically assigned by the vehicle system, the normal startup of the application can be guaranteed. In this way, by controlling the permissions of the application according to the target identity, the normal startup and permission control of the application can be guaranteed without modifying the system files, thereby avoiding information leakage and ensuring the security of the vehicle system.
[0137] In order to better describe the entire solution, some specific examples are given based on the above embodiments.
[0138] For example, Figure 3 As shown, the permission management method of the vehicle system based on DAC may include the following steps:
[0139] S31, assigning an application uid (i.e., target identity) and a user name to the application during the application installation phase;
[0140] S32, determining whether to start the application according to the application uid during the application startup phase;
[0141] S33. During the application running phase, permission control is performed through the permission group corresponding to the application uid.
[0142] exist Figure 3 In the application startup phase, the application process information can be obtained first, and then whether to start the application can be determined based on the application process information.
[0143] like Figure 4 As shown, obtaining application process information during the application startup phase may include the following steps:
[0144] S41. Obtain the user name or application uid of the application;
[0145] S42, traverse the statically allocated uid directory;
[0146] S43, determine whether the statically allocated uid directory includes the application uid or the corresponding user name, if not, execute S44, if yes, execute S47;
[0147] S44, traverse the dynamically allocated uid directory;
[0148] S45, determine whether the dynamically allocated uid directory includes the application uid or the corresponding user name, if not, execute S46, if yes, execute S47;
[0149] S46, returning an illegal value to prohibit starting the application;
[0150] S47. Return the application uid or the corresponding user name to allow the application to be started.
[0151] Therefore, from the technical principle point of view, the embodiment of the present application adds a dynamic management strategy on the basis of the original static management of user information, so that the dynamically installed application uid can be more flexible. In the uid search stage, a new query strategy is added on the basis of the original NSS service processing logic, and the custom interface function returns the query result (that is, the dynamically allocated uid directory is queried through the Name service module and the query result is returned). From the implementation method point of view, the embodiment of the present application bypasses the modification of the passwd file by writing a dynamic library, avoiding the need to modify the shadow file and the group file while modifying the passwd file. On the one hand, it can avoid modifying system files and simplify user operations. On the other hand, the interface function is simple to write, which improves the user's work efficiency.
[0152] In summary, the DAC-based vehicle system permission management method proposed in the embodiment of the present application can ensure the security of the vehicle system by granting a unique application uid to the application to limit the scope of its permission access, rather than running the dynamically installed application as root by default. In addition, the dynamic allocation of application uids avoids access to and modification of system files, further improving the security of the vehicle system.
[0153] Based on the vehicle-mounted system rights management method provided in the above embodiment, the present application also provides a specific implementation of the vehicle-mounted system rights management device. Please refer to the following embodiment.
[0154] like Figure 5 As shown, the permission management device 500 of the vehicle-mounted system provided in the embodiment of the present application includes the following modules:
[0155] The allocation module 510 is used to allocate a target identity to an application during the process of dynamically installing the application in the vehicle system;
[0156] A query module 520, configured to query target user information matching the target identity in a static identity configuration file through a name resolution service when the application process is started, wherein the static identity configuration file includes multiple user information set during the development stage of the vehicle system;
[0157] A determination module 530, for determining, through a name service module, whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system when the target user information does not exist in the static identity configuration file;
[0158] A starting module 540, used to start the application when the target identity is a common user identity dynamically allocated by the vehicle system;
[0159] The control module 550 is used to perform permission control on the application according to the target identity.
[0160] The following is a detailed description of the authority management device 500 of the vehicle-mounted system, as shown below:
[0161] In some embodiments, the allocation module 510 may include:
[0162] An acquisition submodule, used to acquire the first application name of the application during the process of scanning the installation package of the application;
[0163] A first determination submodule, configured to determine whether the application is in a privileged whitelist according to the first application name, wherein the privileged whitelist includes a plurality of privileged applications;
[0164] A first allocation submodule is used to determine that the application is a privileged application when the application is in the privileged whitelist, and determine the super administrator identity corresponding to the privileged application as the target identity;
[0165] The second allocation submodule is used to determine that the application is a common application when the application is not in the privilege whitelist, and dynamically allocate a common user identity to the application to obtain a target identity.
[0166] In some of these embodiments, the second allocation submodule may include:
[0167] A first determining unit, configured to determine whether a historical application with the first application name has been installed in the vehicle system;
[0168] The second determining unit is used to determine the identity identifier of the historical application as the target identity identifier when the historical application has been installed in the vehicle system.
[0169] In some of the embodiments, the common user identity identifier is a numerical identifier.
[0170] In some embodiments, the second allocation submodule may further include:
[0171] An acquisition unit, configured to acquire, when no historical application is installed in the vehicle system, a first identity identifier with the largest value that has been dynamically allocated by the vehicle system;
[0172] A calculation unit, configured to add one to the value of the first identity identifier to obtain a second identity identifier;
[0173] The third determining unit is configured to determine the second identity identifier as a target identity identifier when the second identity identifier is not greater than a preset threshold.
[0174] In some embodiments, the second allocation submodule may further include:
[0175] The replacement unit is used to replace the value of the first identity identifier with the value of the second identity identifier.
[0176] In some embodiments, the determination module 530 may include:
[0177] A calling submodule is used to call a name service module integrated in the form of a dynamic library through a name resolution service;
[0178] A traversal submodule, used to traverse multiple common user identities dynamically allocated by the vehicle system through the name service module;
[0179] The second determination submodule is used to determine whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system according to the traversal result.
[0180] In some of the embodiments, the permission management device 500 of the vehicle system may further include:
[0181] A setting module, used for setting a correspondence between a plurality of common user identities and permission information before allocating a target identity to an application, the plurality of common user identities including the target identity;
[0182] Based on this, the control module 550 may include:
[0183] The control submodule is used to perform permission control on the application according to the permission information corresponding to the target identity.
[0184] In some embodiments, the permission information includes multiple permission groups, and the permission groups set the read and write permissions of the resources. Based on this, the setting module may include:
[0185] A third determination submodule is used to determine the correspondence between multiple common user identities and multiple applications according to the installation order of multiple applications;
[0186] An adding submodule is used to add the common user identity corresponding to the application to at least one permission group corresponding to the permission requirement according to the permission requirement of each application;
[0187] Based on this, the control submodule may include:
[0188] A fourth determining unit, configured to determine at least one target permission group corresponding to the target identity from among the plurality of permission groups;
[0189] The control unit is used to perform permission control on the application according to the permission information corresponding to at least one target permission group.
[0190] The permission management device of the vehicle system of the embodiment of the present application can determine a unique identity for the application and determine the permission access scope of the application according to the target identity by assigning a target identity to the application during the process of dynamically installing the application in the vehicle system. By starting the application when the name service module determines that the target identity is the ordinary user identity dynamically assigned by the vehicle system, the normal startup of the application can be guaranteed. In this way, by controlling the permissions of the application according to the target identity, the normal startup and permission control of the application can be guaranteed without modifying the system files, thereby avoiding information leakage and ensuring the security of the vehicle system.
[0191] Based on the permission management method of the vehicle-mounted system provided in the above-mentioned embodiment, the embodiment of the present application also provides a specific implementation of the electronic device. Figure 6 A schematic diagram of an electronic device 600 provided in an embodiment of the present application is shown.
[0192] The electronic device 600 may include a processor 610 and a memory 620 storing computer program instructions.
[0193] Specifically, the processor 610 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0194] The memory 620 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 620 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 620 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 620 may be inside or outside the electronic device 600. In a particular embodiment, the memory 620 is a non-volatile solid-state memory.
[0195] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.
[0196] The processor 610 implements any one of the vehicle-mounted system authority management methods in the above-mentioned embodiments by reading and executing computer program instructions stored in the memory 620 .
[0197] In one example, the electronic device 600 may further include a communication interface 630 and a bus 640. Figure 6 As shown, the processor 610, the memory 620, and the communication interface 630 are connected via a bus 640 and communicate with each other.
[0198] The communication interface 630 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0199] Bus 640 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 640 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0200] Exemplarily, the electronic device 600 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).
[0201] The electronic device can execute the permission management method of the vehicle-mounted system in the embodiment of the present application, thereby realizing the combination Figures 1 to 5 A method and device for managing permissions of an in-vehicle system are described.
[0202] In addition, in combination with the vehicle-mounted system rights management method in the above embodiments, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any vehicle-mounted system rights management method in the above embodiments is implemented.
[0203] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0204] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0205] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0206] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0207] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for managing permissions of an in-vehicle system, characterized in that: include: During the process of dynamically installing an application in the vehicle system, assigning a target identity to the application; When the process of the application is started, querying the target user information matching the target identity in the static identity configuration file through the name resolution service, wherein the static identity configuration file includes a plurality of user information set in the development stage of the vehicle-mounted system; In the case that the target user information does not exist in the static identity configuration file, determining whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system through a name service module; In a case where the target identity is the common user identity dynamically allocated by the vehicle-mounted system, starting the application; The application is subjected to permission control according to the target identity.
2. The method according to claim 1, characterized in that The allocating a target identity to the application includes: Acquiring a first application name of the application during scanning of the installation package of the application; Determining whether the application is in a privileged whitelist according to the first application name, wherein the privileged whitelist includes a plurality of privileged applications; In the case where the application is in the privileged whitelist, determining the application to be the privileged application, and determining the super administrator identity corresponding to the privileged application as the target identity; In the case that the application is not in the privileged whitelist, the application is determined to be a common application, and the common user identity is dynamically allocated to the application to obtain the target identity.
3. The method according to claim 2, characterized in that The dynamically allocating the common user identity identifier to the application to obtain the target identity identifier includes: Determine whether a historical application with the first application name has been installed in the vehicle system; In the case that the historical application has been installed in the vehicle-mounted system, the identity of the historical application is determined as the target identity.
4. The method according to claim 3, characterized in that The common user identity identifier is a numerical identifier.
5. The method according to claim 4, characterized in that The dynamically allocating the common user identity identifier to the application to obtain the target identity identifier further includes: In the case where the historical application is not installed in the vehicle-mounted system, obtaining a first identity identifier with the largest value that has been dynamically allocated by the vehicle-mounted system; Add 1 to the value of the first identity identifier to obtain a second identity identifier; When the second identity identifier is not greater than a preset threshold, the second identity identifier is determined as the target identity identifier.
6. The method according to claim 5, characterized in that After obtaining the second identity identifier, the method further includes: The value of the first identity identifier is replaced by the value of the second identity identifier.
7. The method according to claim 1, characterized in that The determining, by the name service module, whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system comprises: Calling the name service module integrated in the form of a dynamic library through the name resolution service; Traversing multiple common user identities dynamically allocated by the vehicle-mounted system through the name service module; Determine whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system according to the traversal result.
8. The method according to claim 1, characterized in that Before allocating a target identity to the application, the method further includes: Setting a correspondence between a plurality of common user identities and permission information, wherein the plurality of common user identities include the target identity; The performing permission control on the application according to the target identity includes: The application is subjected to permission control according to the permission information corresponding to the target identity.
9. The method according to claim 8, characterized in that The permission information includes multiple permission groups, and the permission groups set the read and write permissions of resources. The setting of the correspondence between multiple common user identity identifiers and permission information includes: Determining the correspondence between the plurality of common user identifications and the plurality of applications according to the installation order of the plurality of applications; According to the permission requirement of each application, adding the common user identity corresponding to the application to at least one of the permission groups corresponding to the permission requirement; The performing permission control on the application according to the permission information corresponding to the target identity includes: Determining at least one target permission group corresponding to the target identity from among the multiple permission groups; The application is subjected to permission control according to the permission information corresponding to at least one of the target permission groups.
10. A rights management device for an in-vehicle system, characterized in that: The device comprises: An allocation module, used to allocate a target identity to an application during dynamic installation of the application in the vehicle system; a query module, configured to query target user information matching the target identity in a static identity configuration file through a name resolution service when the process of the application is started, wherein the static identity configuration file includes a plurality of user information set during the development stage of the vehicle-mounted system; a determination module, configured to determine, through a name service module, whether the target identity is a common user identity dynamically allocated by the vehicle-mounted system when the target user information does not exist in the static identity configuration file; A starting module, used for starting the application when the target identity is the common user identity dynamically allocated by the vehicle-mounted system; A control module is used to perform permission control on the application according to the target identity.
