RADIUS protocol-based instruction authorization method and device, and medium
By using preset packet structure in the RADIUS protocol to assemble authorization instructions and send them to the RADIUS server for processing, the problem of inseparable authentication and authorization in the RADIUS protocol is solved, and efficient and secure account and permission management for network devices is achieved, reducing the number of users who are unable to separate authentication and authorization. The risk of sensitive data breaches.
Patent Information
- Application Number
- CN202411152808.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-21
AI Technical Summary
The authentication and authorization process of the RADIUS protocol cannot be separated, and the lack of a separate authorization process design results in command authorization requiring each instruction to interact separately, affecting network bandwidth usage and difficulty in supporting data expansion.
The authorization instructions based on the preset message structure are used to assemble the authorization instructions of the legality rules into RADIUS request messages, and send them to the RADIUS server for processing, and determine whether the instructions are executed based on the result message, realizing centralized management of instruction authorization.
It improves the management efficiency and security of device accounts and permissions, reduces the risk of sensitive data theft on the network, and realizes centralized management of authentication, authorization and billing of network devices through the RADIUS protocol.
Smart Images

Figure CN119071056A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a command authorization method, device and medium based on the RADIUS protocol. Background Art
[0002] AAA protocol (Authentication, Authorization, and Accounting) is a network security protocol used for network authentication, authorization and billing, in which the authorization and billing process can be further divided into command authorization billing and user authorization billing. AAA protocols include RADIUS protocol and TACACS protocol. In TACACS protocol, the transmission process of authorization message needs to establish a connection, which occupies a large network bandwidth, and cannot support data expansion well, and it is difficult to carry more information in the authorization message. RADIUS protocol uses UDP transmission, and the number of interactive messages required is less, which has less impact on network bandwidth. Therefore, in the process of network authorization, it is better to choose RADIUS protocol.
[0003] However, the authentication and authorization process of the RADIUS protocol is implemented together. The authorization information of the RADIUS protocol is often sent together with the Access-Request, that is, the authentication request message. Since the user authentication process only involves one RADIUS request message interaction from the beginning to the end, this process is suitable for user authentication and authorization. Command authorization requires each instruction to interact with the message separately to check whether the instruction is executable with the server, but RADIUS authentication and authorization cannot be separated, and there is a lack of separate authorization process design. Summary of the invention
[0004] In order to solve the above problems, this application proposes a command authorization method based on the RADIUS protocol, including:
[0005] Based on a preset message structure, assembling the authorization instruction that complies with the legality rule into a RADIUS request message to obtain a RADIUS request message corresponding to the authorization instruction;
[0006] The RADIUS request message is sent to a RADIUS server, and the authorization instruction in the RADIUS request message is extracted through the RADIUS server, and the authorization instruction is judged according to a configuration command set, and the judgment result is assembled into a result message for return;
[0007] The result message is received, and according to the result message, it is determined whether the authorization instruction is executed.
[0008] On the other hand, the present application also proposes a command authorization device based on the RADIUS protocol, including:
[0009] at least one processor; and,
[0010] a memory communicatively connected to the at least one processor; wherein,
[0011] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform, for example:
[0012] Based on a preset message structure, assembling the authorization instruction that complies with the legality rule into a RADIUS request message to obtain a RADIUS request message corresponding to the authorization instruction;
[0013] The RADIUS request message is sent to a RADIUS server, and the authorization instruction in the RADIUS request message is extracted through the RADIUS server, and the authorization instruction is judged according to a configuration command set, and the judgment result is assembled into a result message for return;
[0014] The result message is received, and according to the result message, it is determined whether the authorization instruction is executed.
[0015] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0016] Based on a preset message structure, assembling the authorization instruction that complies with the legality rule into a RADIUS request message to obtain a RADIUS request message corresponding to the authorization instruction;
[0017] The RADIUS request message is sent to a RADIUS server, and the authorization instruction in the RADIUS request message is extracted through the RADIUS server, and the authorization instruction is judged according to a configuration command set, and the judgment result is assembled into a result message for return;
[0018] The result message is received, and according to the result message, it is determined whether the authorization instruction is executed.
[0019] This application proposes a command authorization method based on the RADIUS protocol, which can bring the following beneficial effects:
[0020] By presetting the message structure and imitating the authentication and billing message type fields in the RADIUS protocol, the authorization instructions are assembled into authorization messages that can be recognized by the RADIUS protocol, and the authorization messages are sent to the RADIUS server. The RADIUS server authorizes the request messages, thereby realizing centralized management of the authentication, authorization and billing processes of network devices through the RADIUS protocol, making the management of device accounts and permissions more efficient and consistent, improving the security of the device authentication process, and reducing the risk of sensitive data being stolen on the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 A flowchart of a command authorization method based on the RADIUS protocol in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a specific flow chart of a command authorization method based on the RADIUS protocol in an embodiment of the present application;
[0024] Figure 3 This is a schematic diagram of a RADIUS request message example in an embodiment of the present application;
[0025] Figure 4 This is a schematic diagram of a command authorization device based on the RADIUS protocol in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0027] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0028] It should be noted that the AAA protocol (Authentication, Authorization, and Accounting) is a network security protocol used for network authentication, authorization and accounting, including the RADIUS (Remote Authentication DialIn User Service) protocol, the TACACS (Terminal Access Controller Access-Control System) protocol and the RESTCONF (Representational State Transfer Configuration) network management protocol. Among them, the TACACS protocol is a protocol widely used for network device identity authentication and access control, which can help network administrators manage user identities and permissions and improve network security and compliance. RESTCONF is a network management protocol based on the REST architectural style, which is used to configure and manage network devices. RESTCONF provides a lightweight, web-based management interface, making it easy to integrate with modern web development technologies and tools.
[0029] However, TACACS messages are transmitted using the TCP protocol, and a connection needs to be established during the transmission process, which occupies a large amount of network bandwidth. In addition, the tacacs protocol does not support TLV extensions well, making it difficult to carry more information in the authorization message. Restconf uses a web-based management interface instead of the traditional CLI to issue commands. Although executable commands can be restricted through the web, network devices need to be specially adapted for restconf commands. Not only do they need to parse their HTTP-style requests, but they also need to send the results in json format, which increases the workload of adapting new commands. Restconf itself does not even provide a method interface for command authorization, and requires additional adaptation of command restrictions.
[0030] like Figure 1 As shown, the embodiment of the present application provides a command authorization method based on the RADIUS protocol, including:
[0031] S101: Based on a preset message structure, assembling a RADIUS request message with an authorization instruction that complies with a legality rule to obtain a RADIUS request message corresponding to the authorization instruction.
[0032] Specifically, the network device pre-sets the preset message structure of the authorization command according to the message type fields of authentication and accounting in the RADIUS protocol. Among them, the preset message structure includes message type, required fields, and extended fields. The message type includes request message type, acceptance message type, and rejection message type. The corresponding fields can be Authorization-Command-Accept, Authorization-Command-Access, and Authorization-Command-Reject. Among them, the required fields include Authorize-command, Username, Service-Type, and Message-Authenticator. Authorize-command is the instruction information required for the authorization of the network device; Username is the user name for initiating the instruction authorization request; Service-Type is the service type, which usually needs to be specified as Authorize-Only type; Message-Authenticator is a message verification code, which is composed of information such as the RADIUS server key encrypted to increase the security of the message.
[0033] Furthermore, if Figure 2 As shown, the authorization instruction input by the user is obtained, and based on the preset legality rules, a preliminary check is performed on the authorization instruction to verify whether the authorization instruction is legal.
[0034] Specifically, the authorization instruction is decomposed, the command name in the authorization instruction is extracted, and the command name is queried in the preset command set. If the command name exists, the length and parameters of the authorization instruction are obtained, and the length and parameters are checked based on the command line syntax rules. The command line syntax rules include whether the format and syntax of the instruction are correct, whether the information contained in the instruction is complete and valid, and whether the instruction meets specific security policies, such as password complexity requirements, IP address range restrictions, etc.
[0035] Furthermore, after the authorization instruction passes the preliminary check, the authorization instruction is parsed to determine the parameter name, the parameters corresponding to the required fields, and the parameters corresponding to the extended fields in the authorization instruction, add a message verification code to the extended field, add a key to the authorization instruction through the message verification code, and assemble the authorization instruction based on the request message type to obtain a RADIUS request message.
[0036] It should be noted that the authorization request message is sent by the network device and received by the RADIUS server. It is used to apply for RADIUS authorization from the server. If the server verifies the message and authorizes the instruction, it replies with an acceptance message. If the server believes that the authorization message is illegal or the instruction is not allowed to be executed, it replies with a rejection message to indicate that the authorization process has failed.
[0037] For example, Figure 3 The following is a RADIUS request message corresponding to the authorization command in the preset message format. AVP-type is the type in the RADIUS attribute, that is, the Authorize-command defined above; AVP-len is the length in the RADIUS attribute, indicating the field length, which needs to include the 2 bytes in the header; arg-cnt indicates the number of parameters of the command, that is, the value of N in the subsequent arg_N_len and arg_N, ranging from 1 to 255; arg_N_len indicates the length of each parameter, which is arranged in the order of parameter input, and the number is arg-cnt, and the value range of each length is 1 to 255; arg_N indicates the parameter string. A complete network device command can often be divided into several English + number strings by spaces, and the length range of each parameter string is 1 to 255.
[0038] S102: Send the RADIUS request message to a RADIUS server, extract the authorization instruction in the RADIUS request message through the RADIUS server, judge the authorization instruction according to a configuration command set, assemble the judgment result into a result message and return it.
[0039] Specifically, after the network device assembles the authorization instruction, it obtains a RADIUS request message, and sends the RADIUS request message to the RADIUS server through the network. The RADIUS server parses the RADIUS request message, extracts the authorization instruction in the RADIUS request message, judges the authorization instruction according to the configuration command set, judges whether the authorization instruction is passed, and assembles the judgment result into a result message and returns it to the network device.
[0040] More specifically, in order to ensure that the RADIUS request message is not tampered with during transmission, the key in the RADIUS request message is obtained, and the key is verified by the RADIUS server.
[0041] Furthermore, after successful verification, the command name in the authorization instruction is determined, the configuration command set is called, and the command name is used as a query condition to perform a fuzzy query in the configuration command set to determine whether the command name exists in the configuration command set. If so, a pass result is generated, and based on the acceptance message type, the pass result is assembled into a RADIUS acceptance message, such as an Authorization-Command-Accept message, and the RADIUS acceptance message is returned. If not, an error message is output, and based on the rejection message type, the error message is assembled into a RADIUS rejection message, such as an Authorization-Command-Reject message, and the RADIUS rejection message is returned.
[0042] It should be noted that the RADIUS server is pre-configured with a configuration command set, which defines user permissions, access conditions and restrictions. The RADIUS server uses the configuration command set to verify the user's identity, check whether the user has the right to access the requested service, and evaluate the user's access time or bandwidth restrictions.
[0043] S103: Receive the result message, and determine whether the authorization instruction is executed according to the result message.
[0044] Specifically, the network device receives a result message from the RADIUS server, executes the authorization instruction when the result message is a RADIUS acceptance message, determines that the authorization instruction fails when the result message is a RADIUS rejection message, extracts error information from the RADIUS rejection message, and returns the error information to the device front-end interface.
[0045] It should be noted that when the network device sends a RADIUS request message to the RADIUS server, the network device is in a waiting state. While waiting for the RADIUS server to reply, the network device keeps waiting and is not allowed to issue other instructions again until the instruction gets a confirmed authorization result or the server reply times out. After the network device receives the result message, no matter what kind of reply message is received, the network device needs to stop waiting and take corresponding actions on the result message.
[0046] It should be noted that compared to TACACS, RADIUS has been deployed in many network environments due to the early network environment, and has better universality. The RADIUS protocol not only has attribute extension fields, but also vendor specific custom fields. Compared with tacacs, the field types are richer and can carry more useful information for interaction. Compared with Restconf, the RADIUS protocol is more friendly to the parsing of network devices. There is no need to develop RESTful interfaces. Command authorization can be performed by directly encapsulating instructions into messages. There is no need to push execution results. The parts that need to be adapted are relatively small, which is more flexible for developers.
[0047] By presetting the message structure and imitating the authentication and billing message type fields in the RADIUS protocol, the authorization instructions are assembled into authorization messages that can be recognized by the RADIUS protocol, and the authorization messages are sent to the RADIUS server. The RADIUS server authorizes the request messages, thereby realizing centralized management of the authentication, authorization and billing processes of network devices through the RADIUS protocol, making the management of device accounts and permissions more efficient and consistent, improving the security of the device authentication process, and reducing the risk of sensitive data being stolen on the network.
[0048] like Figure 4 As shown, the embodiment of the present application also proposes a command authorization device based on the RADIUS protocol, including:
[0049] at least one processor; and,
[0050] a memory communicatively connected to the at least one processor; wherein,
[0051] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute an instruction authorization method based on the RADIUS protocol as described in any of the above embodiments.
[0052] An embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as: an instruction authorization method based on the RADIUS protocol described in any of the above embodiments.
[0053] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0054] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0055] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0057] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0058] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0059] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0060] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0061] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0062] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0063] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A command authorization method based on RADIUS protocol, characterized in that: include: Based on a preset message structure, assembling the authorization instruction that complies with the legality rule into a RADIUS request message to obtain a RADIUS request message corresponding to the authorization instruction; Sending the RADIUS request message to a RADIUS server, extracting the authorization instruction in the RADIUS request message through the RADIUS server, judging the authorization instruction according to a configuration command set, assembling the judgment result into a result message and returning it; The result message is received, and according to the result message, it is determined whether the authorization instruction is executed.
2. According to claim 1, a command authorization method based on RADIUS protocol is characterized in that: Before assembling the authorization instruction that complies with the legality rule into a RADIUS request message based on the preset message structure, the method further includes: Obtain the authorization instruction input by the user, and perform a preliminary check on the authorization instruction based on preset legality rules to verify whether the authorization instruction is legal.
3. According to claim 2, a command authorization method based on RADIUS protocol is characterized in that: The preliminary check of the authorization instruction based on the preset legality rules specifically includes: Decomposing the authorization instruction and extracting the command name in the authorization instruction; The command name is queried in the preset command set, and if it exists, the length and parameters of the authorized instruction are obtained, and the length and parameters are checked based on the command line syntax rules.
4. The instruction authorization method based on RADIUS protocol according to claim 1, characterized in that: The preset message structure includes a message type, a required field, and an extended field; the message type includes a request message type, an acceptance message type, and a rejection message type; The step of assembling the authorization instruction that complies with the legality rule into a RADIUS request message based on the preset message structure specifically includes: Obtaining an authorization instruction that complies with the legality rules, parsing the authorization instruction, and determining parameter names, parameters corresponding to required fields, and parameters corresponding to extended fields in the authorization instruction; Based on the request message type, the authorization instruction is assembled to obtain a RADIUS request message.
5. According to the instruction authorization method based on RADIUS protocol described in claim 4, it is characterized in that: The step of judging the authorization instruction according to the configuration command set and assembling the judgment result into a result message for returning specifically includes: Determine the command name in the authorization instruction, call the configuration command set, perform fuzzy query in the configuration command set with the command name as the query condition, and determine whether the command name exists in the configuration command set; If yes, a pass result is generated, and based on the acceptance message type, the pass result is assembled into a RADIUS acceptance message, and the RADIUS acceptance message is returned; If not, an error message is output, and based on the reject message type, the error message is assembled into a RADIUS reject message, and the RADIUS reject message is returned.
6. According to the instruction authorization method based on RADIUS protocol described in claim 5, it is characterized in that: Determining whether the authorization instruction is executed according to the result message specifically includes: When the result message is a RADIUS acceptance message, executing the authorization instruction; When the result message is a RADIUS rejection message, it is determined that the authorization instruction fails to be authorized, the error information in the RADIUS rejection message is extracted, and the error information is returned to the device front-end interface.
7. According to the instruction authorization method based on RADIUS protocol described in claim 4, it is characterized in that: Before assembling the authorization instruction based on the request message type, the method further includes: A message verification code is added to the extended field, and a key is added to the authorization instruction through the message verification code.
8. According to the instruction authorization method based on RADIUS protocol described in claim 7, it is characterized in that: Before extracting the authorization instruction in the RADIUS request message through the RADIUS server, the method further includes: A key in the RADIUS request message is obtained, and the key is verified through the RADIUS server.
9. A command authorization device based on RADIUS protocol, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform, for example: Based on a preset message structure, assembling the authorization instruction that complies with the legality rule into a RADIUS request message to obtain a RADIUS request message corresponding to the authorization instruction; Sending the RADIUS request message to a RADIUS server, extracting the authorization instruction in the RADIUS request message through the RADIUS server, judging the authorization instruction according to a configuration command set, assembling the judgment result into a result message and returning it; The result message is received, and according to the result message, it is determined whether the authorization instruction is executed.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Based on a preset message structure, assembling the authorization instruction that complies with the legality rule into a RADIUS request message to obtain a RADIUS request message corresponding to the authorization instruction; Sending the RADIUS request message to a RADIUS server, extracting the authorization instruction in the RADIUS request message through the RADIUS server, judging the authorization instruction according to a configuration command set, assembling the judgment result into a result message and returning it; The result message is received, and according to the result message, it is determined whether the authorization instruction is executed.
Citation Information
Patent Citations
Result Reporting For Authentication, Authorization And Accounting Protocols
CN107040389A
Authentication and authorization method and apparatus, authentication server, and machine-readable storage medium
CN108462710A
Terminal authorization authentication method and system, and AAA server
CN108712419A
RADIUS server authorization method and device and medium
CN116248341A
Command authorization via RADIUS
US7047563B1
