Authentication method and device, electronic equipment and storage medium
By setting up multi-layer isolation and firewall authentication between the access authentication domain and the device management service domain in the network device, the problem of network device port information leakage in the open network environment is solved, ensuring safe and accurate access to user equipment, and enhancing improve the security of network equipment.
Patent Information
- Application Number
- CN202410742903.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-07
AI Technical Summary
In an open network environment, port information of network devices is easily leaked, leading to security risks. It is difficult to effectively manage the secure access of network devices with existing technology.
By setting up multi-layer network isolation between the access authentication domain and the device management service domain in the network device, and using a firewall, the single-packet authentication port is determined for user device authentication. After the authentication is passed, a random port is opened for access to ensure the security of the user device. Secure access.
It improves the security and access accuracy of network equipment, prevents unauthenticated access, dynamically manages user access, and enhances the core system isolation of network equipment.
Smart Images

Figure CN118611937A
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security, and specifically to an authentication method, device, electronic device and storage medium. Background Art
[0002] The protection of network equipment (such as switches, routers, etc.) from exposure in open network environments such as the Internet has always been a key issue in the field of network security. As the importance of network security continues to increase, the secure access management of network equipment is becoming increasingly important.
[0003] Currently, user devices can access network devices through open networks. However, in an open network environment, when user devices access network devices, the port information of network devices is easily leaked, causing other devices to continue to access the network devices using the port, thus bringing security risks to the network devices. Summary of the invention
[0004] The present application provides an authentication method, device, electronic device and storage medium to improve the security of user equipment when accessing network equipment.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, an authentication method is provided, which is applied to a network device. The network device includes an access authentication domain and a device management service domain, the access authentication domain and the device management service domain are isolated by a multi-layer network, and a firewall is also set between the access authentication domain and the device management service domain, the method includes: receiving an authentication request from a user device through the access authentication domain; determining a single-packet authentication port set by the firewall through the access authentication domain, and sending an authentication message to the device management service domain through the single-packet authentication port, the authentication message being used to authenticate the user device; when the user device passes the authentication, opening a random port on the firewall, and sending authentication pass information to the user device through the random port, so that the user device accesses the network through the random port.
[0007] In this application, the authentication request from the user device is received by accessing the authentication domain; the single-packet authentication port set by the firewall is determined by accessing the authentication domain, and the authentication message is sent to the device management service domain through the single-packet authentication port, and the authentication message is used to authenticate the user device; if the user device is authenticated, a random port is opened on the firewall, and the authentication pass information is sent to the user device through the random port, so that the user device can access the network through the random port. In this way, compared with the current access method for network devices deployed in open networks, the technical solution of this application can achieve access to the device management service domain more safely and accurately.
[0008] In a possible implementation, the above-mentioned “determining the single-packet authentication port set by the firewall through the access authentication domain” specifically includes: determining the authentication port number of the firewall through the access authentication domain, and determining the single-packet authentication port set by the firewall according to the authentication port number.
[0009] In one possible implementation, the above-mentioned "authentication message is a SPA message" specifically includes: controlling the access authentication domain to use a preset encryption algorithm to encrypt a preset key and a random number to obtain a SPA key; encapsulating the preset parameters based on SPA to obtain a SPA message, and the preset parameters include one or more of the SPA key, the user device identifier, the random number, the timestamp, the IP address of the user device, and the authentication port number.
[0010] In one possible implementation, the above-mentioned "the device management service domain has a single-packet authentication service and a management interface service, the single-packet authentication service is used to authenticate user devices, and the management interface service is used to provide network access services for user devices; through the single-packet authentication port, sending authentication messages to the device management service domain" specifically includes: sending authentication messages to the knocking port corresponding to the single-packet authentication service through the single-packet authentication port; the knocking port is a port set for the single-packet authentication service for receiving authentication messages.
[0011] In one possible implementation, a password is generated through a single-packet authentication port in the firewall using a time-based one-time password algorithm, and the password is hashed to obtain a first hash value; a hash operation is performed on the received authentication message through the single-packet authentication service to obtain a second hash value; and when the first hash value is consistent with the second hash value, it is determined that the user device authentication is successful.
[0012] In one possible implementation, the above-mentioned "opening a random port on the firewall when the user device authentication is successful" specifically includes: sending indication information to the firewall when the user device authentication is successful; the indication information is used to indicate that the user device authentication is successful; receiving response information from the firewall, and the response information is used to indicate the random port.
[0013] In a possible implementation, after the user device access ends, the random port is closed.
[0014] In a second aspect, an authentication device is provided, which is applied to a network device. The authentication device can implement the above aspects or the authentication methods in each possible design. For example, the authentication device can have the function of executing the above authentication method, and the function can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, the authentication device includes a control unit and a processing unit.
[0015] The control unit is used to receive an authentication request from a user equipment by accessing the authentication domain.
[0016] The control unit is also used to determine the single-packet authentication port set by the firewall through the access authentication domain, and send an authentication message to the device management service domain through the single-packet authentication port, where the authentication message is used to authenticate the user device.
[0017] The processing unit is used to open a random port on the firewall when the user device passes the authentication, and send authentication pass information to the user device through the random port, so that the user device can access the network through the random port.
[0018] In a possible implementation, the control unit is specifically used to determine the authentication port number of the firewall through the access authentication domain, and determine the open single-packet authentication port set by the firewall according to the authentication port number. The control access authentication domain uses a preset encryption algorithm to encrypt the preset key and the random number to obtain the SPA key; based on the SPA, the preset parameters are encapsulated to obtain the SPA message, and the preset parameters include the SPA key, the identifier of the user device, the random number, the timestamp, the IP address of the user device, and one or more of the authentication port number. Through the open single-packet authentication port, the authentication message is sent to the knocking port corresponding to the guarantee authentication service; the knocking port is a port set by the single-packet authentication service to indicate the reception of the authentication message.
[0019] In a possible implementation, the processing unit is specifically used to generate a password through a single-packet authentication port in the firewall using a time-based one-time password algorithm, and obtain a first hash value after performing a hash operation on the password; perform a hash operation on the received authentication message through the single-packet authentication service to obtain a second hash value; and determine that the user device authentication is successful when the first hash value is consistent with the second hash value. When the user device authentication is successful, send an indication message to the firewall to indicate that the user device authentication is successful; the indication message is used to indicate that the user device authentication is successful; receive a response message from the firewall, and the response message is used to indicate the random port. After the user device access ends, close the random port.
[0020] The specific implementation of the authentication device can refer to the processing method provided in the first aspect or any possible design of the first aspect, and will not be repeated here. Therefore, the authentication device provided can achieve the same beneficial effects as the first aspect or any possible design of the first aspect.
[0021] In a third aspect, an electronic device is provided. The electronic device can implement the functions performed in the above aspects or possible designs, and the functions can be implemented by hardware, such as: in one possible design, the electronic device may include: a processor and a communication interface, and the processor can be used to support the electronic device to implement the functions involved in the above first aspect or any possible design of the first aspect.
[0022] In another possible design, the electronic device may further include a memory for storing computer-executable instructions and data necessary for the electronic device. When the electronic device is running, the processor executes the computer-executable instructions stored in the memory so that the electronic device executes the above-mentioned first aspect or any possible authentication method involved in the first aspect.
[0023] In a fourth aspect, a computer-readable storage medium is provided, which may be a readable non-volatile storage medium. The computer-readable storage medium stores computer instructions or programs, which, when executed on a computer, enables the computer to execute the authentication method involved in the first aspect or any possible aspect of the above aspects.
[0024] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the authentication method of the first aspect or any possible one of the above aspects.
[0025] In a sixth aspect, a chip system is provided, the chip system including a processor and a communication interface, and the chip system can be used to implement the functions performed by the first aspect or any possible determination device of the first aspect. In one possible design, the chip system also includes a memory, the memory is used to store program instructions and / or data. The chip system can be composed of a chip, or it can include a chip and other discrete devices, without limitation.
[0026] Among them, the technical effects brought about by any design method from the second aspect to the sixth aspect can refer to the technical effects brought about by the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0028] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0029] Figure 3 A flowchart of an authentication method provided in an embodiment of the present application;
[0030] Figure 4 A flowchart of another authentication method provided in an embodiment of the present application;
[0031] Figure 5 A flowchart of another authentication method provided in an embodiment of the present application;
[0032] Figure 6A flowchart of another authentication method provided in an embodiment of the present application;
[0033] Figure 7 A schematic diagram of the structure of an authentication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0036] It should also be understood that the term “comprising” indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components.
[0037] The system architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0038] The protection of network equipment (switches, routers, etc.) from exposure in open network environments such as the Internet has always been a key issue in the field of network security. As the importance of network security continues to increase, the secure access management of network equipment is becoming increasingly important. Currently, there are mainly the following types of secure access management solutions for network equipment:
[0039] (1) The service interface is only open to the open network environment such as the Internet, and the management interface of the network device is physically isolated from the open network environment of the service interface. Users must be inside the network device management network or access the network device management network through VPN or other means to access the management interface of the network device.
[0040] (2) Open the management interface in an open network environment such as the Internet, but adopt more stringent security measures, such as setting up an IP whitelist and using security certificate login.
[0041] The above solutions all have certain limitations:
[0042] (1) The method of using only network devices to manage network access limits the convenience of managing network devices and collecting information;
[0043] (2) Using VPN access equipment to manage the network increases investment costs. On the other hand, the network management user needs to install VPN software, which is not convenient to use. In addition, if the business management regulations do not allow VPN access in the network management network, this method cannot be used.
[0044] (3) The method of opening the management interface but strengthening the access security policy is adopted. Since the management interface is exposed in the open network, there is a greater risk of network security threats. In most cases, it will be restricted by business management regulations and cannot be adopted.
[0045] In view of this, an embodiment of the present application provides an authentication method, which is applied to a network device and includes:
[0046] Receive authentication requests from user devices through the access authentication domain; determine the single-packet authentication port set by the firewall through the access authentication domain, and send authentication messages to the device management service domain through the single-packet authentication port, and the authentication messages are used to authenticate the user devices; when the user device passes the authentication, open a random port in the firewall, and send authentication pass information to the user device through the random port, so that the user device can access the network through the random port.
[0047] In this way, when the user device is authenticated by accessing the authentication domain, the firewall authenticates the authentication request of the user device through the dynamic single-packet authentication port. Since the single-packet authentication service does not return any data packet to the interface proxy service program and the user when the SPA authentication fails, the network device can not expose any network port to the outside without authentication. During the authentication process, the network isolation of the device core system and the authentication program is guaranteed. After the authentication is completed, the user access is guaranteed to be secure and controllable.
[0048] In one example, Figure 1 As shown, it is a schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device may include an access authentication domain and a device management service domain. The access authentication domain and the device management service domain are isolated by a 2-layer network, and a firewall is also set between the access authentication domain and the device management service domain.
[0049] The access authentication domain may be used to receive an authentication request from a user device and determine a single packet authentication (SPA) port set by a firewall.
[0050] The device management service domain can be used to authenticate the user device based on the received authentication message, and provide management interface services for user access if the user device passes the authentication.
[0051] In one example, Figure 1 As shown, the access authentication domain may include an interface proxy service.
[0052] Among them, the interface proxy service can be used to calculate the SPA key through the preset key and random number during user authentication, and package it together with the user device's identification, random number, timestamp, and authentication port number into an authentication message, and send it to the single-packet authentication service in the device management service domain.
[0053] In one example, Figure 1 As shown, the device management service domain may include a single-package authentication service and a management interface service.
[0054] Among them, the single-packet authentication service can be used to authenticate the user device, receive the authentication message through the knocking port, and determine whether the user device authentication is passed; the management interface service can be used to provide network access services to the user device.
[0055] Figure 1 The network equipment shown can be used Figure 2 The structure shown, or including Figure 2 Parts shown. Figure 2 The present invention provides an electronic device 200 according to an embodiment of the present invention. The electronic device 200 may be a chip or a system on a chip in a server. Figure 2 As shown, the electronic device 200 includes a processor 201 , a communication interface 202 and a communication line 203 .
[0056] Furthermore, the electronic device 200 may further include a memory 204 . The processor 201 , the memory 204 and the communication interface 202 may be connected via a communication line 203 .
[0057] The processor 201 is a CPU, a general processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 201 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.
[0058] The communication interface 202 is used to communicate with other devices or other communication networks. The other communication networks may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 202 may be a module, a circuit, a communication interface or any device capable of implementing communication.
[0059] The communication line 203 is used to transmit information between the components included in the electronic device 200.
[0060] The memory 204 is used to store instructions, where the instructions may be computer programs.
[0061] The memory 204 may be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0062] It should be noted that the memory 204 can exist independently of the processor 201, or can be integrated with the processor 201. The memory 204 can be used to store instructions or program codes or some data, etc. The memory 204 can be located inside the electronic device 200, or outside the electronic device 200, without limitation. The processor 201 is used to execute the instructions stored in the memory 204 to implement the field configuration method provided in the following embodiments of the present application.
[0063] In one example, the processor 201 may include one or more CPUs, for example, Figure 2 CPU0 and CPU1 in.
[0064] As an optional implementation, the electronic device 200 includes multiple processors, for example, Figure 2 In addition to the processor 201, a processor 207 may also be included.
[0065] As an optional implementation, the electronic device 200 further includes an output device 205 and an input device 206. Exemplarily, the input device 206 is a keyboard, a mouse, a microphone, a joystick, and the like, and the output device 205 is a display screen, a speaker, and the like.
[0066] It should be noted that the electronic device 200 may be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system or a Figure 2 In addition, Figure 2 The composition shown in the Figure 1 The limitations of each device in Figure 2 In addition to the parts shown, Figure 1 The devices shown may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0067] In the embodiment of the present application, the chip system may be composed of a chip, or may include a chip and other discrete devices.
[0068] In addition, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message name or parameter name in the message exchanged between the various devices in the embodiments of the present application is only an example, and other names can also be used in the specific implementation without limitation.
[0069] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.
[0070] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0071] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0072] Combine the following Figure 1 The network device shown describes the authentication method provided in the embodiment of the present application. Among them, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message name or parameter name in the message exchanged between the various devices in the embodiment of the present application is only an example, and other names can also be used in the specific implementation without limitation. The actions involved in the various embodiments of the present application are only an example, and other names can also be used in the specific implementation, such as: "included in" in the embodiment of the present application can also be replaced by "carried on" or "carried in", etc.
[0073] It should be noted that the execution entity of the embodiment of the present application can be Figure 1 The network device in the embodiment may also be a device in the network device, such as a chip or a system on chip. The method provided in the embodiment of the present application is described below by taking the execution subject as a network device as an example.
[0074] Figure 3 is a flowchart of an authentication method according to an exemplary embodiment. Figure 3 As shown, the authentication method includes the following steps:
[0075] S301: A network device receives an authentication request from a user device by accessing an authentication domain.
[0076] Among them, the access authentication domain is a separate layer of network in the network device; this domain has the following characteristics: it is completely isolated from the device management service domain on the 2-layer network; the communication between the device management service domain and the device management service domain is isolated by a firewall; only the interface proxy service runs in the access authentication domain, which can proxy the user device's access to the network device to the device management service domain; the access authentication domain does not save any data and configuration information.
[0077] The authentication request is an authentication request from the user equipment to the network equipment through an open network.
[0078] In one example, a user device initiates an authentication request to a network device in an open network, for example, a user enters a user name and password from the user device; the access authentication domain receives the authentication request through an interface proxy service.
[0079] S302: The network device determines the single-packet authentication port set by the firewall through the access authentication domain, and sends an authentication message to the device management service domain through the single-packet authentication port.
[0080] The authentication message is used to authenticate the user device. The authentication message is a SPA message, which is generated by a random number-based one-time password (HMAC-based One-Time Password, HOTP) algorithm. For details, please refer to Figure 4 The description of the illustrated embodiment is not repeated here.
[0081] In a possible implementation, the network device may determine the authentication port number of the firewall by accessing the authentication domain, and determine the single-packet authentication port set by the firewall according to the authentication port number.
[0082] The authentication port number is used to indicate the single-packet authentication port set by the firewall. The single-packet authentication port is used to send authentication messages to the device management service domain.
[0083] In one example, the network device can use a preset encryption algorithm by accessing the authentication domain to generate a port number, and use the port number as the authentication port number of the firewall.
[0084] The preset encryption algorithm may be a one-time password (TOTP) algorithm.
[0085] In another possible implementation, after determining the authentication port number of the firewall, the network device can determine the single-packet authentication port of the firewall based on the authentication port number, and send the authentication message to the single-packet authentication port. After the firewall passes the single-packet authentication port, it can send the authentication message to the device management service domain based on the preset knocking port.
[0086] The knock port is set based on the single-packet authentication service in the device management service domain.
[0087] In one example, the firewall can use the TOTP algorithm to calculate the timestamp, the IP address of the user device, etc. to generate a temporary password, and perform a hash operation (HASH) on the temporary password to obtain a first hash value. The first hash value can be used as the port number of the knocking port.
[0088] It should be noted that, in the embodiment of the present application, in order to ensure the security of the port, the temporary password and port number in the single-packet authentication port opened in the firewall can be periodically updated.
[0089] S303: When the user device passes the authentication, a random port is opened on the firewall, and authentication pass information is sent to the user device through the random port, so that the user device can access the network through the random port.
[0090] The random port is used by the user device to access the device management interface in the device management service domain.
[0091] In a possible implementation, after the network device generates the first hash value through the firewall, it can perform a hash operation on the received authentication message through the single-packet authentication service to obtain a second hash value. For example, the single-packet authentication service can calculate the SPA key based on the timestamp in the received SPA message, the IP address of the user device, and the service password stored in the single-packet authentication service, and perform a hash operation on the SPA key to obtain the second hash value.
[0092] If the first hash value is consistent with the second hash value, the user device is authenticated successfully. If the first hash value is inconsistent with the second hash value, the user device is authenticated failed.
[0093] In a possible implementation, when the user device is authenticated, the network device sends indication information to the firewall through the device management service domain; correspondingly, the network device receives a response message from the firewall through the device management service domain.
[0094] The indication information is used to indicate that the user equipment has passed the authentication; and the response message is used to indicate the random port.
[0095] In an embodiment of the present application, when the user device authentication is passed, the network device can notify the firewall to open a random port, and send information indicating the random port to the access authentication domain through the knocking port, so that subsequently, when the access authentication domain receives the access request from the user device, it can send the access request to the device management service domain through the random port.
[0096] In the embodiment of the present application, the firewall may be provided with a whitelist. The whitelist includes the address information of the access authentication domain. That is, when the firewall receives an access request forwarded by other domains, the firewall will not open a random port. Alternatively, based on the whitelist, the firewall only opens a single-packet authentication port to the access authentication domain; if the user device authentication is passed, the firewall may open a random port to the access authentication domain.
[0097] In one example, the interface proxy service can be used to proxy management ports such as SSH / HTTP. For example, the interface proxy service can proxy the access of the user device to a random port opened by the firewall, so that the user device can access the device management interface in the device management service domain through the random port.
[0098] In one example, when the user device ends the management session or times out, the management interface service can notify the firewall to close the open random port.
[0099] based on Figure 3 The technical solution of this application is that the network device receives the authentication request from the user device by accessing the authentication domain; the network device determines the single-packet authentication port set by the firewall by accessing the authentication domain, and sends the authentication message to the device management service domain through the single-packet authentication port; when the user device passes the authentication, a random port is opened on the firewall, and the authentication pass information is sent to the user device through the random port, so that the user device can access the network through the random port. In this way, compared with the current access method to network devices deployed in open networks, the technical solution of this application can more safely and accurately realize the access to the device management interface in the device management service domain.
[0100] In some embodiments, Figure 4 As shown, the authentication method provided in the embodiment of the present application may also include: S401-S402.
[0101] S401. The network device controls the access authentication domain to encrypt a preset key and a random number using a preset encryption algorithm to obtain a SPA key.
[0102] In one example, during user authentication, the interface proxy service in the access authentication domain calculates the SPA key using a preset key and a random number according to a one-time password algorithm based on a random number.
[0103] S402: The network device encapsulates the preset parameters based on SPA to obtain the SPA message.
[0104] In one example, the interface proxy service in the access authentication domain encapsulates the SPA key and preset parameters to obtain a SPA message.
[0105] The preset parameters include one or more of a SPA key, an identifier of a user equipment, a random number, a timestamp, an IP address of the user equipment, and the authentication port number.
[0106] based on Figure 4 The technical solution of the present invention is that the network device controls the access authentication domain to encrypt the preset key and the random number using the preset encryption algorithm to obtain the SPA key; the network device encapsulates the preset parameters based on the SPA to obtain the SPA message. In this way, the authentication request of the user device can be accurately obtained.
[0107] In one embodiment, Figure 5 As shown, the authentication method provided by this application may include:
[0108] S501: User equipment sends an authentication request to an access authentication domain. Correspondingly, the access authentication domain receives the authentication request from the user equipment.
[0109] S502: The access authentication domain encapsulates the received authentication request to obtain a SPA message, and sends the SPA message to the single-packet authentication service through the single-packet authentication port of the firewall. Correspondingly, the single-packet authentication service receives the SPA message from the access authentication domain.
[0110] The SPA message includes relevant information of the user equipment, such as the IP address of the user equipment and the timestamp corresponding to when the user equipment sends the authentication request.
[0111] S503: The single packet authentication service parses the SPA message, and authenticates the user equipment based on the parsed SPA message.
[0112] S504: When the user equipment passes the authentication, the single-packet authentication service sends authentication pass information to the access authentication domain through a random port.
[0113] The specific implementation methods and technical effects of S501 to S504 can refer to the description of the above embodiments and will not be elaborated here.
[0114] In one embodiment, Figure 6 As shown, the authentication method provided by this application may also include:
[0115] S601. The network device opens a single-packet authentication port through a firewall.
[0116] S602: The network device receives an authentication request from a user device by accessing an authentication domain.
[0117] S603: The access authentication domain encapsulates the received authentication request to obtain a SPA message, and sends the SPA message to the single-packet authentication service in the device management service domain through the single-packet authentication port in the firewall. Correspondingly, the single-packet authentication service receives the SPA message from the access authentication domain.
[0118] S604: The single packet authentication service parses the SPA message, and authenticates the user equipment based on the parsed SPA message.
[0119] S605: When the user device passes authentication, the network device sends first indication information to the firewall through the single-packet authentication service; correspondingly, the firewall receives the first indication information from the single-packet authentication service and opens a random port.
[0120] The first instruction information is used to instruct the firewall to open a random port.
[0121] S606. The network device sends the random port number of the firewall to the access authentication domain through the single-packet authentication service. Correspondingly, the access authentication domain receives the random port number sent from the single-packet authentication service.
[0122] S607: The network device sends authentication success information to the user device by accessing the authentication domain.
[0123] S608: The user device accesses the management interface service in the device management service domain through a random port of the firewall.
[0124] S609: The user device ends access to the network device.
[0125] S610. The network device sends second indication information to the firewall through the management interface service. Correspondingly, the firewall receives the second indication information from the management interface service and closes a random port.
[0126] The second instruction information is used to instruct the firewall to close the random port.
[0127] The specific implementation method and technical effects of S601 to S610 may refer to the description of the above embodiments and will not be elaborated here.
[0128] The embodiment of the present application can divide the field query device into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic, which is only a logical function division. There may be other division methods in actual implementation.
[0129] When each function is assigned to each functional module, Figure 7 A schematic diagram of the structure of an authentication device 70 is shown. The authentication device 70 can be used to execute the authentication method in the above embodiment. Figure 7 The authentication device 70 shown may include: a control unit 701 and a processing unit 702 .
[0130] The control unit 701 is configured to receive an authentication request from a user equipment by accessing an authentication domain.
[0131] The control unit 701 is further used to determine the single-packet authentication port set by the firewall through the access authentication domain, and send an authentication message to the device management service domain through the single-packet authentication port, where the authentication message is used to authenticate the user device.
[0132] The processing unit 702 is used to open a random port on the firewall when the user equipment passes the authentication, and send authentication pass information to the user equipment through the random port, so that the user equipment can access the network through the random port.
[0133] In a possible implementation, the control unit 701 is specifically used to determine the authentication port number of the firewall through the access authentication domain, and determine the single-packet authentication port set by the firewall according to the authentication port number. The preset key and the random number are encrypted by using the preset encryption algorithm through the access authentication domain to obtain the SPA key; the preset parameters are encapsulated through SPA to obtain the SPA message, and the preset parameters include the SPA key, the identifier of the user device, the random number, the timestamp, the IP address of the user device, and one or more of the authentication port number. The authentication message is sent to the knocking port corresponding to the guarantee authentication service through the single-packet authentication port; the knocking port is a port set by the single-packet authentication service to indicate the reception of the authentication message.
[0134] In a possible implementation, the processing unit 702 is specifically used to generate a password through a single-packet authentication port in the firewall using a time-based one-time password algorithm, and obtain a first hash value after performing a hash operation on the password; calculate the SPA key through the single-packet authentication service for the timestamp in the received authentication message, the IP address of the user device, and the service password stored in the single-packet authentication service, and perform a hash operation on the SPA key to obtain a second hash value; when the first hash value is consistent with the second hash value, it is determined that the user device authentication is passed. When the user device authentication is passed, an indication message is sent to the firewall to indicate that the user device authentication is passed; a response message from the firewall is received, and the response message is used to indicate the random port. After the user device access ends, the random port is closed.
[0135] The embodiment of the present application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be completed by a computer program to instruct the relevant hardware, and the program can be stored in the above computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be an internal storage unit of the authentication device (including the data sending end and / or the data receiving end) of any of the above embodiments, such as a hard disk or memory of the authentication device. The above computer-readable storage medium can also be an external storage device of the above terminal device, such as a plug-in hard disk equipped on the above terminal device, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. Further, the above computer-readable storage medium can also include both the internal storage unit of the above authentication device and an external storage device. The above computer-readable storage medium is used to store the above computer program and other programs and data required by the above authentication device. The above computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0136] It should be noted that the terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0137] It should be understood that in the present application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0138] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0139] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.
[0143] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An authentication method, characterized in that: Applied to a network device, the network device includes an access authentication domain and a device management service domain, the access authentication domain and the device management service domain are isolated by a multi-layer network, and a firewall is also provided between the access authentication domain and the device management service domain, the method includes: receiving an authentication request from a user device through the access authentication domain; Determine the single-packet authentication port set by the firewall through the access authentication domain, and send an authentication message to the device management service domain through the single-packet authentication port, where the authentication message is used to authenticate the user device; When the user device passes the authentication, a random port is opened on the firewall, and authentication pass information is sent to the user device through the random port, so that the user device can access the network through the random port.
2. The method according to claim 1, characterized in that The determining the single-packet authentication port set by the firewall through the access authentication domain includes: The authentication port number of the firewall is determined through the access authentication domain, and the single-packet authentication port set by the firewall is determined according to the authentication port number.
3. The method according to claim 1 or 2, characterized in that: The authentication message is a SPA message, and the method further includes: Control the access authentication domain to use a preset encryption algorithm to encrypt a preset key and a random number to obtain a SPA key; The preset parameters are encapsulated based on the SPA to obtain the SPA message, where the preset parameters include one or more of the SPA key, the identifier of the user equipment, the random number, the timestamp, the IP address of the user equipment, and the authentication port number.
4. The method according to claim 1, characterized in that The device management service domain has a single-packet authentication service and a management interface service, the single-packet authentication service is used to authenticate the user equipment, and the management interface service is used to provide a network access service for the user equipment; The sending of the authentication message to the device management service domain through the single-packet authentication port includes: Sending the authentication message to the knocking port corresponding to the single-packet authentication service through the single-packet authentication port; The knocking port is a port set by the single-packet authentication service for receiving authentication messages.
5. The method according to claim 1 or 2, characterized in that: The method further comprises: Generate a password using a time-based one-time password algorithm through a single-packet authentication port in the firewall, and obtain a first hash value after performing a hash operation on the password; Performing a hash operation on the received authentication message through the single-packet authentication service to obtain a second hash value; When the first hash value is consistent with the second hash value, it is determined that the user equipment is authenticated.
6. The method according to claim 1, characterized in that When the user device passes the authentication, opening a random port on the firewall includes: When the user equipment passes the authentication, sending indication information to the firewall; the indication information is used to indicate that the user equipment passes the authentication; A response message is received from the firewall, where the response message is used to indicate the random port.
7. The method according to claim 6, characterized in that The method further comprises: After the access by the user equipment ends, the random port is closed.
8. An authentication device, characterized in that: Applied to a network device, the network device includes an access authentication domain and a device management service domain, the access authentication domain and the device management service domain are isolated by a multi-layer network, and a firewall is also provided between the access authentication domain and the device management service domain, the device includes a control unit and a processing unit; The control unit is configured to receive an authentication request from a user equipment through the access authentication domain; The control unit is further used to determine the single-packet authentication port set by the firewall through the access authentication domain, and send an authentication message to the device management service domain through the single-packet authentication port, where the authentication message is used to authenticate the user device; The processing unit is used to open a random port on the firewall when the user equipment passes the authentication, and send authentication pass information to the user equipment through the random port, so that the user equipment accesses the network through the random port.
9. An electronic device, characterized in that: include: A processor, a memory and a communication interface; wherein the communication interface is used for communication of the authentication device; The memory is used to store one or more programs, which include computer-executable instructions. When the authentication device is running, the processor executes the computer-executable instructions stored in the memory to enable the authentication device to perform the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed on a computer, the computer performs the method as claimed in any one of claims 1 to 7 above.
Citation Information
Patent Citations
Method and system for enhancing network security based on single packet authorization technology
CN115801347A
Single packet authorization authentication method and device, server and storage medium
CN116545659A
Access method, device and system based on zero-trust single packet authentication
CN116708039A
Isolation management device, method and program
JP2020091782A
Computerized system and method for automatically determining malicious IP clusters using network activity data
US20180097828A1
Cited By
Surveying and mapping resistance protection method and device for network node group and electronic equipment
CN122475957A
Authentication method and apparatus, and electronic device and storage medium
WO2025251597A1
