System and method for keeping command line permissions and page permissions consistent
By establishing the corresponding relationship between the page menu_id and the module ID to which the command belongs in the kernel linked list, the problem of inconsistent command line and page permissions in the existing technology is solved, unified management of permissions is achieved, development efficiency is improved, and user unauthorized access is avoided.
Patent Information
- Application Number
- CN202111265212.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-10-28
AI Technical Summary
When the existing technology realizes the consistency of command line and page permissions, it is necessary to completely re-develop the page function, resulting in a large amount of development, and cannot be applied to the situation where the page function and the command line are independent of each other, and cannot effectively prevent users from accessing the device without authorization.
Generate a global two-dimensional array to store the page menu_id and the module ID to which the command belongs in correspondence with each other, and save the page menu_id, user configuration range ID, the permissions corresponding to the page menu_id and the module ID to which the command belongs in the kernel linked list to establish the relationship between the command line command and the page. Correspondence table enables two independent modules to use the same authority authentication method.
It realizes the unified management of command line and page permissions, prevents users from accessing the device without permission, simplifies the development process, and ensures the consistency of permissions.
Smart Images

Figure CN113987439B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a system and method for keeping command line permissions and page permissions consistent, and more particularly to a system and method for keeping command line permissions and page permissions consistent by storing page menu_id and command module ID in a kernel linked list in correspondence with each other. Background Art
[0002] With the development of society, customers pay more and more attention to network security, requiring that users have consistent execution permissions regardless of whether they log in to the device from the device page or the device command line, so as to ensure that users do not manage the device beyond their authority.
[0003] The existing technical solution is to set access control information in the accessed device on the network side, establish an account and access control information for each accessing user, and store the information in an access control policy table. If the network side device receives management and maintenance information sent by the accessing user, it controls the management and maintenance operations of the accessing user by querying the access control information stored in the access control policy table based on the management and maintenance information.
[0004] The existing solution uses the same access permission authentication and access control for command line or page management and maintenance. The way to keep the command line and page permissions consistent is that all functions on the page are implemented through background commands, so that the page and command line permissions can also be unified. However, this implementation method is not suitable for situations where the page function implementation and the command line implementation are independent of each other. If this method is used, the page function needs to be completely redeveloped, which requires a large amount of development.
[0005] Therefore, a technical solution is needed to make command line permissions consistent with page permissions to prevent users from unauthorized access to devices. Summary of the invention
[0006] In order to solve the above-mentioned problems in the prior art, the present disclosure proposes a system and method for keeping command line permissions and page permissions consistent.
[0007] According to one aspect of the present disclosure, a system is proposed to keep command line permissions and page permissions consistent, the system comprising: a global two-dimensional array generation part, the two-dimensional array generation part is used to save the page menu_id and the command module ID corresponding to each other; and a kernel linked list generation part, which is used to find the command module ID corresponding to the page menu_id according to the global two-dimensional array, and save the page menu_id, the user configuration range ID, the permissions corresponding to the page menu_id, and the command module ID corresponding to the page menu_id into the kernel linked list.
[0008] According to an embodiment of the present disclosure, in the two-dimensional array, all command lines under a page menu_id are configured with a unique command module ID, and the two are in one-to-one correspondence.
[0009] According to an embodiment of the present disclosure, the kernel linked list is generated when the system configuration is restarted, the system configuration is restored, or the configuration is sent by a page or command line.
[0010] According to an embodiment of the present disclosure, the permissions corresponding to the page menu_id include read-only, read-write, and no permission.
[0011] According to an embodiment of the present disclosure, the module ID to which the command belongs is a WEB_MODULE_INVALID indicator, and the indicator WEB_MODULE_INVALID is used to indicate that the corresponding command does not have a module to which the command belongs, and is used to determine how the command is executed.
[0012] According to an embodiment of the present disclosure, if the module ID to which the command belongs is not the WEB_MODULE_INVALID indicator, the permission corresponding to the command is found in the kernel linked list C according to the module ID to which the command belongs and the configuration range ID of the administrator. If it is write permission, the command can continue to execute, otherwise it prompts that there is no operation permission and the command execution ends.
[0013] According to an embodiment of the present disclosure, the user configuration range includes Super configuration, System configuration, Business configuration, Log configuration, and Readonly configuration, wherein the Super configuration refers to the highest management authority of the system, and an account that can execute Super configuration has configuration management authority for all functional modules of the system, an account that can execute System configuration has configuration management authority for the system, an account that can execute Business configuration has configuration management authority for the system's business modules, an account that can execute Log configuration has configuration access authority for system-related log modules, and an account that can execute Readonly configuration has viewing authority for related modules.
[0014] According to another aspect of the present disclosure, a method for making command line permissions and page permissions consistent is provided, and the method is executed in such a system, the system includes a global two-dimensional array generation part, the two-dimensional array generation part is used to store page menu_id and command module ID in correspondence with each other; and a kernel linked list generation part, which is used to find the command module ID corresponding to the page menu_id according to the corresponding relationship of the global two-dimensional array, and save the page menu_id, the user (administrator) configuration range ID, the permission corresponding to the page menu_id, and the command module ID corresponding to the page menu_id into the kernel linked list. The method includes the following steps: when a user logs in to the device command line to execute a command, the user configuration range ID is obtained according to the login user name, the command input by the user is parsed, and the corresponding command module ID is obtained; it is determined whether the command module ID is WEB _MODULE_INVALID indicator, the indicator WEB_MODULE_INVALID is used to indicate that the corresponding command does not have a module to which the command belongs, and is used to determine how the command is executed; if the command module ID to which the command belongs is WEB_MODULE_INVALID, the command continues to be executed until the command execution is completed; if the command module ID to which the command belongs is not the WEB_MODULE_INVALID indicator, the permission corresponding to the command is found in the kernel linked list according to the command module ID and the user configuration range ID to which the command belongs; it is determined whether there is write permission in the permission corresponding to the command found in the kernel linked list; if there is write permission in the permission corresponding to the command found in the kernel linked list, the command continues to be executed until the command execution is completed; and if there is no write permission in the permission corresponding to the command found in the kernel linked list, it is prompted that there is no operation permission and the command execution is terminated.
[0015] According to an embodiment of the present disclosure, the permissions corresponding to the page menu_id include read-only, read-write, and no permission.
[0016] According to an embodiment of the present disclosure, the user configuration range includes Super configuration, System configuration, Business configuration, Log configuration, and Readonly configuration, wherein the Super configuration refers to the highest management authority of the system, and an account that can execute Super configuration has configuration management authority for all functional modules of the system, an account that can execute System configuration has configuration management authority for the system, an account that can execute Business configuration has configuration management authority for the system's business modules, an account that can execute Log configuration has configuration access authority for system-related log modules, and an account that can execute Readonly configuration has viewing authority for related modules.
[0017] According to the above technical solution of the embodiment of the present disclosure, by establishing a correspondence table between command line commands and pages, the two independent modules use the same permission authentication method, and finally the command line permissions and page permissions are kept consistent. The device username and password page and command line are used uniformly, and there will be no conflict. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The present disclosure may be better understood by describing exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, in which:
[0019] Figure 1 is a table showing a system predefined configuration range according to an embodiment of the present disclosure;
[0020] Figure 2 is a block diagram showing a system for keeping command line permissions and page permissions consistent according to one embodiment of the present disclosure; and
[0021] Figure 3 is a flow chart illustrating a method for keeping command line permissions and page permissions consistent according to the present disclosure. DETAILED DESCRIPTION
[0022] The specific embodiments of the present disclosure will be described below. It should be noted that in the specific description of these embodiments, for the sake of concise description, this specification cannot provide a detailed description of all features of the actual embodiments.
[0023] It should be understood that in the actual implementation of any embodiment, as in the process of any engineering project or design project, in order to achieve the developer's specific goals and to meet system-related or business-related constraints, various specific decisions are often made, and this will also change from one embodiment to another.
[0024] In addition, it can be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in this disclosure, some design, manufacturing or production changes based on the technical contents of this disclosure are just conventional technical means and should not be understood as the contents of this disclosure being insufficient.
[0025] Unless otherwise defined, the technical terms or scientific terms used in the claims and the specification shall have the usual meanings understood by persons with ordinary skills in the technical field to which the present disclosure belongs. The words "one" or "an" and the like used in the patent application specification and the claims of the present disclosure do not indicate a quantitative limitation, but indicate the existence of at least one. The words "include" or "comprise" and the like mean that the elements or objects appearing before "include" or "comprises" include the elements or objects listed after "include" or "comprises" and their equivalent elements, and do not exclude other elements or objects.
[0026] According to the embodiments of the present disclosure, a "command" refers to a line of string expression formed by combining "keywords" and "parameters" in a certain order. Keywords can also be called common keywords, which refer to fixed words used to represent the specific meanings of subsequent parameters. Parameters refer to variable configuration parameters. For example: no ip address 192.168.0.1 / 16, where no, ip, and address are all keywords, and 192.168.0.1 / 16 is a parameter.
[0027] According to an embodiment of the present disclosure, a "command line" is a service program running on a device that provides functions such as parsing commands and executing commands.
[0028] According to an embodiment of the present disclosure, "command registration" is a process of saving information such as a command prototype, a command description, and a module to which the command belongs into an array.
[0029] According to the embodiments of the present disclosure, a "two-dimensional array" is a data structure that can store a corresponding relationship, such as storing the corresponding relationship between the module ID to which a command belongs and the page menu_id. One page menu_id corresponds to a page menu_id, that is, the page menu_id value uniquely identifies a page.
[0030] According to an embodiment of the present disclosure, a “linked list” is a data structure that can store data.
[0031] According to the embodiments of the present disclosure, the Linux system is divided into user state and kernel state, and generally the kernel state function execution speed is higher than the user state. Saving data to the kernel linked list is much faster than saving it to the database.
[0032] According to an embodiment of the present disclosure, in order to keep the command line permissions and page permissions consistent, a global two-dimensional array is configured in the kernel linked list. The two-dimensional array is used to save the page menu_id and the module ID to which the command belongs. All command lines under a page menu_id are configured with a unique command module ID, and the two are one-to-one corresponding. When configuring restart, configuration recovery, or sending a page or command line configuration, the command module ID corresponding to the page menu_id is found according to the correspondence of the global two-dimensional array, and the page menu_id, the user (administrator) configuration range ID, the permissions corresponding to the page menu_id, and the command module ID corresponding to the page menu_id are saved in the kernel linked list.
[0033] According to an embodiment of the present disclosure, the permissions corresponding to the page menu_id include read-only, read-write, and no permission.
[0034] The module ID to which the command belongs may or may not be the WEB_MODULE_INVALID indicator, which is used to indicate that the corresponding command has no module to which the command belongs.
[0035] If the module ID to which the command belongs is the indicator WEB_MODULE_INVALID, it means that the command can continue to be executed until the command execution is completed.
[0036] If the module ID to which the command belongs is not the indicator WEB_MODULE_INVALID, then the permission corresponding to the command is found in the kernel linked list according to the module ID to which the command belongs and the user configuration range ID. If the permission corresponding to the command has write permission, the command can continue to be executed, otherwise it will prompt that there is no operation permission and the command execution ends.
[0037] Figure 1 It is a table showing the configuration range predefined by the system according to an embodiment of the present disclosure. As shown in the figure, according to the embodiment of the present disclosure, the system predefines five basic operation permissions (configuration ranges): Super configuration, System configuration, Business configuration, Log configuration, and Readonly configuration. Through the reasonable allocation of permissions, users (administrators) with different responsibilities can only access functional modules within the scope of this permission, which enhances the confidentiality of the system and is an effective security management method.
[0038] According to the embodiments of the present disclosure, Super configuration refers to the highest management authority of the system, and an account that can execute Super configuration has configuration management authority for all functional modules of the system.
[0039] According to an embodiment of the present disclosure, an account that can execute System configuration has the configuration management authority of the system.
[0040] According to an embodiment of the present disclosure, an account that can execute Business configuration has configuration management authority for the system business module.
[0041] According to an embodiment of the present disclosure, an account that can execute Log configuration has configuration access rights for system-related log modules.
[0042] According to an embodiment of the present disclosure, an account that can execute Readonly configuration has viewing authority for related modules.
[0043] According to the embodiments of the present disclosure, the system supports customized management permissions, so that users (administrators) can flexibly customize the configuration access permissions corresponding to user accounts according to actual management needs, so that access to various business modules of the system can be more effectively controlled.
[0044] Figure 2 1 is a block diagram showing a system for keeping command line permissions and page permissions consistent according to an embodiment of the present disclosure. The system includes a global two-dimensional array generation part 210, and the two-dimensional array generation part 210 saves the page menu_id and the module ID to which the command belongs in correspondence with each other when the configuration is restarted, the configuration is restored, or the page or command line is issued. The two-dimensional array is used to save the page menu_id and the module ID to which the command belongs. All command lines under a page menu_id are configured with a unique module ID to which the command belongs, and the two are one-to-one corresponding. When the configuration is restarted, the configuration is restored, or the page or command line is issued, the module ID to which the command corresponding to the page menu_id is found according to the corresponding relationship of the global two-dimensional array, and the page menu_id, the user (administrator) configuration range ID, the permissions corresponding to the page menu_id, and the module ID to which the command corresponding to the page menu_id are saved in the kernel linked list.
[0045] The system also includes a kernel linked list generating part 220. The kernel linked list generating part 220 can find the module ID of the command corresponding to the page menu_id according to the global two-dimensional array, and save the page menu_id, the user configuration range ID, the authority corresponding to the page menu_id, and the module ID of the command corresponding to the page menu_id into the kernel linked list.
[0046] Figure 3 is a flow chart showing a method for making command line permissions and page permissions consistent according to the present disclosure. Figure 3 In step S301, a user (administrator) logs into the device command line.
[0047] According to an embodiment of the present disclosure, in step S302, a user configuration scope ID is obtained according to the login user name.
[0048] According to an embodiment of the present disclosure, in step S303, the user executes a command in the command line.
[0049] According to an embodiment of the present disclosure, in step S304, the command line framework parses the command input by the user and obtains the module ID to which the corresponding command belongs.
[0050] According to an embodiment of the present disclosure, in step S305, it is determined whether the module ID to which the command belongs is WEB_MODULE_INVALID, and the WEB_MODULE_INVALID indicates that the command does not belong to a module, so no permission check is required.
[0051] If it is determined in step S305 that the module ID to which the command belongs is WEB_MODULE_INVALID, the command continues to be executed in step S106 until the command execution is completed in step S310.
[0052] If it is determined in step S305 that the command module ID to which the command belongs is not WEB_MODULE_INVALID, then in step S107, the permission corresponding to the command is found in the kernel linked list according to the command module ID to which the command belongs and the configuration scope ID of the user (administrator), and in step S108, it is determined whether there is write permission.
[0053] If it is determined in step S308 that there is write permission, the process jumps to step S306 and the command can continue to be executed until the command execution is completed in step S310.
[0054] If it is determined in step S308 that there is no write permission, the process jumps to step S309, prompting that there is no operation permission, and proceeds to step S310 to complete the command execution.
[0055] According to an embodiment of the present disclosure, the method for keeping command line permissions and page permissions consistent according to the present disclosure is performed in a system configured according to an embodiment of the present disclosure to keep command line permissions and page permissions consistent.
[0056] According to the above technical solution of the embodiment of the present disclosure, by establishing a correspondence table between command line commands and pages, the two independent modules use the same permission authentication method, and finally the command line permissions and page permissions are kept consistent. The device username and password page and command line are used uniformly, and there will be no conflict.
[0057] In summary, based on the prior art, the present disclosure adds a global two-dimensional array A to save menu_id and the module ID to which the command belongs. The module ID to which all command line configuration commands under a menu_id belong is unique, and the two are one-to-one corresponding. When configuring the restart configuration recovery or the page or command line to send the configuration, find the module ID corresponding to the menu_id according to the correspondence of the global two-dimensional array A, and save the menu_id, user configuration range ID, permissions corresponding to the menu_id, and module ID corresponding to the menu_id into the kernel linked list C. That is, by establishing a correspondence table between command line commands and pages, it is achieved that two independent modules use the same permission authentication method, and ultimately the command line permissions are consistent with the page permissions. The device username and password page and command line are used uniformly, and there will be no conflict.
[0058] The administrator logs in to the device command line and obtains the administrator configuration scope ID according to the name of the logged-in administrator. The administrator executes command B in the command line. The command line framework parses the command entered by the administrator and obtains the corresponding command ID to determine whether the module ID is WEB_MODULE_INVALID. WEB_MODULE_INVALID indicates that the command does not belong to a module and does not require permission check. If the module ID to which the command belongs is WEB_MODULE_INVALID, the command continues to execute until the command execution ends. If the module ID to which the command belongs is not WEB_MODULE_INVALID, the permission corresponding to the command is found in the kernel linked list C according to the module ID to which the command belongs and the administrator's configuration scope ID. If it is write permission, the command can continue to execute, otherwise it prompts that there is no operation permission and the command execution ends.
[0059] According to the system disclosed in the present invention, five basic permissions are predefined: Super, System configuration, Business configuration, Log configuration, and Readonly. Through the reasonable allocation of permissions, managers with different responsibilities can only access functional modules within the scope of their permissions, which enhances the confidentiality of the system and is an effective security management method. Among them, the Super role refers to the highest management authority of the system, and the account of this role has the configuration management authority of all functional modules of the system. The System configuration role refers to the configuration management authority of the system. The Business configuration role refers to the configuration management authority of the system's business modules. The Log configuration role refers to the configuration access authority of the system-related log modules. The Readonly role refers to the viewing authority of the relevant modules.
[0060] The system according to the present disclosure supports customized management permissions, so that users can flexibly customize the configuration access permissions corresponding to the administrator account according to actual management needs, so that the access to each business module of the system can be more effectively controlled. Each page has read-only, read-write, and no permissions.
[0061] By adopting the system disclosed in the present invention, command line permissions and page permissions are kept consistent, which prevents administrators from unauthorized access to devices. By establishing a mapping relationship, two or more independent access methods can achieve the same authentication permission control.
[0062] Therefore, the purpose of the present disclosure can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general-purpose device. Therefore, the purpose of the present disclosure can also be achieved by simply providing a program product containing a program code that implements the method or system. In other words, such a program product also constitutes the present disclosure, and a storage medium storing such a program product also constitutes the present disclosure. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future.
[0063] It should also be noted that, in the method of the present disclosure, it is obvious that each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present disclosure. In addition, the steps of performing the above-mentioned series of processes can naturally be performed in chronological order according to the order of description, but do not necessarily need to be performed in chronological order. Some steps can be performed in parallel or independently of each other.
[0064] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A system for keeping command line permissions and page permissions consistent, the system comprising: A global two-dimensional array generation part, which is used to store the page menu_id and the module ID to which the command belongs in correspondence with each other; as well as The kernel linked list generation part is used to find the module ID of the command corresponding to the page menu_id according to the global two-dimensional array, and save the page menu_id, the user configuration range ID, the authority corresponding to the page menu_id, and the module ID of the command corresponding to the page menu_id into the kernel linked list. When the module ID to which the command belongs is the WEB_MODULE_INVALID indicator, the indicator WEB_MODULE_INVALID is used to indicate that the corresponding command has no module to which the command belongs, and is used to determine how the command is executed; when the module ID to which the command belongs is not the WEB_MODULE_INVALID indicator, the permission corresponding to the command is found in the kernel linked list C according to the module ID to which the command belongs and the administrator's configuration range ID. If it is write permission, the command can continue to be executed, otherwise it is prompted that there is no operation permission and the command execution ends.
2. The system according to claim 1, wherein in the two-dimensional array, all command lines under a page menu_id are configured with a unique command module ID, and the two are in one-to-one correspondence.
3. The system according to claim 1, wherein the kernel linked list is generated when the system configuration is restarted, the system configuration is restored, or the configuration is sent by a page or command line.
4. The system according to claim 1, wherein the permissions corresponding to the page menu_id include read-only, read-write, and no permission.
5. The system according to claim 1, wherein the user configuration range includes Super configuration, System configuration, Business configuration, Log configuration, and Readonly configuration, wherein the Super configuration refers to the highest management authority of the system, an account that can execute Super configuration has configuration management authority for all functional modules of the system, an account that can execute System configuration has configuration management authority for the system, an account that can execute Business configuration has configuration management authority for the system's business modules, an account that can execute Log configuration has configuration access authority for system-related log modules, and an account that can execute Readonly configuration has viewing authority for related modules.
6. A method for making command line permissions and page permissions consistent, the method is performed in such a system, the system includes a global two-dimensional array generation part, the two-dimensional array generation part is used to store page menu_id and command module ID in correspondence with each other; and a kernel linked list generation part, which is used to find the command module ID corresponding to the page menu_id according to the corresponding relationship of the global two-dimensional array, and save the page menu_id, the user configuration range ID, the permissions corresponding to the page menu_id, and the command module ID corresponding to the page menu_id into the kernel linked list, the method comprising the following steps: When a user logs in to the device command line to execute a command, the user configuration scope ID is obtained according to the login user name, the command entered by the user is parsed, and the module ID to which the corresponding command belongs is obtained; Determine whether the module ID to which the command belongs is the WEB_MODULE_INVALID indicator, where the WEB_MODULE_INVALID indicator is used to indicate that the corresponding command does not have a module to which the command belongs, and is used to determine how the command is executed; If the module ID to which the command belongs is WEB_MODULE_INVALID, let the command continue to execute until the command execution is completed; If the command module ID to which the command belongs is not the WEB_MODULE_INVALID indicator, then find the permission corresponding to the command in the kernel list according to the command module ID and the user configuration range ID; Determine whether the permissions corresponding to the command found in the kernel linked list have write permissions; If the command found in the kernel linked list has write permission, the command will continue to be executed until the command execution is completed; If there is no write permission in the permissions corresponding to the command found in the kernel linked list, a prompt will be displayed indicating that there is no operation permission and the command execution will end.
7. The method according to claim 6, wherein the permissions corresponding to the page menu_id include read-only, read-write, and no permission.
8. The method according to claim 6, wherein the user configuration range includes Super configuration, System configuration, Business configuration, Log configuration, and Readonly configuration, wherein the Super configuration refers to the highest management authority of the system, and an account that can execute Super configuration has configuration management authority for all functional modules of the system, an account that can execute System configuration has configuration management authority for the system, an account that can execute Business configuration has configuration management authority for the system's business modules, an account that can execute Log configuration has configuration access authority for system-related log modules, and an account that can execute Readonly configuration has viewing authority for related modules.
