Authentication method and device
By exchanging secure state extension data in two-way hello messages between the client and the gateway device, two-way authentication is realized, and the one-way authentication and performance consumption problems of TCP authentication method in a zero-trust environment are solved, and the credibility of authentication is improved and security.
Patent Information
- Application Number
- CN202410961905.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-12
AI Technical Summary
In the source NAT networking environment built on zero trust, the existing TCP-type SPA authentication method has one-way authentication defects, and the equipment performance consumption is high when the concurrent online volume is large, which affects the online efficiency and is not high enough security.
By exchanging extended data in hello messages between the client and the gateway device, two-way authentication is realized. The client sends its secure state extended data when establishing a TCP connection. The gateway device decides whether to authenticate based on the extended data and passes the authentication. Then send the authentication data of the gateway device to realize the authentication of the gateway device by the client.
It improves the credibility and security of certification, avoids the defects of one-way certification, reduces unnecessary certification processes, and improves equipment performance utilization.
Smart Images

Figure CN118944920A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an authentication method and device. Background Art
[0002] In a source NAT networking environment built based on zero trust, for users with the same source IP address, if a user is authenticated by the client in the user terminal using UDP type SPA authentication and the authentication is passed, the source IP address will be added to the SPA authentication whitelist. Subsequently, other users with the same source IP address can access resources by querying the spa authentication whitelist. In other words, in this case, SPA authentication is not performed on all online clients, and the security is not high. Therefore, when the networking environment has high security requirements for user terminals, it is necessary to authenticate each user terminal, that is, each client must perform SPA authentication when establishing a TCP connection with the SDP gateway.
[0003] The general process of TCP-type SPA authentication process is as follows: the client adds a private extension field in the client hello message, and the extension content includes a one-time password. The SDP gateway verifies the extension content after receiving the client hello message. From the above TCP-type SPA authentication process, it can be seen that only the extension field for the user to perform SPA authentication is added to the client hello message. This authentication method is a one-way authentication of the client by the SDP gateway, and there is no authentication of the SDP gateway by the client. The client trusts the gateway by default. If the SDP gateway itself has been attacked or counterfeited during the SPA authentication, it will result in a certain degree of not being a completely zero-trust solution. Secondly, when the number of concurrent online connections is large, each tunnel negotiation performs TCP-type SPA authentication, which will also consume device performance and affect online efficiency. Summary of the invention
[0004] In view of this, the present application provides an authentication method and device to achieve two-way authentication and improve the credibility of authentication.
[0005] Specifically, the present application is implemented through the following technical solutions:
[0006] According to a first aspect of the present application, there is provided an authentication method, which is applied to a gateway device, and the method includes:
[0007] receiving a first hello message sent by a client in a user equipment, where the first hello message carries extended data, where the extended data is used to characterize a security status of the client;
[0008] If it is determined according to the extended data that the client needs authentication, authenticating the client using the authentication data of the client in the first hello message;
[0009] After the authentication is successful, a second hello message is sent to the client, so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message.
[0010] According to a second aspect of the present application, another authentication method is provided, which is applied to a user equipment, wherein a client is running in the user equipment, and the method includes:
[0011] Obtaining the security status of the client;
[0012] Constructing a first hello message according to the security status of the client, where the first hello message carries extended data for representing the security status of the client;
[0013] Sending the first hello message to the gateway device;
[0014] receiving a second hello message sent by the gateway device after authenticating the client, wherein the second hello message carries authentication data of the gateway device;
[0015] The gateway device is authenticated according to the authentication data.
[0016] According to a third aspect of the present application, an authentication device is provided, which is applied to a gateway device, and the device includes:
[0017] A receiving unit, configured to receive a first hello message sent by a client in a user equipment, wherein the first hello message carries extended data, and the extended data is used to characterize a security status of the client;
[0018] an authentication unit, configured to authenticate the client using the authentication data of the client in the first hello message if it is determined according to the extended data that the client needs authentication;
[0019] A sending unit is used to send a second hello message to the client after the authentication is passed, so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message.
[0020] According to a fourth aspect of the present application, another authentication device is provided, which is applied to a user equipment, wherein a client is running in the user equipment, and the device includes:
[0021] An acquisition unit, used to acquire the security status of the client;
[0022] A construction unit, configured to construct a first hello message according to the security status of the client, wherein the first hello message carries extended data for representing the security status of the client;
[0023] A sending unit, configured to send the first hello message to a gateway device;
[0024] A receiving unit, configured to receive a second hello message sent by the gateway device after authenticating the client, wherein the second hello message carries authentication data of the gateway device;
[0025] An authentication unit is used to authenticate the gateway device according to the authentication data.
[0026] According to the fifth aspect of the present application, an electronic device is provided, including a processor and a machine-readable storage medium, the machine-readable storage medium storing a computer program that can be executed by the processor, and the processor is prompted by the computer program to execute the method provided in the first aspect or the second aspect of the embodiment of the present application.
[0027] According to the sixth aspect of the present application, a machine-readable storage medium is provided, which stores a computer program. When called and executed by a processor, the computer program prompts the processor to execute the method provided in the first aspect or the second aspect of the embodiment of the present application.
[0028] Beneficial effects of the embodiments of the present application:
[0029] In the authentication method and apparatus provided in the embodiment of the present application, the gateway device receives a first hello message sent by a client in the user device; if it is determined according to the extended data that the client needs to be authenticated, the client is authenticated using the authentication data of the client in the first hello message; after the authentication is successful, a second hello message is sent to the client so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message. Since the above-mentioned first hello message carries extended data for characterizing the security status of the client, when it is determined based on the extended data that the client needs to be authenticated, the authentication of the client is enabled; at the same time, after the client authentication is successful, the authentication data of the gateway device is sent to the client to enable the client to authenticate the gateway device, thereby realizing two-way authentication between the client and the gateway device, thereby improving the credibility of the authentication and ensuring the security of the access to the business resources after the authentication is successful. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flowchart of an authentication method provided in an embodiment of the present application;
[0031] Figure 2 It is a flowchart of another authentication method provided in an embodiment of the present application;
[0032] Figure 3 It is a structural diagram of an authentication device provided in an embodiment of the present application;
[0033] Figure 4 is a schematic diagram of the structure of another authentication device provided in an embodiment of the present application;
[0034] Figure 5 It is a schematic diagram of the hardware structure of an electronic device for implementing an authentication method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.
[0036] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.
[0037] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0038] The authentication method provided by this application is described in detail below.
[0039] See also Figure 1 , Figure 1This is a flowchart of an authentication method provided by the present application. The method can be applied to a gateway device, which can be an SDP gateway, and is applied to a zero-trust network. When the above-mentioned gateway device implements the method, it may include the following steps:
[0040] Step 101: Receive a first hello message sent by a client in a user equipment, where the first hello message carries extended data, and the extended data is used to represent a security status of the client.
[0041] In this step, when the user wants to access the business resources in the zero-trust network, the client in the user device can be triggered to start the function of establishing a tunnel connection with the gateway device. Before establishing the tunnel, the current process requires spa authentication to ensure the security of accessing business resources after the tunnel connection is successfully established. If the client in the user device is secure, that is, the user device where the client is located is secure and reliable, then this embodiment proposes to skip the authentication process and directly establish a tunnel connection; if the client itself has security risks, it is necessary to perform spa authentication. In view of this, this embodiment proposes that when the client establishes a TCP connection with the gateway device, it sends extended data used to characterize the current security status of the client during the three-way handshake interaction process, that is, the client sends a first hello message to the gateway device, and the first hello message carries the above-mentioned extended data.
[0042] Step 102: If it is determined according to the extended data that the client needs authentication, the client is authenticated using the authentication data of the client in the first hello message.
[0043] In this step, after receiving the first hello message, the gateway device can extract the above-mentioned extended data from the first hello message, and then identify and process the extended data. It can be understood that the more secure the client is, the safer it is, even if the client is not spa-authenticated, the user is safe when accessing the business resources in the zero-trust network through the client. In this case, spa authentication of the client is not required; otherwise, if the client represented by the extended data is unsafe, it means that there is a security threat if the client accesses the business resources in the zero-trust network. Based on this, spa authentication of the client is required.
[0044] In view of this, this embodiment proposes that if the gateway device recognizes that the client needs to be authenticated based on the extended data, the authentication data for spa authentication is extracted from the first hello message, and then the client is spa authenticated based on the authentication data. Specifically, when authenticating the client based on the authentication data, the specific process of spa authentication under the current tcp protocol can be referred to, which will not be described in detail here.
[0045] Optionally, the first hello message includes a private extension field, and the private extension field carries the extended data and authentication data.
[0046] Step 103: After the authentication is successful, send a second hello message to the client, so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message.
[0047] In this step, after the client is authenticated based on the above authentication data, it means that the client is trustworthy. In order to make the client trustworthy to the gateway device, the gateway device can send a second hello message to the client, and carry the authentication data for gateway authentication in the second hello message. The second hello message can be a server hello message. In this way, the client can extract the authentication data of the gateway device from the second hello message upon receiving it, and then authenticate the gateway device based on the authentication data. After the gateway device is authenticated, it means that both parties trust each other. At this time, the client can start the process of establishing an SSL tunnel with the gateway device, and then access the business resources after the SSL tunnel is established. Thus, a two-way spa authentication between the client and the gateway device is realized, the credibility of the authentication is improved, and the security of the business resource access after the authentication is passed is guaranteed.
[0048] In the implementation of the authentication method provided by the present application, the gateway device receives the first hello message sent by the client in the user device; if it is determined according to the extended data that the client needs to be authenticated, the client is authenticated using the authentication data of the client in the first hello message; after the authentication is successful, a second hello message is sent to the client, so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message. Since the above-mentioned first hello message carries extended data for characterizing the security status of the client, when it is determined based on the extended data that the client needs to be authenticated, the authentication of the client is enabled; at the same time, after the client authentication is successful, the authentication data of the gateway device is sent to the client to enable the client to authenticate the gateway device, thereby realizing two-way authentication between the client and the gateway device, thereby improving the credibility of the authentication and ensuring the security of the access to business resources after the authentication is successful.
[0049] Optionally, in this embodiment, if it is determined according to the extended data that the client does not need authentication, SSL tunnel negotiation is performed directly with the client to establish an SSL tunnel.
[0050] Specifically, if the extended data indicates that the client is secure and trustworthy, it indicates that the client does not need to be authenticated. Based on this, in one embodiment, it can be considered that the gateway device believes that the client is trustworthy, and the client also believes that the gateway device is trustworthy. Based on this, the gateway device can initiate an SSL tunnel establishment process to the client to establish an SSL tunnel between the client and the gateway device. In another embodiment, the gateway device can also send a second hello message to the client to allow the client to authenticate the gateway device. After the gateway device is authenticated, the client initiates the SSL tunnel establishment process. This achieves the rapid and secure establishment of the SSL tunnel.
[0051] Optionally, based on the above embodiments, in this embodiment, the authentication data of the above-mentioned gateway device includes: an online code of the gateway device, a random number generated by the gateway device, and an authentication password of the gateway device; wherein the authentication password is obtained by processing the online code, the device serial number of the gateway device and the random number using a set algorithm.
[0052] Specifically, a private extension field is added to the second hello message, and the private extension field carries the online code GN, the random number Counter of the gateway device, and the authentication password password. Specifically, the format of the private extension field is shown in Table 1. The private extension field may be, but is not limited to, a field corresponding to the type 65290 in the second hello message.
[0053] On this basis, the above authentication data may also include a version number Version, which is used to indicate the version number of the TCPspa type. In addition, the online code GN of the gateway device is generated by the controller in the zero-trust network after the gateway device goes online and is sent to the gateway device. In addition, since the online code of the gateway device uniquely identifies the gateway device, the controller will also record the correspondence between the online code of the gateway device and the device serial number of the gateway device. The device serial number is the number that comes with the gateway device when it leaves the factory, which is used to uniquely identify the gateway device.
[0054] Table 1
[0055] Version GN(Online Code) Counter Password 2 bytes 32 bytes 4 bytes 6 bytes
[0056] Furthermore, in order to facilitate the client to authenticate the gateway device, the gateway device will also generate an authentication password. Specifically, the gateway device can use a set algorithm to process the online code, device serial number and random number. For example, the online code, device serial number and random number are input into the set algorithm. In this way, the output of the set algorithm is the authentication password of the gateway device.
[0057] Optionally, based on the above embodiment, in one embodiment, the step of determining whether the client needs authentication according to the extended data may be performed according to the following process: if the extended data is a first set value, determining that the client needs authentication; if the extended data is a second set value, determining that the client does not need authentication;
[0058] The first setting value is used to indicate that the security status of the client is that there is a security risk in the client; and the second setting value is used to indicate that the security status of the client is safe.
[0059] Specifically, the value of the first setting value may be Y, or a value of 1; the value of the second setting value may be N, or, or 0, etc. The first setting value is different from the second setting value.
[0060] In another embodiment, the extended data is also used to characterize the operating environment of the client; on this basis, the step of determining whether the client needs authentication according to the extended data can also be performed according to the following process: if the extended data is a first set value, it is determined that the client needs authentication; if the extended data is a second set value, it is determined that the client does not need authentication;
[0061] Among them, the above-mentioned third setting value is used to characterize that the operating environment of the client does not meet the normal operating conditions, and / or the security status of the client is used to characterize that there are security risks in the client; the above-mentioned fourth setting value is used to characterize that the operating environment of the client meets the normal operating conditions, and the security status of the client is safe.
[0062] Specifically, in this embodiment, the value of the third setting value can be Y, or the value 1; the value of the fourth setting value can be N, or, or 0, etc., and the third setting value is different from the fourth setting value.
[0063] In this way, the gateway device can identify whether the client needs to be authenticated, that is, whether the client is currently secure and trustworthy.
[0064] Based on the same inventive concept, this embodiment also provides another authentication method, referring to Figure 2 The flowchart of the authentication method shown in FIG. 1 can be applied to a user device, in which a client is running, and the client can be a zero-trust client. When the user device implements the method, the following steps can be included:
[0065] Step 201: Obtain the security status of the client.
[0066] Specifically, the security status of the client may include the security device of the client itself, and may also include the security status of the user equipment.
[0067] Step 202: construct a first hello message according to the security status of the client, where the first hello message carries extended data for characterizing the security status of the client.
[0068] In this step, the extended data matching the security status can be configured according to the security status of the client, so that different values of the extended data represent different security statuses of the client. Then, in order to facilitate the gateway device to confirm whether to perform spa authentication, during the handshake process between the client and the gateway device based on the TCP protocol, the extended data is carried in the first hello message and sent to the gateway device. The first hello message is the client hello message.
[0069] Specifically, the above-mentioned extended data may be carried in an extended field in the first hello message, and the extended field may be, but is not limited to, an extended field of type 65291.
[0070] Step 203: Send the first hello message to the gateway device.
[0071] Step 204: Receive a second hello message sent by the gateway device after authenticating the client, where the second hello message carries authentication data of the gateway device.
[0072] In this step, after receiving the first hello message, the gateway device can extract the extended data from the message, and then identify and process the extended data to confirm the security status represented by the extended data, and then determine whether the client needs to be spa-authenticated. When the current security status of the client is identified as a potential security risk based on the extended data, it means that if the client is not spa-authenticated, there will be security threats when the client accesses business resources in the zero-trust network. Based on this, the gateway device can determine that the client needs to be spa-authenticated.
[0073] When the gateway device successfully authenticates the client, it indicates that the gateway device considers the client to be trustworthy. In order to allow the client to confirm the credibility of the gateway device, the gateway device may also carry the authentication data of the gateway device in the server hello message (that is, the second hello message) fed back to the client.
[0074] Step 205: Authenticate the gateway device according to the authentication data.
[0075] In this step, when the client receives the second hello message, it can extract the authentication data of the gateway device from the second hello message, and then authenticate the gateway device based on the authentication data. Specifically, when the gateway device carries the authentication data in the extension field of the second hello message, the client can quickly extract the authentication data of the gateway device from the second hello message according to the position of the extension field, and perform authentication processing. After the authentication is passed, it indicates that the gateway device is trustworthy, and then the SSL tunnel establishment process can be initiated.
[0076] In the authentication method provided in the above embodiment, the security status of the client is obtained; a first hello message is constructed according to the security status of the client, and the first hello message carries extended data for characterizing the security status of the client; the first hello message is sent to the gateway device; a second hello message is received after the gateway device authenticates the client, and the second hello message carries the authentication data of the gateway device; the gateway device is authenticated according to the authentication data. Thus, by performing two-way authentication between the client and the gateway device during the handshake between the client and the gateway device, the credibility of the authentication is improved; in addition, when the client performs a handshake, by carrying the extended data for characterizing the security status of the client, the gateway device determines whether authentication is required based on the extended data, thereby improving the flexibility of the gateway device in authenticating the client.
[0077] Optionally, based on the above embodiments, in one embodiment, step 202 can be performed according to the following process: if the security status of the client is used to characterize that there are security risks in the client, the value of the extended data in the first hello message is set to a first set value; if the security status of the client is safe, the value of the extended data in the first hello message is set to a second set value.
[0078] Specifically, the security status of the client can be determined according to the following process: obtaining security evaluation indicators of the client; if multiple security evaluation indicators meet the security evaluation conditions, determining that the security status of the client is safe; otherwise, determining that the security status of the client has security risks.
[0079] Optionally, the above security assessment indicators may include but are not limited to: the situation where the client is disabled, the situation where the client is infected with a virus, the version of the client's anti-virus software, etc.; on this basis, it can be determined whether each security assessment indicator meets the security assessment conditions according to the following process: when it is confirmed that the client is not disabled based on the situation where the client is disabled, and it is confirmed that the client has never been infected with a virus based on the situation where the client is infected with a virus, it is determined that the security platform conditions are met; or, when it is confirmed that the client is not disabled based on the situation where the client is disabled, and it is confirmed that the client has never been infected with a virus based on the situation where the client is infected with a virus, and it is confirmed that the version of the client's anti-virus software is the latest based on the situation where the client's anti-virus software is the latest, it is determined that the security platform conditions are met, and then the security status of the client is determined to be safe; if the above two situations are not met, it can be determined that the security assessment conditions are not met, and then the security status of the client is determined to have security risks.
[0080] It should be noted that the above is only an example and does not constitute a specific limitation on determining whether each security assessment indicator meets the security assessment condition. In actual applications, the number of security assessment indicators, security assessment conditions, etc. can be configured according to actual conditions. For example, the security assessment indicator can also include the operating environment of the client, etc.
[0081] Further, when it is determined that the security status of the client is subject to security risks, the value of the extended data is configured to a first set value to indicate that the gateway device confirms that the current client is subject to security risks based on the first set value and that the client needs to be authenticated; and when it is determined that the security status of the client is secure, the value of the extended data is configured to a second set value to indicate that the gateway device confirms that the client is secure and trustworthy based on the second set value and that the client authentication step can be skipped to directly negotiate and establish an SSL tunnel process.
[0082] Optionally, the value of the first setting value may be Y, or a value of 1; the value of the second setting value may be N, or, or 0, etc. The first setting value is different from the second setting value. In addition, the meanings represented by the first setting value and the second setting value are negotiated and agreed upon between the client and the gateway device.
[0083] In another embodiment, step 202 can also be performed according to the following process: obtaining the operating environment of the client; if the operating environment does not meet the normal operating conditions, and / or the security status of the client is used to characterize that the client has a security risk, the value of the extended data in the first hello message is set to a third set value; if the operating environment of the client meets the normal operating conditions and the security status of the client is safe, the value of the extended data in the first hello message is set to a fourth set value.
[0084] Specifically, the following process can be used to determine whether the client's operating environment meets the normal operating conditions: obtain the client's operating environment evaluation indicators; if multiple operating environment evaluation indicators meet the operating environment evaluation conditions, determine that the client meets the normal operating conditions; otherwise, determine that the client does not meet the normal operating conditions.
[0085] Optionally, the above-mentioned operating environment evaluation indicators may include, but are not limited to, the installation of anti-virus software, the client operating network, the user's online and offline conditions, etc. On this basis, it is possible to determine whether each operating environment evaluation indicator meets the operating environment evaluation condition according to the following process: Taking the operating environment evaluation conditions corresponding to each indicator as an example, for the installation of anti-virus software, if the user device has installed the anti-virus software, it is determined that the indicator meets the operating environment evaluation condition corresponding to the indicator, otherwise, it does not meet the operating environment evaluation condition; if the client operating network is running in an intranet environment, it is determined that the client operating network meets the corresponding operating environment evaluation condition, if it runs in an extranet, it is determined that it does not meet the operating environment evaluation condition; if the user goes online and offline normally, it is determined that the operating environment evaluation condition corresponding to the online and offline conditions is met, otherwise, it is not met.
[0086] Further, if multiple operating environment evaluation indicators meet the operating environment evaluation conditions, the step of determining that the client meets the normal operating conditions is performed according to the following method: if the user device has anti-virus software installed and runs in the intranet, and the user goes online and offline normally every day, it can be determined that the client meets the normal operating conditions; or, if the user device has anti-virus software installed and runs in the intranet, it can also be determined that the client meets the normal operating conditions.
[0087] On this basis, the evaluation of the above security status can refer to the description of the above corresponding embodiments, and will not be described in detail here.
[0088] After determining the security status and operating environment of the client, the corresponding extended data can be generated according to the above description. For example, if the installed anti-virus software is the latest, and the client runs in the intranet, the client has never been disabled, has never been infected by a virus, and the user is online and offline normally, it means that the current client is safe and reliable, so the value of the extended data can be configured to the fourth setting value to inform the gateway device that the client is safe and reliable; if the client does not follow the anti-virus software, it means that the security of the client cannot be evaluated, and the client is considered unreliable and there may be security risks. At this time, the extended data can be configured to the third setting value to instruct the gateway device to perform spa authentication on the client. Of course, this embodiment is only an example and does not constitute a specific limitation on the evaluation method of normal operating conditions and security status.
[0089] It should be noted that the above is only an example and does not constitute a specific limitation on determining whether each operating environment evaluation indicator meets the operating environment evaluation conditions. In actual applications, the number of operating environment evaluation indicators, operating environment evaluation conditions, etc. can be configured according to actual conditions.
[0090] Optionally, the third setting value may be Y, or a value of 1; the fourth setting value may be N, or, or 0, etc., and the third setting value is different from the fourth setting value. The third setting value is different from the fourth setting value. In addition, the meanings represented by the third setting value and the fourth setting value are negotiated and agreed upon between the client and the gateway device.
[0091] Optionally, based on any of the above embodiments, in this embodiment, the authentication data of the above-mentioned gateway device includes: an online code of the gateway device, a random number generated by the gateway device, and an authentication password of the gateway device; on this basis, step 205 can be performed according to the following process: using the online code, obtain the device serial number corresponding to the online code from the controller; using the set algorithm used by the gateway device to calculate the authentication password, process the online code, the device serial number and the random number to obtain the target password; if the target password is consistent with the authentication password, the gateway device is authenticated.
[0092] Specifically, when the authentication data of the gateway device is carried in an extension field of the second hello message whose type value is 65290, the client can quickly locate and extract the authentication data of the gateway device based on the type value.
[0093] After the client successfully registers and goes online with the controller, the controller will send the gateway information of the gateway device to which the client can establish a connection to the client. The gateway information includes the device serial number and online code of the gateway device. Based on this, the client can store the correspondence between the online code and the device serial number of the gateway device sent by the controller. Based on this, after obtaining the authentication data of the gateway device, the online code in the authentication data can be used to find the above correspondence to obtain the device serial number corresponding to the online code, and the obtained device serial number is the device serial number of the gateway device. Then, the client can use the set algorithm used by the gateway device to generate the authentication password to process the online code, random number and device serial number, thereby generating a target password; and determine whether the target password is the same as the authentication password carried in the authentication data. If they are the same, it indicates that the authentication of the gateway device is passed, and the process of negotiating the tunnel establishment of the embodiment with the gateway device and establishing the SSL tunnel is executed; if they are not the same, it indicates that the authentication of the gateway device is not passed, then the handshake process is terminated and the SSL tunnel is no longer established to the gateway device.
[0094] It is worth noting that the above authentication data may also include the version number of the TCP SPA type used by the gateway device. Based on this, the client can also determine whether the version number used locally is consistent with the version number carried by the authentication data. If they are consistent, the above authentication password recognition process is executed.
[0095] As a result, mutual authentication between the client and the gateway device is achieved, the security of the zero-trust spa authentication solution is enhanced, and the fundamental principle of zero trust is implemented. In addition, the gateway device uses the security status of the client as the basis for determining whether to perform spa authentication. Only when authentication is required will spa authentication be enabled. If authentication is not required, the spa authentication process is directly skipped, thereby improving the resource utilization of the gateway device to a certain extent.
[0096] Based on the same inventive concept, the present application also provides an authentication device corresponding to the authentication method provided by the above-mentioned gateway device side. The implementation of the authentication device can refer to the description of the authentication method of the above-mentioned gateway device, which will not be discussed here one by one.
[0097] See also Figure 3 , Figure 3 An authentication device provided by an exemplary embodiment of the present application is applied to a gateway device, and the device includes:
[0098] A receiving unit 301 is configured to receive a first hello message sent by a client in a user equipment, where the first hello message carries extended data, and the extended data is used to represent a security status of the client;
[0099] an authentication unit 302, configured to authenticate the client using the authentication data of the client in the first hello message if it is determined according to the extended data that the client needs authentication;
[0100] The sending unit 303 is configured to send a second hello message to the client after the authentication unit 302 passes the authentication, so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message.
[0101] Since the above-mentioned first hello message carries extended data for characterizing the security status of the client, when it is determined based on the extended data that the client needs to be authenticated, the authentication of the client is enabled; at the same time, after the client is authenticated, the authentication data of the gateway device is sent to the client to enable the client to authenticate the gateway device, thereby realizing two-way authentication between the client and the gateway device, thereby improving the credibility of the authentication and ensuring the security of business resource access after the authentication is passed.
[0102] Optionally, the authentication device provided in this embodiment may further include:
[0103] A negotiation unit (not shown in the figure) is used to directly perform SSL tunnel negotiation with the client to establish an SSL tunnel if it is determined according to the extended data that the client does not need authentication.
[0104] Optionally, in this embodiment, the authentication data of the above-mentioned gateway device includes: an online code of the gateway device, a random number generated by the gateway device, and an authentication password of the gateway device; wherein the authentication password is obtained by processing the online code, the device serial number of the gateway device and the random number using a set algorithm.
[0105] Optionally, in one embodiment, the above-mentioned authentication unit 302 is specifically used to determine that the client needs authentication if the extended data is a first set value; if the extended data is a second set value, determine that the client does not need authentication; wherein the first set value is used to characterize the security status of the client as that there is a security risk to the client; and the second set value is used to characterize the security status of the client as being safe.
[0106] Optionally, in another embodiment, the extended data is also used to characterize the operating environment of the client; on this basis, the authentication unit 302 is specifically used to determine that the client needs authentication if the extended data is a third setting value; if the extended data is a fourth setting value, determine that the client does not need authentication;
[0107] The third setting value is used to indicate that the operating environment of the client does not meet normal operating conditions, and / or the security status of the client is used to indicate that there are security risks in the client;
[0108] The fourth setting value is used to indicate that the operating environment of the client satisfies the normal operating condition and the security status of the client is safe.
[0109] Based on the same inventive concept, the present application also provides an authentication device corresponding to the authentication method provided by the above user equipment side. The implementation of the authentication device can refer to the description of the authentication method of the above user equipment, which will not be discussed here one by one.
[0110] See also Figure 4 , Figure 4 An authentication device provided by an exemplary embodiment of the present application is applied to a user device, wherein a client is running in the user device, and the device comprises:
[0111] An acquisition unit 401 is used to acquire the security status of the client;
[0112] A construction unit 402 is configured to construct a first hello message according to the security status of the client, wherein the first hello message carries extended data for representing the security status of the client;
[0113] The sending unit 403 is used to send the first hello message to the gateway device;
[0114] The receiving unit 404 is configured to receive a second hello message sent by the gateway device after authenticating the client, where the second hello message carries authentication data of the gateway device;
[0115] The authentication unit 405 is used to authenticate the gateway device according to the authentication data.
[0116] Therefore, by performing two-way authentication between the client and the gateway device during the handshake between the client and the gateway device, the credibility of the authentication is improved; in addition, when the client is shaking hands, it carries extended data used to characterize the security status of the client, allowing the gateway device to determine whether authentication is required based on the extended data, thus improving the flexibility of the gateway device in authenticating the client.
[0117] Optionally, in one embodiment, the above-mentioned construction unit 402 is specifically used to set the value of the extended data in the first hello message to a first set value if the security status of the client is used to characterize that the client has a security risk; if the security status of the client is safe, then the value of the extended data in the first hello message is set to a second set value.
[0118] Optionally, in another embodiment, the above-mentioned construction unit 402 is specifically used to obtain the operating environment of the client; if the operating environment does not meet the normal operating conditions, and / or the security status of the client is used to characterize that there are security risks in the client, the value of the extended data in the first hello message is set to a third set value; if the operating environment of the client meets the normal operating conditions and the security status of the client is safe, the value of the extended data in the first hello message is set to a fourth set value.
[0119] Optionally, in this embodiment, the authentication data of the above-mentioned gateway device includes: an online code of the gateway device, a random number generated by the gateway device, and an authentication password of the gateway device; on this basis, the above-mentioned authentication unit 405 is specifically used to use the online code to obtain the device serial number corresponding to the online code from the controller; use the set algorithm used by the gateway device to calculate the authentication password to process the online code, the device serial number and the random number to obtain the target password; if the target password is consistent with the authentication password, the gateway device is authenticated.
[0120] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which may be, but is not limited to, the above-mentioned gateway device or user equipment. Figure 5As shown, the electronic device includes a processor 501 and a machine-readable storage medium 502, the machine-readable storage medium 502 stores a computer program that can be executed by the processor 501, and the processor 501 is prompted by the computer program to execute the authentication method provided in any embodiment of the present application. In addition, the electronic device also includes a communication interface 503 and a communication bus 504, wherein the processor 501, the communication interface 503, and the machine-readable storage medium 502 communicate with each other through the communication bus 504.
[0121] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0122] The communication interface is used for communication between the above electronic device and other devices.
[0123] The machine-readable storage medium 502 may be a memory, which may include a random access memory (RAM), a DDR SRAM (Double Data Rate Synchronous Dynamic Random Access Memory), or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.
[0124] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0125] In addition, this embodiment also provides a machine-readable storage medium, which stores a computer program. When called and executed by a processor, the computer program prompts the processor to execute the method provided by any embodiment of the present application.
[0126] As for the electronic device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0127] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0128] The implementation process of the functions and effects of each unit / module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0129] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units / modules described as separate components may or may not be physically separated, and the components displayed as units / modules may or may not be physical units / modules, that is, they may be located in one place, or they may be distributed on multiple network units / modules. Some or all of the units / modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art can understand and implement it without creative work.
[0130] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An authentication method, characterized in that: Applied in a gateway device, the method comprises: receiving a first hello message sent by a client in a user equipment, where the first hello message carries extended data, where the extended data is used to characterize a security status of the client; If it is determined according to the extended data that the client needs authentication, authenticating the client using the authentication data of the client in the first hello message; After the authentication is successful, a second hello message is sent to the client, so that the client authenticates the gateway device using the authentication data of the gateway device carried in the second hello message.
2. The method according to claim 1, characterized in that If it is determined according to the extended data that the client does not need authentication, SSL tunnel negotiation is directly performed with the client to establish an SSL tunnel.
3. The method according to claim 1, characterized in that The authentication data of the gateway device includes: an online code of the gateway device, a random number generated by the gateway device, and an authentication password of the gateway device; wherein the authentication password is obtained by processing the online code, the device serial number of the gateway device, and the random number using a set algorithm.
4. The method according to claim 1, characterized in that: Determining whether the client needs authentication according to the extended data includes: If the extended data is a first set value, determining that the client needs authentication; If the extended data is a second set value, determining that the client does not need authentication; The first setting value is used to indicate that the security status of the client is that the client has a security risk; and the second setting value is used to indicate that the security status of the client is safe.
5. The method according to claim 1, characterized in that The extended data is also used to characterize the operating environment of the client; Determining whether the client needs authentication according to the extended data includes: If the extended data is a third set value, determining that the client needs authentication; If the extended data is a fourth setting value, it is determined that the client does not need authentication; The third setting value is used to indicate that the operating environment of the client does not meet normal operating conditions, and / or the security status of the client is used to indicate that there are security risks in the client; The fourth setting value is used to indicate that the operating environment of the client satisfies the normal operating condition and the security status of the client is safe.
6. An authentication method, characterized in that: Applied in a user device, wherein a client is running in the user device, the method comprises: Obtaining the security status of the client; Constructing a first hello message according to the security status of the client, where the first hello message carries extended data for representing the security status of the client; Sending the first hello message to the gateway device; receiving a second hello message sent by the gateway device after authenticating the client, wherein the second hello message carries authentication data of the gateway device; The gateway device is authenticated according to the authentication data.
7. The method according to claim 6, characterized in that Constructing a first hello message according to the security status of the client, including: If the security status of the client is used to indicate that the client has a security risk, setting the value of the extended data in the first hello message to a first set value; If the security status of the client is secure, the value of the extended data in the first hello message is set to a second set value.
8. The method according to claim 6, characterized in that Constructing a first hello message according to the security status of the client, including: Obtaining the operating environment of the client; If the operating environment does not meet the normal operating conditions, and / or the security status of the client is used to indicate that the client has a security risk, setting the value of the extended data in the first hello message to a third set value; If the operating environment of the client satisfies the normal operating condition and the security status of the client is secure, the value of the extended data in the first hello message is set to a fourth set value.
9. The method according to claim 6, characterized in that The authentication data of the gateway device includes: an online code of the gateway device, a random number generated by the gateway device, and an authentication password of the gateway device; Authenticating the gateway device according to the authentication data includes: Using the online code, obtaining a device serial number corresponding to the online code from a controller; Using a set algorithm used by the gateway device to calculate the authentication password, the online code, the device serial number and the random number are processed to obtain a target password; If the target password is consistent with the authentication password, the gateway device is authenticated.
10. An authentication device, characterized in that: Applied in a gateway device, the device comprises: A receiving unit, configured to receive a first hello message sent by a client in a user equipment, wherein the first hello message carries extended data, and the extended data is used to characterize a security status of the client; an authentication unit, configured to authenticate the client using the authentication data of the client in the first hello message if it is determined according to the extended data that the client needs authentication; A sending unit is used to send a second hello message to the client after the authentication unit passes the authentication, so that the client uses the authentication data of the gateway device carried in the second hello message to authenticate the gateway device.
11. An authentication device, characterized in that: Applied in a user equipment, wherein a client is running in the user equipment, the apparatus comprises: An acquisition unit, used to acquire the security status of the client; A construction unit, configured to construct a first hello message according to the security status of the client, wherein the first hello message carries extended data for representing the security status of the client; A sending unit, configured to send the first hello message to a gateway device; A receiving unit, configured to receive a second hello message sent by the gateway device after authenticating the client, wherein the second hello message carries authentication data of the gateway device; An authentication unit is used to authenticate the gateway device according to the authentication data.
