A file access control system, method and computing device
By setting up a file access control system in the operating system, using the permission table to check the access rights of the application, forming a stacked file system structure, the applicability problems of UNIX file permission management on the Windows operating system and single-user authorization problems are solved, and the problem of UNIX file permission management is realized. Flexible control of the underlying file system and data security guarantee.
Patent Information
- Application Number
- CN202210060590.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-08-31
AI Technical Summary
In the prior art, UNIX file permission management is not applicable to Windows operating systems, and cannot be independently authorized based on a single user. It is impossible to flexibly control the application's access rights to the underlying file system without relying on the specific file system, resulting in data security. Insufficient sex.
By setting up a file access control system in the operating system, including file system and access control server, using permission tables to check the access rights of the application, forming a stacked file system structure to intercept and control the application's access to the underlying file system, ensuring data Security.
It realizes flexible control of the application's access rights to the underlying file system without relying on the specific file system, ensures data security, and can be applied to various operating systems, improving the granularity and applicability of permission configuration.
Smart Images

Figure CN114417381B_ABST
Abstract
Description
[0001] This application is a divisional application of invention patent application 2021110082686 filed on August 31, 2021. Technical Field
[0002] The present invention relates to the field of computer technology, and in particular to a file access control system, a file access control method and a computing device. Background Art
[0003] At present, with the continuous development of information technology, many technologies such as 5G, Internet of Things, AI, cloud computing and big data are changing the world at an astonishing speed, but also bring various security issues. Data is the most important asset in the information age, and how to achieve data security storage is an urgent problem to be solved.
[0004] The control of file access permissions is an important part of data security storage. It is responsible for managing application software's access authorization to files and intercepting illegal operations on important files by unauthorized applications, thereby protecting data security.
[0005] The UNIX file permission management scheme in the prior art supports independent permission settings for three types of users, namely, designated users, all users in a designated group, and other users. Among them, three permissions, namely, read, write, and execute, are configured for each type of user. A total of nine flags are required to represent and store the three types of users and the three permissions, and the nine flags are stored in the file system with the files and directories. Before executing a specific file operation, the kernel will check whether the operation permissions are met. If the permissions are not met, an error is returned. Since the nine flags are stored in the file system with the files and directories, UNIX file permission management requires support from the file system. As a standard file system on the Linux operating system, the Ext series file system supports UNIX file permission management. However, the widely used file systems on the Windows operating system, such as VFAT and NTFS, do not support UNIX file permission management and can only be set uniformly when the device is mounted. In addition, UNIX file permission management cannot be independently authorized based on a single user.
[0006] Therefore, a file access control system and method are needed to solve the problems existing in the prior art. Summary of the invention
[0007] To this end, the present invention provides a file access control system, a file access control method and a computing device to solve or at least alleviate the above problems.
[0008] According to one aspect of the present invention, there is provided a file access control system, which is arranged in an operating system, on which one or more applications are arranged, and the file access control system comprises: a file system, adapted to receive an access request from an application to a target file, the access request comprising access information of the application; and an access control server, connected to the file system, adapted to receive a request sent by the file system to check the access rights of the application based on the access information, and adapted to determine, based on a permission table, a configuration permission corresponding to the access information, and determine, based on the configuration permission, whether the application has access rights to the target file; wherein, when it is determined that the application has access rights to the target file, the file system is adapted to return the target file to the application.
[0009] Optionally, in the file access control system according to the present invention, the file system includes: an underlying file system; a permission control file system, arranged on the underlying file system, the permission control file system is connected to an access control server, and is suitable for requesting the access control server to check the access rights of the application based on the access information; and a virtual file system, arranged on the permission control file system, the virtual file system is connected to one or more applications, and is suitable for receiving access requests for target files of the underlying file system sent by the application, and sending the access requests to the permission control file system.
[0010] Optionally, in the file access control system according to the present invention, the access control server includes a permission table, the permission table includes one or more permission items, each permission item includes an access information and a corresponding configuration permission, and the access control server is suitable for: querying the permission table based on the access information to determine the permission item and configuration permission corresponding to the access information; judging whether the configuration permission includes access rights to the target file, and if so, determining that the application has access rights to the target file.
[0011] Optionally, in the file access control system according to the present invention, the access information includes a target file path, a user identifier, and an application path.
[0012] Optionally, in the file access control system according to the present invention, the file access control system also includes: an access control application, arranged on an operating system, the access control application is connected to the access control server, suitable for obtaining a configuration file, obtaining permission configuration information from the configuration file, and sending the permission configuration information to the access control server; the access control server is suitable for updating a permission table based on the permission configuration information.
[0013] Optionally, in the file access control system according to the present invention, the access control server is adapted to send a log of failure to check access rights to the access control application when it is determined that the application does not have access rights to the target file.
[0014] Optionally, in the file access control system according to the present invention, the access control application is suitable for communicating with the access control server via Netlink.
[0015] Optionally, in the file access control system according to the present invention, the authority control file system is a stacked file system.
[0016] Optionally, in the file access control system according to the present invention, the access request also includes an open request and a delete request for the target file, and the access control server is further adapted to: when the access request is a request to open the target file, check whether the application has the permission to open the target file, and if it has the permission to open the target file, open the target file through the file system and then return it to the application; when the access request is a request to delete the target file, check whether the application has the permission to delete the target file, and if it has the permission to delete the target file, delete the target file through the file system.
[0017] Optionally, in the file access control system according to the present invention, the permission control file system is suitable for: when it is determined that the application has access rights to the target file, calling the open callback function of the underlying file system so as to open the target file of the underlying file system based on the open callback function; and returning the opened target file to the virtual file system so as to return the opened target file to the application through the virtual file system.
[0018] According to one aspect of the present invention, there is provided a file access control method, which is executed in a file access control system, wherein the file access control system is arranged in an operating system, the file access control system includes a file system, an access control server connected to the file system, and one or more applications are arranged on the operating system, the method includes the steps of: receiving an access request for a target file from an application via the file system, the access request including access information of the application; checking the access rights of the application based on the access information via the access control server, wherein the access control server is suitable for determining, based on a permission table, a configuration right corresponding to the access information, and determining, based on the configuration right, whether the application has access rights to the target file; and returning the target file to the application via the file system if it is determined that the application has access rights to the target file.
[0019] Optionally, in the file access control method according to the present invention, the file system includes a permission control file system, a virtual file system arranged above the permission control file system, and an underlying file system arranged below the permission control file system, and the permission control file system is connected to an access control server; the virtual file system is suitable for receiving an access request for a target file of the underlying file system sent by an application, and sending the access request to the permission control file system; the permission control file system is suitable for requesting the access control server to check the access rights of the application based on the access information.
[0020] Optionally, in the file access control method according to the present invention, the access control server includes a permission table, the permission table includes one or more permission items, each permission item includes an access information and a corresponding configuration permission, and the step of checking the access rights of the application based on the access information includes: querying the permission table based on the access information to determine the permission items and configuration permissions corresponding to the access information; judging whether the configuration permissions include access rights to the target file, and if so, determining that the application has access rights to the target file.
[0021] Optionally, in the file access control method according to the present invention, the access information includes a target file path, a user identifier, and an application path.
[0022] Optionally, in the file access control method according to the present invention, the access request also includes an open request and a delete request for the target file, and checking the access rights of the application includes: when the access request is a request to open the target file, checking whether the application has the permission to open the target file, and if it has the permission to open the target file, opening the target file and returning it to the application; when the access request is a request to delete the target file, checking whether the application has the permission to delete the target file, and if it has the permission to delete the target file, deleting the target file.
[0023] Optionally, in the file access control method according to the present invention, the step of returning the target file to the application includes: calling an open callback function of the underlying file system to open the target file of the underlying file system based on the open callback function; and returning the opened target file to the application through the virtual file system.
[0024] According to one aspect of the present invention, there is provided a computing device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing the file access control method as described above.
[0025] According to one aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the file access control method as described above.
[0026] According to the technical solution of the present invention, a file access control system and method are provided, which forms a new file system structure by creating a permission control file system based on a stacked file system structure between the underlying file system and the virtual file system. Based on this new file system structure, the permission control file system can intercept the application's access to the underlying file system, and detect the application's access rights through the access control server, thereby realizing flexible control of the application's access rights to the underlying file system without relying on a specific file system, thereby ensuring the data security of the underlying file system.
[0027] Furthermore, the access control server can determine the corresponding configuration permissions based on the permission table, and judge whether the application has the access permissions to the target file by comparing the configuration permissions and the access permissions required to operate the target file. By storing the permission configuration data in the permission table, it is not dependent on a specific file system, so that the file access control scheme of the present invention can be generally applicable to various operating systems and has a wider applicability. Moreover, based on the access control application, the configuration permission data in the permission table can be flexibly configured and updated to update the application's access permissions to the file.
[0028] In addition, according to the technical solution of the present invention, the permission table is queried based on the access information, and the access rights are determined according to the configuration permissions corresponding to the access information, wherein the access information includes the target file path, user identification, and application path. In this way, file permissions can be set based on a single user, thereby refining the granularity of the permission configuration.
[0029] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0031] Figure 1 A schematic diagram of a file access control system 100 according to an embodiment of the present invention is shown;
[0032] Figure 2 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown;
[0033] Figure 3 A flowchart of a file access control method 300 according to an embodiment of the present invention is shown; and
[0034] Figure 4 A timing diagram corresponding to a file access control method 300 according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0036] Figure 1 A schematic diagram of a file access control system 100 according to an embodiment of the present invention is shown. The file access control system 100 is suitable for executing the file access control method according to the present invention, and can flexibly control the access rights of the application program to the underlying file system without relying on a specific file system, ensure the data security of the underlying file system, and support various operating systems.
[0037] The file access control system 100 resides in a computing device. The computing device includes an operating system, and one or more application programs 110 can be arranged on the operating system. Here, the operating system includes a kernel and a user space arranged on the kernel, the file access control system 100 is arranged in the kernel of the operating system, and one or more application programs 110 are arranged in the user space of the operating system and can communicate with the kernel.
[0038] It should be noted that the present invention does not specifically limit the type of operating system. For example, the operating system can be implemented as a Linux operating system or a Windows operating system. It should be noted that the Linux operating system is an operating system based on the Linux kernel, which is an open source Unix-like operating system macro kernel. The following only takes the Linux operating system as an example to describe the file access control system 100 of the present invention in detail.
[0039] like Figure 1As shown, the file access control system 100 includes a file system 120 and an access control server 130 . The file system 120 and the access control server 130 are both arranged in the kernel of the operating system, and the file system 120 is communicatively connected with the access control server 130 .
[0040] In an embodiment according to the present invention, the file system 120 may receive access requests to a target file from one or more applications 110. Here, the access request includes access information of the application 110. The file system 120 obtains the access information of the application 110 from the access request so as to determine whether the application 110 has access rights to the target file according to the access information. Specifically, the file system 120 may send the access information of the application 110 to the access control server 130 to request the access control server 130 to check the access rights of the application 110 based on the access information and determine whether the application 110 has access rights to the target file.
[0041] The access control server 130 may receive a request sent by the file system 120 to check the access rights of the application 110 based on the access information. Subsequently, the access control server 130 may determine the configuration rights corresponding to the access information based on the permission table, and determine whether the application 110 has the access rights to the target file according to the configuration rights. If it is determined that the application 110 has the access rights to the target file, the access control server 130 may return a message to the file system 120 that the application has the access rights to the target file system, that is, a message that the access rights check is successful. When determining that the application has the access rights to the target file, the file system 120 returns the target file to the application 110. Here, when the access request of the application is a request to open the target file, the target file is opened and the opened target file is returned to the application 110.
[0042] In addition, if the configuration permissions corresponding to the access information do not include access permissions to the target file, the access control server 130 may determine that the application does not have access permissions to the target file, and return a message to the file system 120 indicating that the application does not have access permissions to the target file system, i.e., a message indicating that the access permission check failed.
[0043] It should be noted that, according to the file system in the prior art, the underlying file system is a specific file system, and the virtual file system (VFS) is an abstract file system layer built on the specific file system. In addition, the virtual file system provides a unified interface function for the application in the upper user space, so that the application can access the underlying file system by calling the interface function.
[0044] In one embodiment of the present invention, a new file system structure is constructed, wherein the constructed file system 120 includes an underlying file system 123, a virtual file system 121, and a permission control file system 122 arranged between the underlying file system 123 and the virtual file system 121. Thus, by creating the permission control file system 122 between the underlying file system 123 and the virtual file system 121, a new file system structure is formed in which the permission control file system 122 is arranged on the underlying file system 123, and the virtual file system 121 is arranged on the permission control file system 122. In addition, the upper layer of the virtual file system 121 is the user space, and the virtual file system 121 is connected to one or more applications in the user space and can communicate with one or more applications.
[0045] It should be noted that the permission control file system 122 is a stacked file system. In other words, the permission control file system 122 is a specific implementation of the stacked file system. The permission control file system 122 is arranged on the underlying file system 123 based on the structure of the stacked file system to achieve a merged mount of the underlying file system 123. Based on this file structure, the permission control file system 122 can intercept the access of the application 110 to the underlying file system 123 and detect the access rights of the application 110, so as to control the access of the application 110 to the underlying file system 123.
[0046] Specifically, when the application 110 requests to access the target file of the underlying file system 123, the virtual file system 121 can receive the access request for the target file of the underlying file system 123 sent by the application, and then send the access request to the permission control file system 122 connected thereto, and the permission control file system 122 intercepts the access request to perform permission detection. Among them, the permission control file system 122 can obtain the access information of the application 110 from the access request, and request the access control server 130 to check the access rights of the application based on the access information of the application 110.
[0047] In one implementation, the permission control file system 122 checks the access permission of the application 110 by calling the check_file_access_permission function in the access control server 130 .
[0048] In one embodiment, the access control server 130 includes a permission table, and the permission table can store permission configuration information of all files. Here, the permission table is a hash table that uses a data structure of an associative array abstract data type, which can map keys to values. Specifically, the permission table includes one or more permission items, each of which includes an access information and a configuration permission associated with the access information. In other words, the permission item is established based on the association relationship between the access information and the configuration permission. It should be pointed out that by storing the permission configuration data in the permission table, it is not dependent on a specific file system, so that the file access control scheme of the present invention can be generally applicable to various operating systems.
[0049] In one implementation, the data structure of each permission item in the permission table can be defined as:
[0050]
[0051] In one embodiment, the access information in each permission item may include a file path, a user identifier, and an application path. In this way, the corresponding permission item in the permission table can be queried based on one or more information in the file path, the user identifier, and the application path, and the configuration permission in the permission item can be obtained. The access control server 130 can query the permission table through the check_file_access_permission function, determine the configuration permission corresponding to the access information based on the permission table, and judge whether the application 110 has access rights to the target file based on the configuration permission. Here, it should be pointed out that the permission items in the permission table are described based on the file path, the user identifier, and the application path. In this way, the file permission can be set based on a single user, thereby refining the granularity of the permission configuration. In addition, when performing permission judgment, it can be processed in combination with the application information, thereby supporting the file permission setting based on the application accessing the file, and improving the scope of the permission setting.
[0052] Accordingly, the access information of the application 110 may include the target file path, the user identifier, and the path of the application 110. The access control server 130 may query the permission table based on the access information of the application 110 to determine the permission item and the configuration permission corresponding to the access information. Further, it is determined whether the configuration permission corresponding to the access information includes the access permission to the target file. If it includes the access permission to the target file, it can be determined that the application has the access permission to the target file.
[0053] In one embodiment, Figure 1As shown, the operating system also includes an access control application 113 connected to the access control server 130, and the access control application 113 is arranged in the user space. Here, the user space can communicate with the kernel in the Netlink manner, so that the access control application 113 can communicate with the access control server 130 through Netlink. It should be noted that Netlink is a communication mechanism for the Linux kernel, and Netlink consists of a standard Socket interface in the user space and a kernel API provided by the kernel module. The Netlink socket is a special inter-process communication (IPC) for realizing communication between the user process and the kernel process. The access control application 113 can use Netlink to communicate with the access control server 130 through the standard SocketAPI.
[0054] The access control application 113 can obtain the configuration file configured by the user, obtain the permission configuration information from the configuration file, and send the permission configuration information to the access control server 130. After receiving the permission configuration information sent by the access control application 113, the access control server 130 can update the corresponding permission item in the permission table based on the permission configuration information. Here, the configuration file can include one or more configuration items, each of which can respectively include a corresponding file path string, a user identifier, an application path string, and a permission string. In one implementation, one or more configuration items in the configuration file can be implemented as, for example:
[0055] / etc / passwd:1000: / usr / bin / cat:r
[0056] / etc / group:1000: / usr / bin / vim:rw
[0057] …
[0058] It can be understood that the permission table in the access control server 130 is actually created based on the permission configuration information provided by the access control application.
[0059] In one implementation, when the access control server 130 queries the permission items in the permission table based on the access information, the access control server 130 may query the corresponding permission items in the permission table based on one or more of the access information (target file path, user ID, application path) of the application 110. For example, the permission table may be queried based on all the access information (file_path:uid:process_path), and the permission table may be queried based on the target file path and user ID (file_path:uid:*) in the access information, and the permission table may be queried based on the target file path (file_path:*:*) in the access information.
[0060] After querying the permission item corresponding to the access information of the application 110, the access control server 130 determines by comparison whether the permission configuration in the permission item includes the access rights of the application 110 to the target file. If the permission configuration does not include the access rights to the target file, the access control server 130 can send a log of the failure to check the access rights to the access control application 113 to notify the user that the application 110 does not have the access rights to the target file, so that the user can track the failed access.
[0061] In one embodiment, the application 110 sends a corresponding access request to the file system 120 based on the type of operation on the target file. For example, when the application 110 performs an operation to open the target file, it sends an open request for the target file to the file system 120; when the application 110 performs an operation to delete the target file, the file system sends a delete request for the target file. In other words, the access request can be an open request for the target file or a delete request for the target file. However, it should be noted that the present invention is not limited to the open operation and the delete operation on the target file.
[0062] Accordingly, when the file system 120 receives an access request from the application 110, it is necessary to check the access rights of the application according to the type of the access request. Specifically, when the access request to the target file sent by the application 110 is a request to open the target file, the access control server 130 checks whether the application has the right to open the target file, wherein after determining the right configuration corresponding to the access information based on the right configuration table, it is determined whether the application 110 has the right to open the target file by judging whether the right configuration includes the right to open the target file. If it is determined that the application 110 has the right to open the target file, the target file is opened by the file system 120 and returned to the application 110.
[0063] When the access request to the target file sent by the application 110 is a request to delete the target file, the access control server 130 checks whether the application has the right to delete the target file, wherein after determining the right configuration corresponding to the access information based on the right configuration table, it is determined whether the application 110 has the right to delete the target file by judging whether the right configuration includes the right to delete the target file. If it is determined that the application 110 has the right to delete the target file, the target file is deleted through the file system 120.
[0064] In one embodiment, if it is determined that the application has access rights to the target file, and the access rights are rights to open the target file, the permission control file system 122120 may call an open callback function of the underlying file system 123, such as the ext4_file_open function, so as to open the target file of the underlying file system 123 based on the open callback function. Furthermore, the opened target file is returned to the virtual file system 121, so as to be returned to the application through the virtual file system 121.
[0065] According to the file access control system 100 of the present invention, a new file system structure is formed by creating a permission control file system based on a stacked file system structure between the underlying file system and the virtual file system. Based on this new file system structure, the permission control file system can intercept the application's access to the underlying file system, and detect the application's access rights through the access control server, thereby realizing flexible control of the application's access rights to the underlying file system without relying on a specific file system, thereby ensuring the data security of the underlying file system.
[0066] Furthermore, the access control server can determine the corresponding configuration permissions based on the permission table, and judge whether the application has the access permissions to the target file by comparing the configuration permissions and the access permissions required to operate the target file. By storing the permission configuration data in the permission table, it is not dependent on a specific file system, so that the file access control scheme of the present invention can be generally applicable to various operating systems and has a wider applicability. Moreover, based on the access control application, the configuration permission data in the permission table can be flexibly configured and updated to update the application's access permissions to the file.
[0067] In one embodiment, the computing device on which the file access control system 100 resides may be implemented as a computing device 200 , so that the file access control method of the present invention may be executed in the computing device 200 .
[0068] Figure 2 A schematic diagram of a computing device 200 according to one embodiment of the present invention is shown.
[0069] like Figure 2 As shown, in a basic configuration 202, computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between processor 204 and system memory 206.
[0070] Depending on the desired configuration, the processor 204 can be any type of processing, including but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 204 can include one or more levels of cache such as a primary cache 210 and a secondary cache 212, a processor core 214, and registers 216. An example processor core 214 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 218 can be used with the processor 204, or in some implementations, the memory controller 218 can be an internal part of the processor 204.
[0071] Depending on the desired configuration, the system memory 206 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 206 may include an operating system 220, one or more applications 222, and program data 224. The application 222 is actually a plurality of program instructions, which are used to instruct the processor 204 to perform corresponding operations. In some embodiments, the application 222 can be arranged to cause the processor 204 to operate using the program data 224 on the operating system.
[0072] Computing device 200 also includes storage device 232 , which includes removable storage 236 and non-removable storage 238 .
[0073] The computing device 200 may also include a storage interface bus 234. The storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to the basic configuration 202 via the bus / interface controller 230. At least a portion of the operating system 220, the application 222, and the data 224 may be stored on the removable storage 236 and / or the non-removable storage 238, and when the computing device 200 is powered on or the application 222 is to be executed, it is loaded into the system memory 206 via the storage interface bus 234 and executed by the one or more processors 204.
[0074] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via the bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via a network communication link via one or more communication ports 264.
[0075] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be performed in the signal in a manner that encodes information. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0076] In an embodiment according to the present invention, the computing device 200 is configured to execute the file access control method 300 according to the present invention. The operating system of the computing device 200 includes a plurality of program instructions for executing the file access control method 300 of the present invention, so that the file access control method 300 of the present invention can be executed in the operating system of the computing device 200.
[0077] According to one embodiment of the present invention, a file access control system 100 resides in the computing device 200, and the file access control system 100 is arranged in the kernel of the operating system of the computing device 200. The file access control system 100 includes a plurality of program instructions for executing the file access control method 300, and these program instructions can instruct the processor 204 to execute the file access control method 300 of the present invention, so that the file access control method 300 of the present invention can be executed in the file access control system 100.
[0078] As described above, in an embodiment according to the present invention, one or more application programs 110 may be arranged on the operating system. Here, the operating system includes a kernel and a user space arranged on the kernel, the file access control system 100 is arranged in the kernel of the operating system, and one or more application programs 110 are arranged in the user space of the operating system and can communicate with the kernel. Among them, the file access control system 100 includes a file system 120 and an access control server 130, and the file system 120 is connected to the access control server 130 for communication.
[0079] It should be noted that the present invention does not specifically limit the type of operating system. For example, the operating system can be implemented as a Linux operating system or a Windows operating system. It should be noted that the Linux operating system is an operating system based on the Linux kernel, which is an open source Unix-like operating system macro kernel. The following only takes the Linux operating system as an example to describe the file access control method 300 of the present invention in detail.
[0080] Figure 3 The flowchart of a file access control method 300 according to an embodiment of the present invention is shown. The method 300 is suitable for being executed in the file access control method 100.
[0081] like Figure 3 As shown, the method 300 starts at step S310 .
[0082] In step S310, the file system 120 receives access requests from one or more applications 110 to the target file. Here, the access request includes access information of the application 110. The file system 120 obtains the access information of the application 110 from the access request, so as to determine whether the application 110 has access rights to the target file according to the access information. Specifically, the file system 120 may send the access information of the application 110 to the access control server 130, so as to request the access control server 130 to check the access rights of the application 110 based on the access information, and determine whether the application 110 has access rights to the target file.
[0083] Then, in step S320, the access control server 130 checks the access rights of the application based on the access information. Specifically, the configuration rights corresponding to the access information are determined based on the rights table, and whether the application 110 has access rights to the target file is determined based on the configuration rights.
[0084] In step S330, when it is determined that the application has access rights to the target file, the file system 120 returns the target file to the application 110. Here, if it is determined that the application 110 has access rights to the target file, the access control server 130 may return a message to the file system 120 indicating that the application has access rights to the target file system, that is, a message indicating that the access rights check is successful. In one embodiment, when the access request of the application is a request to open the target file, the target file is opened and the opened target file is returned to the application 110.
[0085] According to one embodiment of the present invention, the file system 120 includes an underlying file system 123, a virtual file system 121, and a permission control file system 122 arranged between the underlying file system 123 and the virtual file system 121. In this way, by constructing the permission control file system 122 between the underlying file system 123 and the virtual file system 121, a new file system structure is formed in which the permission control file system 122 is arranged on the underlying file system 123 and the virtual file system 121 is arranged on the permission control file system 122. The upper layer of the virtual file system 121 is the user space, which can communicate with one or more applications in the user space. It should be pointed out that the permission control file system 122 is a stacked file system, which does not store file data itself, and is arranged on the underlying file system 123 based on the structure of the stacked file system, so that the permission control file system 122 can intercept the application 110's access to the underlying file system 123 and detect the access rights of the application 110, so as to control the application 110's access to the underlying file system 123.
[0086] The virtual file system 121 may receive an access request for a target file of the underlying file system 123 sent by the application 110, and send the access request to the permission control file system 122 connected thereto, which intercepts the access request and performs permission detection. The permission control file system 122 may obtain access information of the application 110 from the access request, and request the access control server 130 to check the access rights of the application based on the access information of the application 110.
[0087] In one implementation, the permission control file system 122 checks the access permission of the application 110 by calling the check_file_access_permission function in the access control server 130 .
[0088] According to one embodiment of the present invention, the access control server 130 pre-creates a permission table, in which permission configuration information of all files can be stored. The permission table includes one or more permission items, each of which includes access information and configuration permissions associated with the access information. In other words, the permission item is established based on the association between the access information and the configuration permissions. It should be noted that by storing the permission configuration data in the permission table, it is not dependent on a specific file system, so that the file access control scheme of the present invention can be generally applicable to various operating systems.
[0089] In one embodiment, the access information in each permission item may include a file path, a user identifier, and an application path. In this way, the corresponding permission item in the permission table can be queried based on one or more information in the file path, the user identifier, and the application path, and the configuration permission in the permission item can be obtained. The access control server 130 can query the permission table through the check_file_access_permission function, determine the configuration permission corresponding to the access information based on the permission table, and judge whether the application 110 has access rights to the target file based on the configuration permission. Here, it should be pointed out that the permission items in the permission table are described based on the file path, the user identifier, and the application path. In this way, the file permission can be set based on a single user, thereby refining the granularity of the permission configuration. In addition, when performing permission judgment, it can be processed in combination with the application information, thereby supporting the file permission setting based on the application accessing the file, and improving the scope of the permission setting.
[0090] Accordingly, the access information of the application 110 may include the target file path, the user identifier, and the path of the application 110. The access control server 130 may query the permission table based on the access information of the application 110 to determine the permission item and the configuration permission corresponding to the access information. Further, it is determined whether the configuration permission corresponding to the access information includes the access permission to the target file. If it includes the access permission to the target file, it can be determined that the application has the access permission to the target file.
[0091] According to one embodiment of the present invention, Figure 1As shown, the user space of the operating system also includes an access control application 113. The access control application 113 can communicate with the access control server 130 through Netlink. The access control application 113 can obtain a configuration file configured by the user, obtain permission configuration information from the configuration file, and send the permission configuration information to the access control server 130. After receiving the permission configuration information sent by the access control application 113, the access control server 130 can update the corresponding permission item in the permission table based on the permission configuration information. It can be understood that the permission table in the access control server 130 is actually created based on the permission configuration information provided by the access control application.
[0092] In one implementation, when the access control server 130 queries the permission items in the permission table based on the access information, the access control server 130 may query the corresponding permission items in the permission table based on one or more of the access information (target file path, user ID, application path) of the application 110. For example, the permission table may be queried based on the entire access information (file_path:uid:process_path) first, and then the permission table may be queried based on the target file path and user ID (file_path:uid:*) in the access information, and the permission table may also be queried based on the target file path (file_path:*:*) in the access information.
[0093] After querying the permission item corresponding to the access information of the application 110, determine whether the permission configuration in the permission item includes the access rights of the application 110 to the target file. If the permission configuration does not include the access rights to the target file, it means that the access right check has failed. The access control server 130 can then send a log of the failure to check the access right to the access control application 113 to notify the user that the application 110 does not have the access rights to the target file.
[0094] According to an embodiment of the present invention, the application 110 may send a corresponding access request to the file system 120 based on the type of operation on the target file. When the application 110 performs an operation to open the target file, it sends an open request for the target file to the file system 120; when the application 110 performs an operation to delete the target file, the file system sends a delete request for the target file. In other words, the access request may be a request to open the target file or a request to delete the target file.
[0095] Accordingly, when the file system 120 receives an access request from the application 110, it is necessary to check the access rights of the application according to the type of the access request. Specifically, when the access request to the target file sent by the application 110 is a request to open the target file, the access control server 130 checks whether the application has the right to open the target file, wherein after determining the right configuration corresponding to the access information based on the right configuration table, it is determined whether the application 110 has the right to open the target file by judging whether the right configuration includes the right to open the target file. If it is determined that the application 110 has the right to open the target file, the target file is opened by the file system 120 and returned to the application 110.
[0096] When the access request to the target file sent by the application 110 is a request to delete the target file, the access control server 130 checks whether the application has the right to delete the target file, wherein after determining the right configuration corresponding to the access information based on the right configuration table, it is determined whether the application 110 has the right to delete the target file by judging whether the right configuration includes the right to delete the target file. If it is determined that the application 110 has the right to delete the target file, the target file is deleted through the file system 120.
[0097] It should be noted that the present invention is not limited to the opening and deleting operations on the target file. In some other embodiments, the operation type of the application 110 on the file can also be based on the index node operation, and the index node operation type includes, for example, creating a new file, creating a link, canceling a link, creating a symbolic link, deleting a command, renaming, and the like. Specifically, the index node operation is described by the struct inode_operations structure. Based on the index node operation types listed above, the specific description of struct inode_operations can be implemented as:
[0098]
[0099] Figure 4 A timing diagram corresponding to a file access control method 300 according to an embodiment of the present invention is shown.
[0100] like Figure 4As shown, in one implementation, the access request sent by the application 110 is a request to open the target file sent to the virtual file system 121 when performing an operation to open the target file. The application 110 may execute a system call open and enter the do_sys_open function of the virtual file system 121. The do_sys_open function will complete some common UNIX file permission checks and some common open operations, and then the vfs_open function of the virtual file system 121 will call the open callback function registered by the permission control file system 122 to request the permission control file system 122 to open the target file through the open function.
[0101] Subsequently, the open function of the permission control file system 122 calls the check_file_access_permission function of the access control server, so as to check the access permission of the application to the target file system (i.e., the permission to open the target file) through the check_file_access_permission function of the access control server. Specifically, the access control server queries the permission table through the check_file_access_permission function, determines the configuration permission corresponding to the access information based on the permission table, and determines whether the application 110 has the permission to open the target file according to the configuration permission.
[0102] If the permission check fails, the access control server 130 may send a log of the permission check failure to the access control application 113 to notify the user that the application 110 does not have the permission to open the target file, and the access control application 113 may save the log. In addition, the access control server 130 returns the result of the permission check failure to the permission control file system 122 based on the open function of the permission control file system 122.
[0103] If the permission check succeeds, the access control server 130 returns the result of the permission check success to the permission control file system 122 based on the open function of the permission control file system 122. Subsequently, the open function of the permission control file system 122 calls the open callback function registered by the underlying file system 123, such as the ext4_file_open function, so as to open the target file of the underlying file system 123 based on the ext4_file_open function. In addition, the permission control file system 122 obtains the opened target file and returns the opened target file to the virtual file system 121, and then the virtual file system 121 returns the opened target file to the application 110.
[0104] According to the file access control method 300 of the present invention, it is possible to intercept the application's access to the underlying file system, and detect the application's access rights through the access control server, thereby achieving flexible control of the application's access rights to the underlying file system without relying on a specific file system, thereby ensuring the data security of the underlying file system. Furthermore, the corresponding configuration permissions are determined based on the permission table, and by comparing the configuration permissions and the access rights required to operate the target file, it is determined whether the application has access rights to the target file. By storing the permission configuration data in the permission table, it is independent of the specific file system, so that the file access control scheme of the present invention can be generally applied to various operating systems and has a wider applicability. Moreover, based on the access control application, it is possible to flexibly configure and update the configuration permission data in the permission table so as to update the application's access rights to the file.
[0105] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0106] In the case where the program code is executed on a programmable computer, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the file access control method of the present invention according to the instructions in the program code stored in the memory.
[0107] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0108] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0109] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0110] Similarly, it should be understood that in order to streamline the disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the invention.
[0111] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0112] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0113] Furthermore, those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0114] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0115] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0116] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative and not restrictive with respect to the scope of the present invention, and the scope of the present invention is defined by the appended claims.
Claims
1. A file access control system, arranged in an operating system, wherein one or more application programs are arranged on the operating system, and the file access control system comprises: A file system, adapted to receive an access request from an application to a target file, wherein the access request includes access information of the application, wherein the file system includes: The underlying file system; an authority control file system, arranged on the underlying file system based on a stacked file system structure, so as to intercept an application's access request to the underlying file system and request an access control server to check the access rights of the application based on the access information; and A virtual file system is arranged on the permission control file system, the virtual file system is connected to one or more application programs, and is adapted to receive access requests to target files of the underlying file system sent by the application programs, and send the access requests to the permission control file system; an access control server connected to the permission control file system of the file system, adapted to receive a request sent by the permission control file system of the file system to check the access rights of the application based on the access information, and adapted to determine the configuration rights corresponding to the access information based on the permission table, and determine whether the application has the access rights to the target file according to the configuration rights; Wherein, when it is determined that the application has access rights to the target file, the file system is adapted to return the target file to the application.
2. The system of claim 1, wherein: The permission control file system is suitable for: When it is determined that the application has access rights to the target file, calling an open callback function of the underlying file system, so as to open the target file of the underlying file system based on the open callback function; as well as The opened target file is returned to the virtual file system, so that the opened target file is returned to the application through the virtual file system.
3. The system of claim 1, wherein: The access control server includes a permission table, the permission table includes one or more permission items, each permission item includes a type of access information and a corresponding configuration permission, and the access control server is suitable for: querying a permission table based on the access information to determine permission items and configuration permissions corresponding to the access information; It is determined whether the configuration permission includes access permission to the target file; if so, it is determined that the application has access permission to the target file.
4. The system according to any one of claims 1 to 3, wherein: The access information includes a target file path, a user identifier, and an application program path.
5. The system of claim 2, wherein: The file access control system also includes: an access control application, arranged on the operating system, the access control application being connected to the access control server, adapted to obtain a configuration file, obtain permission configuration information from the configuration file, and send the permission configuration information to the access control server; The access control server is adapted to update a permission table based on the permission configuration information.
6. The system of claim 5, wherein: The access control server is adapted to send a log of failure to check access rights to the access control application when it is determined that the application program does not have access rights to the target file.
7. A file access control method, executed in a file access control system, the file access control system being arranged in an operating system, the file access control system comprising a file system and an access control server connected to the file system, the operating system being arranged with one or more application programs, the method comprising the steps of: An access request for a target file from an application is received through a file system, wherein the access request includes access information of the application, wherein: The file system comprises: The underlying file system; an authority control file system, arranged on the underlying file system based on a stacked file system structure, so as to intercept an application's access request to the underlying file system and request an access control server to check the access rights of the application based on the access information; and A virtual file system is arranged on the permission control file system, the virtual file system is connected to one or more application programs, and is adapted to receive access requests to target files of the underlying file system sent by the application programs, and send the access requests to the permission control file system; receiving, through an access control server, a request sent by the permission control file system of the file system to check the access permission of the application program based on the access information, and checking the access permission of the application program based on the access information, wherein the access control server is adapted to determine, based on a permission table, a configuration permission corresponding to the access information, and determine, according to the configuration permission, whether the application program has the access permission to the target file; and If it is determined that the application has the access right to the target file, the target file is returned to the application through the file system.
8. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to claim 7.
9. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to claim 7.
