Vulnerability processing method and device, equipment, medium and program product
By determining the hot patch method and generating the corresponding hot patch package according to the vulnerability type, and using the hot patch engine to process the vulnerability, the problems of unstable vulnerability repair and business interruption in the existing technology are solved, and efficient and flexible vulnerability repair is achieved.
Patent Information
- Application Number
- CN202310258554.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-10
AI Technical Summary
Existing technologies use fixed and single solutions when dealing with different types of vulnerabilities, resulting in unstable repairs and business interruptions, and cannot effectively deal with the characteristics and dangers of different types of vulnerabilities.
Provide a vulnerability processing method that obtains the type of target vulnerability, determines the matching hot patch method, and generates the corresponding hot patch package. The hot patch engine is used to process the target process, including replacement at startup, replacement at runtime, and interception and other methods.
It achieves flexible and efficient repair of different types of vulnerabilities, avoids business interruption, ensures the accuracy and efficiency of vulnerability patches, and adapts to the patching requirements of different vulnerability types.
Smart Images

Figure CN118627073A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a vulnerability processing method, a vulnerability processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] A vulnerability is a defect in the specific implementation of software, hardware, or protocols, or in the system security policy, which allows network attackers (such as hackers) to access or damage the system without authorization, and even cause the loss and tampering of data in the system.
[0003] Research shows that existing technologies use fixed and single solutions to solve different types of vulnerabilities. However, different types of vulnerabilities have different vulnerability characteristics (such as life cycle or dangerousness, etc.), which leads to a series of problems when using fixed solutions to solve different types of vulnerabilities, such as the need to restart the business or repair instability. Therefore, how to efficiently repair different types of vulnerabilities has become a research hotspot in the field of vulnerability repair. Summary of the invention
[0004] The embodiments of the present application provide a vulnerability processing method, apparatus, device, medium and program product, which can adopt different hot patching methods for different types of vulnerabilities to achieve efficient vulnerability repair.
[0005] On the one hand, an embodiment of the present application provides a vulnerability processing method, the method comprising:
[0006] Get the target vulnerability to be processed in the target process;
[0007] Based on the vulnerability type of the target vulnerability, determine the hot patch method that matches the target vulnerability;
[0008] Obtaining a target hot patch package corresponding to a target vulnerability according to a hot patch method, where the target hot patch package is used to indicate: processing logic when hot patching is performed on the target vulnerability according to the hot patch method;
[0009] Use the target hot patch package to hot patch the target vulnerability in the target process.
[0010] On the other hand, an embodiment of the present application provides a vulnerability processing device, the device comprising:
[0011] An acquisition unit, used to acquire a target vulnerability to be processed in a target process;
[0012] A processing unit, for determining a hot patch method matching a target vulnerability based on a vulnerability type of the target vulnerability;
[0013] The processing unit is further used to obtain a target hot patch package corresponding to the target vulnerability according to the hot patch method, and the target hot patch package is used to indicate: a processing logic when performing hot patch processing on the target vulnerability according to the hot patch method;
[0014] The processing unit is also used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package.
[0015] In one implementation, the vulnerability type includes any of the following: a short-cycle type, a no-general-rule type, and a general-rule type; wherein,
[0016] The vulnerability type of the target vulnerability is a short-cycle type, and the hot patch methods matching the target vulnerability include: replacing the target vulnerability with a target file when the target process is started;
[0017] The vulnerability type of the target vulnerability is a type without common rules. The hot patch methods matching the target vulnerability include: replacing the target vulnerability with a target file when the target process is running;
[0018] The vulnerability type of the target vulnerability is a common rule type, and the hot patch methods matching the target vulnerability include: intercepting the target vulnerability.
[0019] In one implementation, the processing unit is used to obtain a target hot patch package corresponding to a target vulnerability according to a hot patch method, specifically to:
[0020] Searching for a reference hot patch package corresponding to the hot patch method from a hot patch package database; wherein the hot patch package database contains hot patch packages pre-set for different hot patch methods, each hot patch package is used to indicate the processing logic when hot patching is performed on the target vulnerability according to the corresponding hot patch method;
[0021] Based on the vulnerability type of the target vulnerability and the reference hot patch package, a target hot patch package corresponding to the target vulnerability is generated.
[0022] In one implementation, when the vulnerability type of the target vulnerability includes a short-cycle type or a type without a general rule, the processing unit is used to generate a target hot patch package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hot patch package, specifically to:
[0023] The vulnerability identifier of the target vulnerability is added to the reference hot patch package to generate a target hot patch package corresponding to the target vulnerability.
[0024] In one implementation, when the vulnerability type of the target vulnerability is a general rule type, the processing unit is used to generate a target hot patch package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hot patch package, including:
[0025] The reference hotfix package is used as the target hotfix package corresponding to the target vulnerability.
[0026] In one implementation, the processing unit is further configured to:
[0027] Based on the vulnerability type of the target vulnerability, determine the injection method that matches the target vulnerability;
[0028] The hot patch engine is used to inject the target hot patch package into the target process according to the injection method that matches the target vulnerability.
[0029] In one implementation, the processing unit is further configured to:
[0030] Acquiring operating parameters of computer equipment based on a hot patch engine;
[0031] If the operating parameters meet the injection condition, the step of injecting the target hot patch package into the target process by using the hot patch engine according to the injection method matching the target vulnerability is triggered;
[0032] The operating parameters include at least one of the following: free memory, process interval number, and CPU occupancy rate.
[0033] In one implementation, the vulnerability type of the target vulnerability is a short-cycle type, and the injection method matching the target vulnerability includes: injecting before the target process is started; the processing unit is used to use the hot patch engine to inject the target hot patch package into the target process according to the injection method matching the target vulnerability, specifically for:
[0034] Before the target process is started, a target command corresponding to the target process is obtained based on the hot patch engine, where the target command is used to trigger the start of the target process;
[0035] Add the target command line to the target command to obtain a new target command. The target command line is used to trigger the loading of the target hot patch package.
[0036] When a new target command is run, the target process is started and the target hot patch package is loaded.
[0037] In one implementation, the target hot patch package includes a first replacement function, a vulnerability identifier of a target vulnerability, and a target file, where the target file is a file of a target vulnerability in a target process to be replaced; the target vulnerability is located in a class of the target process; and the processing unit is used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package, specifically for:
[0038] In the process of the class loader loading the class in the target process, calling the first replacement function according to the vulnerability identifier of the target vulnerability to intercept the class loader from loading the target vulnerability;
[0039] The target vulnerability is replaced with the target file, and the class loader is used to continue loading the target file.
[0040] In one implementation, the vulnerability type of the target vulnerability is a type without common rules or a type with common rules, and the injection method matching the target vulnerability refers to: injecting during the running process of the target process; the processing unit is used to use the hot patch engine to inject the target hot patch package into the target process according to the injection method matching the target vulnerability, specifically for:
[0041] During the operation of the target process, the injection tool is called through the hot patch engine, and the injection tool does not depend on the programming environment of the computer device;
[0042] Use the injection tool to inject the target hot patch package into the target process.
[0043] In one implementation, when the vulnerability type of the target vulnerability is a type without a general rule, the target hot patch package includes a second replacement function, a vulnerability identifier of the target vulnerability, and a target file, where the target file is a default file or a setting file; the target vulnerability is located in a class of a target process; and the processing unit is used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package, specifically for:
[0044] Based on the second replacement function and the vulnerability identifier of the target vulnerability, traverse the classes loaded in the target process to obtain a target class containing the target vulnerability;
[0045] Use the class loader to reload the target class, and intercept the class loader's loading of the target vulnerability during the reloading process;
[0046] The target vulnerability is replaced with the target file, and the class loader is used to continue loading the target file.
[0047] In one implementation, when the vulnerability type of the target vulnerability is a general rule type, the target hot patch package includes a detection function; the target vulnerability is located in a class of a target process; and the processing unit is used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package, specifically for:
[0048] Obtaining a first rule configuration file through a target hot patch package, the first rule configuration file includes a class identifier of a target class corresponding to a target vulnerability, a blacklist parameter in the target class, and a hot patch mode; the blacklist parameter includes a vulnerability identifier of the target vulnerability;
[0049] Obtain one or more function parameters in the target class based on the detection function, and compare the one or more function parameters with the blacklist parameters respectively to obtain a comparison result of each function parameter;
[0050] Based on the comparison result of the hot patch mode and each function parameter, hot patch is performed on the target vulnerability in the target process.
[0051] In one implementation, the hot patch mode includes: a bypass mode and an intercept mode;
[0052] When the hot patch mode is the bypass mode, the processing unit is used to perform hot patch processing on the target vulnerability in the target process based on the comparison result between the hot patch mode and each function parameter, specifically to:
[0053] Output the comparison results of each function parameter;
[0054] Alternatively, when the hot patch mode is the interception mode, the processing unit is used to perform hot patch processing on the target vulnerability in the target process based on the comparison result of the hot patch mode and each function parameter, specifically to:
[0055] The detection function is used to intercept the target process from executing the target vulnerability.
[0056] In one implementation, the processing unit is further configured to:
[0057] Acquire a second rule configuration file based on the target hot patch package, where the second rule configuration file is obtained by modifying the first rule configuration file by the business object;
[0058] If the second rule configuration file meets the matching condition with the first rule configuration file, the detection function is used to intercept the operation of the target process on the target vulnerability;
[0059] Among them, the second rule configuration file and the first rule configuration file meet the matching conditions including: the hot patch mode in the second rule configuration file is the interception mode, and the class identifier to be detected contained in the second rule configuration file includes the class identifier of the target class in the first rule configuration file, and one or more blacklist parameters contained in the second rule configuration file include the blacklist parameter in the first rule configuration file.
[0060] In one implementation, the first rule configuration file is obtained by the server to be repaired from the hot patch server through the target hot patch package, and the target process runs on the server to be repaired; the first rule configuration file is determined by:
[0061] The operation platform stores the data in the hot patch server in advance;
[0062] The operation platform sends the hot patch instruction to the hot patch server; the hot patch instruction includes the first rule configuration file, the target hot patch package and the hot patch engine; the target hot patch package and the hot patch engine are forwarded by the hot patch server to the server to be repaired;
[0063] Or, it is obtained by modifying the reference rule configuration file pre-stored in the hot patch server according to the configuration modification information contained in the hot patch instruction.
[0064] On the other hand, an embodiment of the present application provides a computer device, the device comprising:
[0065] A processor for loading and executing computer programs;
[0066] A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned vulnerability processing method is implemented.
[0067] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned vulnerability processing method.
[0068] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and when the computer instructions are executed by the processor, the above-mentioned vulnerability processing method is implemented.
[0069] In the embodiment of the present application, after obtaining the target vulnerability to be repaired in the target process, support the vulnerability type based on the target vulnerability, and determine the hot patch method that matches the target vulnerability; for example, when the vulnerability type is a target vulnerability of a short-cycle type (i.e., the target process where the target vulnerability is located has a short life cycle), the target vulnerability can be repaired by replacing the target vulnerability when the target process is started; for another example, when the vulnerability type is a target vulnerability with a higher risk, the target vulnerability can be repaired by intercepting the target vulnerability when the target process is running. After obtaining the target hot patch package corresponding to the target vulnerability based on the hot patch method that matches the target vulnerability, the target hot patch package is used to perform hot patch processing on the target vulnerability in the target process, which can not only ensure that the target vulnerability is accurately repaired, but also avoid other problems caused by the mismatch between the vulnerability type and the hot patch method. It can be seen from this that the embodiment of the present application prepares different hot patch methods for vulnerabilities of different vulnerability types, which can meet the patch requirements of different vulnerabilities, and is convenient for flexibly selecting matching hot patch methods for vulnerabilities of different vulnerability types, ensuring the efficiency of vulnerability patches. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0071] Figure 1a is a schematic diagram of a vulnerability processing scenario provided by an exemplary embodiment of the present application;
[0072] Figure 1b is a schematic diagram of another vulnerability processing scenario provided by an exemplary embodiment of the present application;
[0073] Figure 1c It is a schematic diagram of another vulnerability processing scenario provided by an exemplary embodiment of the present application;
[0074] Figure 1d is a schematic diagram of yet another vulnerability processing scenario provided by an exemplary embodiment of the present application;
[0075] Figure 2 It is a flowchart of a vulnerability processing method provided by an exemplary embodiment of the present application;
[0076] Figure 3a It is a schematic diagram of performing vulnerability scanning on a server to be repaired provided by an exemplary embodiment of the present application;
[0077] Figure 3b It is a schematic diagram of another vulnerability scanning of a server to be repaired provided by an exemplary embodiment of the present application;
[0078] Figure 4 It is a schematic diagram of a corresponding relationship between a vulnerability type of a target vulnerability, an injection method matching the target vulnerability, and a target hotfix package corresponding to the target vulnerability provided by an exemplary embodiment of the present application;
[0079] Figure 5a It is a schematic diagram of injecting a target hot patch package into a target process and performing hot patch processing on a target vulnerability in the target process, provided by an exemplary embodiment of the present application;
[0080] Figure 5b It is a schematic diagram of performing hot patching on a target vulnerability in a target process provided by an exemplary embodiment of the present application;
[0081] Figure 6 It is a schematic diagram of another method of injecting a target hot patch package into a target process and performing hot patch processing on a target vulnerability in the target process, provided by an exemplary embodiment of the present application;
[0082] Figure 7 It is a schematic diagram of performing hot patch processing on a target vulnerability by adopting a fixed logic replacement method provided by an exemplary embodiment of the present application;
[0083] Figure 8 It is a schematic diagram of another method of injecting a target hot patch package into a target process and performing hot patch processing on a target vulnerability in the target process, provided by an exemplary embodiment of the present application;
[0084] Fig. 9 is a schematic diagram of a vulnerability processing method provided by an exemplary embodiment of the present application;
[0085] Fig.10 It is a schematic diagram of an operation platform performing remote vulnerability scanning on a server to be repaired provided by an exemplary embodiment of the present application;
[0086] Fig.11 It is a flowchart of a vulnerability processing method jointly executed by an operation platform, a hot patch server and a server to be repaired provided by an exemplary embodiment of the present application;
[0087] Fig.12 It is a flowchart of another operation platform, a hot patch server and a server to be repaired jointly executing a vulnerability processing method provided by an exemplary embodiment of the present application;
[0088] Fig.13 It is a flowchart of another exemplary embodiment of the present application, in which an operation platform, a hot patch server and a server to be repaired jointly execute a vulnerability processing method;
[0089] Fig.14 It is a structural schematic diagram of a vulnerability processing device provided by an exemplary embodiment of the present application;
[0090] Fig.15 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0091] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0092] The embodiments of the present application involve vulnerabilities, which are also called security vulnerabilities. They are defects (i.e., unprotected points) in the specific implementation or security policy of hardware, software, or protocols. It is precisely because of the existence of vulnerabilities that network attackers (such as hackers) can access the system through the vulnerabilities without authorization or permission, posing a serious threat to the security of the system or the data inside the system. The sources of vulnerabilities are complex and diverse. For example, vulnerabilities may come from unintentional errors in the design or coding of applications (such as clients, applets, or web (World Wide Web, Global Wide Area Network) applications) or operating systems (such as Android systems, or Internetworking Operating System (IOS)). For another example, vulnerabilities may also come from design defects or unreasonable logical processes in the interactive processing of businesses (any business, such as financial business, transaction business, or search business, etc.).
[0093] In the embodiment of the present application, the vulnerability mainly refers to the vulnerability from the Java (a programming language) component. Among them, the Java component is a component formed by combining some classes (or called Java classes) that meet certain specifications; it can be simply understood that the Java component is a collection containing Java classes. Further, the Java class in the Java component is an abstract data type, which is an abstraction of all entities (or called instances, objects, etc.) with the same characteristics; for example, objects of the vehicle type can include bicycles, cars and trucks, etc., so bicycles, cars and trucks can be combined into a class. One or more member functions (or simply functions) can be defined in a Java class. The member function can be simply understood as an independent code block defined in a Java class to implement a certain function; further, the member function also has a function parameter, which is the data used by the member function when implementing the corresponding function. For example, the function function of a member function in a class is: calculate the square of a number, then a function parameter needs to be input for the member function, so that the square of the function parameter can be calculated using the member function.
[0094] Among them, the vulnerability types from Java components may include but are not limited to: Log4J vulnerabilities and 0day vulnerabilities. Log4J vulnerabilities are vulnerabilities that exist in the Java program log detection component (a component used to record user operations and application behaviors in computer devices); network attackers can use the Log4J vulnerability to remotely execute code on computer devices to steal data, install malware, or control computer devices, etc., causing great harm to the security of computer devices; it can be seen that Log4J vulnerabilities have the characteristics of high harm (or high risk, referred to as high risk), large number and low threshold for exploitation. 0day vulnerabilities, or zero-day vulnerabilities, are vulnerabilities that are unknown to the security personnel responsible for the program, so such vulnerabilities often have no patch program that can be repaired; it can be seen that 0day vulnerabilities have the characteristics of strong timeliness of harm, that is, the vulnerability may be immediately attacked by malicious attacks after it is discovered. It should be noted that the embodiment of the present application does not limit which type of vulnerability the vulnerability is from in the Java component.
[0095] As can be seen from the above description, the vulnerabilities from the Java component are differentiated, such as the vulnerability types of the vulnerabilities are different, and the vulnerabilities under different vulnerability types have specific different vulnerability characteristics, such as the 0day vulnerability has a strong timeliness of harm, and the Log4J vulnerability is dangerous. In order to ensure that the vulnerabilities of different vulnerability types can be patched efficiently and maintain the stability of the business, the embodiment of the present application proposes a vulnerability processing solution based on hot patching, which supports providing different hot patching methods (or repair methods, or repair means) for vulnerabilities of different vulnerability types, that is, the accuracy and efficiency of the vulnerability patch are improved by the matching between the vulnerability type and the hot patching method. Among them, the patch, or software patch, refers to some code (or applet) that can repair software vulnerabilities. According to the impact of the patch method on the business, the software patch can be divided into hot patch and cold patch; hot patch refers to a patch that repairs the vulnerability during the operation of the business and can make the patch effective, that is, the hot patch takes effect without interrupting the business, and can maintain the normal operation of the business processing; on the contrary, cold patch refers to a patch that requires restarting the device to take effect, that is, the business needs to be interrupted and the device needs to be restarted to take effect.
[0096] The general principle of the vulnerability processing scheme provided by the embodiment of the present application is as follows: First, obtain the target vulnerability to be processed in the target process, where the target process is any process used to run the target business in the server to be repaired (i.e., the server that needs to be repaired), that is, the target process is running in the server to be repaired; wherein, a process is a running activity of a program in a computer on a certain data set, which is the basic unit for resource allocation and scheduling of the system, and is the basis of the operating system structure. Then, based on the vulnerability type of the target vulnerability, a hot patch method matching the target vulnerability is determined for the target vulnerability; and based on the hot patch method, a target hot patch package (or hot patch jar package) for patching the target vulnerability is obtained. For example, if the target vulnerability is a vulnerability in a target process with a short life cycle (such as 10 minutes), then the hot patch method matching the target vulnerability may include: replacing the target vulnerability with a safe target file when the target process is started, so as to ensure that the target hot patch package is executed before the end of the life cycle of the target process, so as to perform hot patch processing (i.e., vulnerability repair) on the target vulnerability. Finally, the target hot patch package corresponding to the target vulnerability is used to perform hot patch processing on the target vulnerability in the target process according to the hot patch method matching the target vulnerability.
[0097] It can be seen that the vulnerability processing solution based on hot patching provided by the embodiment of the present application can, on the one hand, implement hot patching of vulnerabilities when the target process is started or running, avoiding business interruption and restart operations, effectively reducing the impact and fluctuation of vulnerability patches on the business, and ensuring uninterrupted business operation. On the other hand, it supports differentiated vulnerabilities and provides a variety of hot patching methods, which can meet the patching requirements of vulnerabilities of different vulnerability types, facilitate flexible selection of matching hot patching methods for vulnerabilities of different vulnerability types, achieve matching between vulnerability types and hot patching methods, and thus improve the efficiency of vulnerability patches.
[0098] The vulnerability handling solution proposed in the embodiment of the present application can be executed by a single or multiple computer devices; that is, the embodiment of the present application does not limit the number and quantity of computer devices used to execute the vulnerability handling solution. For example, the vulnerability handling solution can be executed by a single computer device; in this case, the computer device can refer to the server to be repaired, that is, the server containing the target vulnerability; in actual application, the server to be repaired implements vulnerability scanning and vulnerability patching. For another example: the vulnerability handling solution can be jointly executed by two computer devices; the two computer devices respectively include: a server to be repaired and a hot patch server (or operating platform). For another example: the vulnerability handling solution can be jointly executed by three computer devices, and the three computer devices respectively include: a server to be repaired, an operating platform (such as an application with a hot patch service server and a vulnerability scanning function) and hot patch processing.
[0099] The following is a brief introduction to the execution process of the vulnerability handling solutions under the three exemplary vulnerability handling architectures given above, including:
[0100] (1) The computer device includes a server to be repaired; in this implementation, the server to be repaired is used to carry a vulnerability scanning function and a hot patch service server.
[0101] When an exemplary server to be repaired is used to carry vulnerability scanning functions and hot patch server, the architecture diagram of the vulnerability handling solution can be seen in Figure 1a .like Figure 1a As shown, an application or plug-in with a vulnerability scanning function is deployed in the server to be repaired, so that the server to be repaired can call the vulnerability scanning function to perform vulnerability scanning on the server to be repaired to obtain the target vulnerability to be processed. A hot patch service server is also deployed in the server to be repaired, so as to generate a matching target hot patch package for the target vulnerability scanned in the server to be repaired through the hot patch service server. Furthermore, the server to be repaired can perform hot patch processing on the target vulnerability based on the target hot patch package, specifically, based on the hot patch engine agent, injecting the target hot patch package into the target process, so as to facilitate the use of the target hot patch package in the target process to perform hot patch processing on the target vulnerability.
[0102] (2) The computer device includes a server to be repaired and a hot patch server (or operating platform), taking the server to be repaired and the hot patch server as an example; under this implementation method, the hot patch server can be used to carry the hot patch service server, and the server to be repaired or the hot patch server can be used to carry the vulnerability scanning function.
[0103] An exemplary hot patch server is used to carry the vulnerability scanning function. The architecture diagram of the server to be repaired and the hot patch processing platform jointly executing the vulnerability processing solution can be seen in Figure 1b .like Figure 1bAs shown, when the hot patch server carries the vulnerability scanning function, an application or plug-in with a vulnerability scanning function is deployed in the hot patch server, so that the hot patch server can call the vulnerability scanning function to perform vulnerability scanning on the server to be repaired to obtain the target vulnerability to be processed. The hot patch server is also deployed with a hot patch service server, so that a matching target hot patch package is generated for the target vulnerability scanned in the server to be repaired through the hot patch service server. Then, the hot patch server can send the target hot patch package to the server to be repaired, so that the server to be repaired uses the target hot patch package to perform hot patch processing on the target vulnerability. Specifically, the hot patch server also generates and downloads a hot patch engine agent, so that after the target hot patch package is injected into the target process based on the hot patch engine agent, the target hot patch package is used in the target process to perform hot patch processing on the target vulnerability.
[0104] An exemplary architecture diagram of a server to be repaired and a hot patch processing platform jointly executing a vulnerability processing solution when the server to be repaired is used to carry the vulnerability scanning function can be seen in Figure 1c .like Figure 1c As shown, when the vulnerability scanning function is carried by the server to be repaired, an application or plug-in with a vulnerability scanning function is deployed in the server to be repaired, so that the server to be repaired can call the vulnerability scanning function to perform a vulnerability scan on the server to be repaired to obtain the target vulnerability to be processed. Then, the server to be repaired sends the scanned target vulnerability (specifically the vulnerability information of the target vulnerability (such as vulnerability type, vulnerability identification, etc.)) to the hot patch server. Then, the hot patch server generates a target hot patch package that matches the target vulnerability based on the vulnerability information sent by the server to be repaired. Finally, the hot patch server sends the target hot patch package to the server to be repaired, so that the server to be repaired uses the target hot patch package to perform hot patch processing on the target vulnerability. Specifically, the hot patch server also generates and downloads a hot patch engine agent, so that after the target hot patch package is injected into the target process based on the hot patch engine agent, the target hot patch package is used in the target process to perform hot patch processing on the target vulnerability.
[0105] (3) The computer equipment includes a server to be repaired, an operation platform and a hot patch processing; in this implementation, the operation platform is used to carry the vulnerability scanning function and the hot patch service server, and the hot patch server is used to carry the hot patch engine and the transfer function of the target hot patch package. Alternatively, the operation platform is used to carry the vulnerability scanning worker, and the hot patch server is used to carry the hot patch service server.
[0106] For the sake of convenience, the operation platform is used to carry the vulnerability scanning function and the patch service server, and the hot patch server is used to carry the hot patch engine and the transfer function of the target hot patch package. The architecture diagram of the operation platform, the server to be repaired, and the hot patch processing platform jointly executing the vulnerability processing solution can be seen in Figure 1d .like Figure 1d As shown, a business person who has the need to perform the target business can perform a vulnerability detection operation on the operation platform. At this time, the operation platform can perform a vulnerability scan on the server to be repaired through the vulnerability scanning function to obtain the target vulnerability to be processed in the target process in the server to be repaired. Then, the business person can perform a vulnerability patch operation on the operation platform, indicating that the business person wants to perform a hot patch on the target vulnerability. At this time, the operation platform can generate a matching target hot patch package for the target vulnerability in response to the vulnerability patch operation, and generate a hot patch instruction based on the target hot patch package, and then send the hot patch instruction to the hot patch server. Further, the hot patch server can forward the target hot patch package (also including the hot patch engine) carried by the hot patch instruction to the server to be repaired. Finally, the server to be repaired uses the target hot patch package to perform hot patch processing on the target vulnerability. Specifically, after the target hot patch package is injected into the target process based on the hot patch engine agent, the target hot patch package is used in the target process to perform hot patch processing on the target vulnerability (such as fixed code replacement, or flexible processing of the rule configuration file pulled from the hot patch server by the target hot patch package).
[0107] It should be noted that ① the several architecture diagrams given above are only exemplary. In actual applications, the architecture may change with the vulnerability patch scenario, and the embodiments of this application do not limit the architecture.
[0108] ②See above Figure 1a , Figure 1b , Figure 1c and Figure 1d It can be seen that after the target hot patch package is used to hot patch the target vulnerability, the target hot patch package provided in the embodiment of the present application also supports the output of relevant information of the hot patch processing (such as repair information about the target vulnerability (such as repair time, duration, etc.) and the operation log of the target hot patch package, etc.) to the business personnel, so that the business personnel can view the relevant information to check whether the target vulnerability has been patched. It can be understood that, depending on the different vulnerability processing architectures, the target hot patch outputs the relevant information of the hot patch processing in different ways; Figure 1d As shown, the target hot patch package is supported to transmit the relevant information of the hot patch processing back to the hot patch server, so that the business personnel can log in to the hot patch server through the operation platform to view the relevant information.
[0109] ③ When the computer device mentioned above is a server (such as a server to be repaired or a hot patch server), the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this.
[0110] Similarly, when the computer device mentioned above is an operating platform, it may specifically refer to a terminal device equipped with the operating platform. The terminal device may include but is not limited to: smart phones (such as Android phones, iOS phones, etc., which can be referred to as mobile phones), tablet computers (or simply computers), portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), intelligent voice interaction devices, smart home appliances, vehicle-mounted devices (or called vehicle-mounted terminals), head-mounted devices, and aircraft and other smart devices that can perform touch screens. Among them, the terminal device and the server can be directly or indirectly connected through wired or wireless communication, and the embodiments of the present application are not limited here.
[0111] Based on the vulnerability handling solution described above, the embodiment of the present application proposes a more detailed vulnerability handling method. The vulnerability handling method proposed in the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0112] See also Figure 2 , Figure 2 is a flowchart of a vulnerability processing method provided by an exemplary embodiment of the present application; the vulnerability processing method can be executed by a computer device, as described above, the number of computer devices can be single or multiple, Figure 2 In the embodiment, the computer device is taken as an example of a server to be repaired. The vulnerability processing method includes but is not limited to steps S201-S204:
[0113] S201: Obtain target vulnerabilities to be processed in the target process.
[0114] The target process may refer to a program used to implement any target business running in the server to be repaired. The target vulnerability to be processed in the target process may refer to an error caused by the program coding (or other reasons), such as an error in the function parameters of the member function contained in the class during the Java coding process; in this way, a network attacker may access the target process in the server to be repaired without authorization through the target vulnerability, which may cause the target process to fail to run normally or the data involved in the target process to be leaked, or even cause the server to be repaired to be paralyzed.
[0115] As described above, a vulnerability scanning function can be deployed in the server to be repaired, such as an application or plug-in with a vulnerability scanning function deployed in the server to be repaired, so that the server to be repaired can use the vulnerability scanning function to perform vulnerability scanning on each local process to obtain the target vulnerability to be processed in the target process. Among them, when the vulnerability scanning function is called to perform vulnerability scanning on the server to be repaired locally, it is specifically based on a vulnerability database (such as containing multiple existing vulnerabilities), and the server to be repaired is detected locally by scanning and other means. If a vulnerability scanned locally on the server to be repaired is the same as a vulnerability in the vulnerability database, then the vulnerability is determined to be a vulnerability existing in the server to be repaired. Of course, when the vulnerability scanning is actually performed on the server to be repaired, it can be further subdivided into database vulnerability scanning of the server to be repaired, network vulnerability scanning of the server to be repaired, and scanning of the service host of the server to be repaired, etc. The specific implementation process of the vulnerability scanning is not limited in the embodiment of the present application.
[0116] It is worth noting that the vulnerability scanning function may not be deployed in the server to be repaired. At this time, when the business personnel have the need to perform vulnerability scanning on the server to be repaired, other devices with vulnerability scanning functions can be deployed to perform remote vulnerability scanning on the server to be repaired to obtain the target vulnerability to be processed in the server to be repaired, specifically the target vulnerability to be processed in the target process in the server to be repaired. For example, assuming that the vulnerability scanning function is not deployed in the server to be repaired, but the vulnerability scanning function is deployed in the reference computer device (such as any computer device independent of the server to be repaired), and a communication connection is established between the reference computer device and the server to be repaired, then the business personnel perform a vulnerability scanning operation in the reference computer device to trigger the reference computer device to perform a remote vulnerability scan on the server to be repaired, and send the vulnerability scanning results to the server to be repaired, so that the server to be repaired can obtain the target vulnerability.
[0117] It should be noted that the embodiments of the present application do not limit the specific implementation process of the vulnerability scanning operation performed by the business personnel in the reference computer device. Figure 3aAs shown, it is assumed that an operation platform is deployed in the terminal device held by the business personnel, and the operation platform has a vulnerability scanning function; then the vulnerability scanning interface provided by the operation platform can be output on the display screen of the terminal device, and the business personnel can enter the service identifier of the server to be repaired to be scanned in the vulnerability scanning interface (such as device ID, device number, etc., which are used to uniquely identify the server to be repaired). Then, the business personnel can trigger the start button (or button, option, component, control, etc.) in the vulnerability scanning interface to trigger the terminal device (specifically the operation platform running in the terminal device), find the server to be repaired according to the service identifier of the server to be repaired, and perform a vulnerability scan on the server to be repaired to obtain the target vulnerability to be repaired in the target process of the server to be repaired. Finally, the terminal device can return the vulnerability information of the target vulnerability (such as the vulnerability identifier or the target process where the target vulnerability is located, etc.) to the server to be repaired. Of course, the above Figure 3a It is only a schematic diagram of an exemplary vulnerability scanning interface provided in the embodiment of the present application. In actual applications, the interface style and interface content (or interface elements) of the vulnerability scanning interface may change, and the embodiment of the present application does not limit this.
[0118] It should also be noted that, in addition to the above description, the business personnel triggers the vulnerability scan of the server to be repaired in the terminal device, and the server to be repaired can also actively send a vulnerability scan request to the terminal device, so that the terminal device responds to the vulnerability scan request to scan the vulnerability of the server to be repaired. Figure 3b As shown, a timer is set in the server to be repaired, so a vulnerability scanning request can be actively sent to the terminal device every target time period (such as 24 hours) according to the timer; this can realize the vulnerability self-check of the server to be repaired and improve the security of the server to be repaired. It should be understood that the specific duration of the target time period of the timer in the server to be repaired can be customized by the business personnel according to business needs, and the embodiment of the present application does not limit the specific duration of the target time period.
[0119] S202: Based on the vulnerability type of the target vulnerability, determine a hot patch method that matches the target vulnerability.
[0120] As described above, the vulnerability characteristics (or features) of different vulnerabilities are different; for example, Log4J vulnerabilities have the characteristics of high harmfulness, while 0day vulnerabilities have the characteristics of high timeliness. The embodiment of the present application supports roughly classifying vulnerabilities into three vulnerability types according to vulnerability characteristics, namely: short-cycle type, no general rule type, and general rule type; and, based on the vulnerability characteristics corresponding to each vulnerability type, the embodiment of the present application sets different hot patching methods for vulnerabilities of different vulnerability types to achieve matching between hot patching methods and vulnerability types, thereby using hot patching methods to better hot patch matching vulnerabilities and improve the patch success rate and patch efficiency of the target vulnerability.
[0121] The vulnerability type of the target vulnerability involved in the embodiment of the present application may be any one of the three vulnerability types mentioned above; the following introduces the vulnerability characteristics of the target vulnerability when the target vulnerability is each of the vulnerability types mentioned above, and the hot patch method matching the target vulnerability, wherein:
[0122] (1) The vulnerability type of the target vulnerability is a short-cycle type. In this case, the target vulnerability may include: vulnerabilities in processes whose life cycle (i.e., the duration from the start to the end of the process) is less than the cycle threshold. Considering that the life cycle of the target process containing the target vulnerability is short, such as 2 minutes, the existence time of the target vulnerability is also short, that is, the target vulnerability under the short-cycle type has the characteristic of a short life cycle. For example, the Hadoop service (a service for distributed processing of massive data) will frequently generate sub-processes with a short life cycle. Then, for the sub-processes in the Hadoop service, the existence time of the vulnerability in the sub-process is also short.
[0123] For the target vulnerability of short cycle type, on the one hand, considering that the life cycle of the target process where the target vulnerability is located is very short, if the target vulnerability in the target process is hot patched when the target process is running, it is likely that the hot patching process has not yet completed the target process and has ended, so the embodiment of the present application supports hot patching the target vulnerability when the target process is started. On the other hand, considering that the danger level of the target vulnerability is often not very high, in order to ensure the normal operation of the target business, the embodiment of the present application supports the use of a safe target file to replace the target vulnerability in the target process to achieve hot patching. Based on this, the embodiment of the present application is set for the target vulnerability of short cycle type, and the hot patching method matched with the target vulnerability (at this time, the vulnerability of the short cycle type) can include: using the target file to replace the target vulnerability when the target process is started. That is to say, it is supported to follow the injection of the target hot patch package (at this time, the target hot patch package can be called a fixed logic hot patch package, and the fixed logic hot patch package contains a safe target file) when the target process is started to achieve hot patching of the target vulnerability, so as to ensure that the target vulnerability in the target process has been replaced with safe data when the target process is running normally, thereby achieving the repair of the target vulnerability and effectively protecting the safety of the target process.
[0124] (2) The vulnerability type of the target vulnerability is a type without general rules. In this case, the target vulnerability may include: a vulnerability without general repair rules. Vulnerabilities under the type without general rules have the characteristic that they can only be patched using a fixed hot patch method. For example, some services (such as ElasticSearch) do not have network communication and / or file read and write permissions. Therefore, for the process in the service, it cannot implement the patch of the vulnerability through communication or read and write functions, and can only use a fixed method to patch the vulnerability.
[0125] For the target vulnerability without general rule type, on the one hand, considering that the life cycle of the target process where the target vulnerability is located is not very short, it is supported to perform hot patch processing on the target vulnerability during the operation of the target process. On the other hand, considering that the target vulnerability may not have network communication and / or file read and write permissions, it is impossible to obtain a flexible hot patch package through the network or by reading a file, so it is supported to replace the target vulnerability in the target process with a safe and fixed target file to achieve hot patch processing. Based on this, the embodiment of the present application is set for the target vulnerability without general rule type, and the hot patch method matched with the target vulnerability (at this time, a vulnerability without general rule type) can include: replacing the target vulnerability with a target file when the target process is running. That is to say, it is supported to replace the target vulnerability (such as risky code) with a target hot patch package (at this time, the target hot patch package can be called a fixed logic hot patch package, and the fixed logic hot patch package contains a safe target file) during the operation of the target process, so as to achieve hot patch processing on the target vulnerability, not only without the need to restart the target process, but also to ensure the continuity of the target business, and effectively repair the target vulnerability.
[0126] (3) The vulnerability type of the target vulnerability is a general rule type. In this case, the target vulnerability may include: vulnerabilities whose vulnerability risk level is greater than the risk threshold. Vulnerabilities under the general rule type have the characteristics of high risk and wide coverage, such as Log4J vulnerabilities.
[0127] For the target vulnerability of the general rule type, on the one hand, considering that the life cycle of the target process where the target vulnerability is located is not very short, it is supported to perform hot patch processing on the target vulnerability during the operation of the target process. On the other hand, considering that the target vulnerability has high risk, in order to be able to maintain the security of the target business, it is supported to directly intercept the target vulnerability to achieve the hot patch processing of the target vulnerability, that is, to achieve the purpose of maintaining the security of the target business by blocking the operation of the target vulnerability. Based on this, the embodiment of the present application is set for the target vulnerability of the general rule type, and the hot patch method matched with the target vulnerability (the vulnerability of the general rule type at this time) can include: intercepting the target vulnerability, or reporting the target vulnerability to information; specifically, it can be based on the hot patch mode contained in the rule configuration file dynamically configured by the business personnel, realizing the information reporting of the target vulnerability (such as reporting the vulnerability information of the target vulnerability to the business personnel) or interception. That is to say, it is supported to intercept the operation of the target vulnerability during the operation of the target process to achieve the hot patch processing of the target vulnerability, which can not only maintain the continuous operation of the target business, but also effectively avoid the security problems caused by the operation of the target vulnerability.
[0128] Based on the above descriptions of hot patching methods matching different vulnerability types in (1)-(3), when the vulnerability type of the target vulnerability is a short-cycle type or a type without general rules, the hot patching methods matching the target vulnerability all use fixed logic to repair the target vulnerability, that is, by replacing the target vulnerability with a safe target file to achieve the effect (or purpose) of repairing the target vulnerability. When the vulnerability type of the target vulnerability is a general rule type, the hot patching method matching the target vulnerability processes the target vulnerability through dynamic interception, that is, by blocking the operation of the target vulnerability to achieve the effect of patching the vulnerability.
[0129] In actual application, after scanning the target vulnerability in the target process from the server to be repaired, the target vulnerability can be analyzed for type to obtain the vulnerability type to which the target vulnerability belongs; specifically, the embodiment of the present application can pre-set the above-mentioned vulnerability types, and after obtaining the target vulnerability in the target process, the vulnerability type of the target vulnerability can be determined from the vulnerability types preset in the embodiment of the present application according to the vulnerability characteristics of the target vulnerability (such as the short life cycle of the process where the vulnerability is located, or the high risk of the vulnerability, or the service that creates the target process does not have network communication authority, etc.). Further, based on the vulnerability type of the target vulnerability, a hot patch method that matches the target vulnerability can be determined; specifically, the embodiment of the present application also pre-sets a hot patch method that matches the vulnerability under each vulnerability type, so that after determining the vulnerability type of the target vulnerability based on the above steps, a hot patch method that matches the target vulnerability can be determined based on the vulnerability type.
[0130] It can be seen that the embodiment of the present application supports classifying vulnerabilities into corresponding vulnerability types according to the vulnerability characteristics of different vulnerabilities, and setting matching hot patching methods for vulnerabilities of different vulnerability types; compared with setting the same hot patching method for vulnerabilities of different vulnerability types, the matching degree between the target vulnerability and the hot patching method can be improved, so that when a hot patching method with a high matching degree is used to patch the target vulnerability, the patching efficiency and patching success rate of the target vulnerability can be improved, and the security of the target process and target business can be effectively ensured.
[0131] S203: Obtain a target hot patch package corresponding to the target vulnerability according to the hot patch method.
[0132] The target hot patch package corresponding to the target vulnerability can be used to indicate: the processing logic when hot patching the target vulnerability in accordance with the hot patch method that matches the target vulnerability; that is, the target hot patch package can be understood as a complete piece of code or applet, which fully explains the complete processing logic when hot patching the target vulnerability in accordance with the hot patch method. In this way, after the server to be repaired obtains the target hot patch package of the target vulnerability object in accordance with the hot patch method that matches the target vulnerability, it can use the target hot patch package in accordance with the hot patch method that matches the target vulnerability to perform hot patching on the target vulnerability, thereby achieving the goal of personalized repair or patch vulnerability.
[0133] The embodiment of the present application supports pre-setting a corresponding hot patch package for each hot patch method, so that after determining a matching hot patch method for a target vulnerability, a hot patch package for characterizing the hot patch processing logic of the hot patch method matching the target vulnerability can be searched from multiple pre-set hot patch packages, and a target hot patch package corresponding to the target vulnerability can be obtained based on the hot patch package. In a specific implementation, the specific implementation process of obtaining a target hot patch package corresponding to a target vulnerability based on a hot patch method matching the target vulnerability may include but is not limited to steps s11-s12; wherein:
[0134] s11: Search the hot patch package data for a reference hot patch package corresponding to a hot patch method that matches the target vulnerability.
[0135] In practical applications, in order to facilitate the storage of the hot patch packages corresponding to each hot patch mode, the embodiment of the present application supports storing the hot patch packages set for each hot patch mode in the hot patch package database, that is, the hot patch package database contains hot patch packages pre-set for different hot patch modes, and each hot patch package is used to indicate the processing logic when the target vulnerability is hot patched according to the corresponding hot patch mode. In addition, the embodiment of the present application also supports storing the corresponding relationship between the hot patch mode and the hot patch package, so that the corresponding hot patch package can be indexed according to the hot patch mode, and the corresponding hot patch mode can also be indexed according to the hot patch package. Therefore, after determining the matching hot patch mode for the target vulnerability, the reference hot patch package corresponding to the hot patch mode matching the target vulnerability can be found from the hot patch package database according to the corresponding relationship between the hot patch mode and the hot patch package mentioned above, and the reference hot patch package fully expresses the processing logic when the vulnerability is hot patched according to the hot patch mode matching the target vulnerability. It can be seen from this that by storing the corresponding relationship between the hot patch mode and the hot patch package, the speed of finding the hot patch package can be effectively improved, thereby improving the efficiency of finding the target hot patch package corresponding to the target vulnerability, and further improving the efficiency of the target vulnerability patch.
[0136] It is worth noting that, from the above description, it can be seen that the hot patch methods that match vulnerabilities of different vulnerability types are different, such as the hot patch method that matches the vulnerability of the short-cycle type is different from the hot patch method that matches the vulnerability of the type without general rules. Therefore, the embodiment of the present application can also store the correspondence between the vulnerability type and the hot patch package; in this way, the hot patch package corresponding to the hot patch method corresponding to the vulnerability type can be indexed according to the vulnerability type. Under this implementation method, after obtaining the target vulnerability to be processed in the target process, the target hot patch package corresponding to the target vulnerability can be obtained from the hot patch database according to the vulnerability type of the target vulnerability and the pre-set correspondence between the vulnerability type and the hot patch package. The embodiment of the present application does not limit which of the two methods described above (through the correspondence between the hot patch method and the hot patch package, and through the correspondence between the vulnerability type and the hot patch package) is used to obtain the target hot patch package corresponding to the target vulnerability, and it is explained here.
[0137] s12: Generate a target hotfix package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hotfix package.
[0138] It should be noted that, depending on the vulnerability type of the target vulnerability, the target hotfix package generated for the target vulnerability is different, and the specific generation process of the target hotfix package is also different. The following is a brief introduction to the generation process of the target hotfix package corresponding to the target vulnerability of different vulnerability types, including:
[0139] (1) The vulnerability type of the target vulnerability includes a short-cycle type or a type without general rules. As can be seen from the above description, when the vulnerability type of the target vulnerability is a short-cycle type or a type without general rules, the hot patch method that matches the target vulnerability is to replace the target vulnerability with a target file, except that the time node for executing the replacement (such as replacing when the target process is started in the case of a short-cycle type, and replacing when the target process is running in the case of a type without general rules) is different. In order to be able to find the target vulnerability to be processed from the target process when the reference hot patch package is used to perform hot patch processing, the embodiment of the present application also supports adding the vulnerability identifier of the target vulnerability (such as information used to uniquely identify the target vulnerability, such as a name) to the reference hot patch package when the vulnerability type of the target vulnerability is a short-cycle type or a type without general rules, so as to generate a target hot patch package corresponding to the target vulnerability; in this way, the target hot patch package can find the target vulnerability to be processed in the target process, and perform hot patch processing on the target vulnerability in accordance with the hot patch method that matches the target vulnerability.
[0140] Furthermore, the target file used to replace the target vulnerability in the target process in the embodiment of the present application may be a pre-set default file included in the reference hot patch package, or a personalized file provided by the business personnel. When the business personnel wish to use the default file for replacement, they only need to execute the above steps to add the vulnerability identifier of the target vulnerability to the reference hot patch package, and then the reference hot patch package with the added vulnerability identifier can be used as the target hot patch package corresponding to the target vulnerability. When the business personnel wish to use a personalized file for replacement, the implementation process of generating a target hot patch package for the target vulnerability may also include: obtaining a personalized file provided by the business personnel, and using the personalized file to replace the default file in the reference hot patch package; using the reference hot patch package after the default file is replaced with the personalized file as the target hot patch package corresponding to the target vulnerability.
[0141] It can be seen that by replacing the default file with the personalized file provided by the business personnel in the reference hot patch package, not only can the target vulnerability be repaired by replacing it with a safe personalized file, but the personalized file provided by the business personnel can also be executed to realize the file function indicated by the personalized file.
[0142] (2) The vulnerability type of the target vulnerability is a general rule type. When the vulnerability type of the target vulnerability is a general rule type, it is supported to use the reference hot patch package as the target hot patch package corresponding to the target vulnerability; that is, the reference hot patch package set for the vulnerability of the general rule type is a general hot patch package, and when the vulnerability type of any vulnerability is a general rule type, the general reference hot patch package can be directly used as the target hot patch package corresponding to any vulnerability.
[0143] In summary, through the above steps s11-s12, it is possible to generate corresponding target hotfix packages for target vulnerabilities of different vulnerability types.
[0144] S204: Using the target hot patch package to perform hot patch processing on the target vulnerability in the target process.
[0145] In practical applications, the embodiment of the present application uses a hot patch engine to inject a target hot patch package into a target process, so that the target hot patch package is used in the target process to perform hot patch processing on the target vulnerability. In other words, the hot patch engine can be used to scan the process in the server to be repaired, and inject the target hot patch package into the target process containing the target vulnerability to be processed, so that the target hot patch package is used in the target process to perform hot patch processing on the target vulnerability. The hot patch engine is pre-set and stored.
[0146] Furthermore, depending on the vulnerability type of the target vulnerability, the hot patch engine may inject the target hot patch package into the target process in different ways; specifically, the injection time nodes of the target hot patch package into the target process are different. Specifically, taking into account the differences in the life cycles of the target processes, the embodiments of the present application also need to consider the injection time nodes when using the hot patch engine to inject the target hot patch package. For example, for a target vulnerability in a target process with a short life cycle, since there is no time to inject the target hot patch package when the target process is running, it is necessary to inject the target hot patch package before the target process is started, and load the target hot patch package together when the target process is started. For another example, for a target vulnerability in a service that does not have network communication and / or file read and write permissions, there is no need to pay attention to the injection time node of the target hot patch package at this time, such as the target hot patch package can be injected and loaded during the operation of the target process.
[0147] In the specific implementation, it supports determining the injection method (or injection time node) that matches the target vulnerability based on the vulnerability type of the target vulnerability, and then uses the hot patch engine to inject the target hot patch package into the target process according to the injection method that matches the target vulnerability. The corresponding relationship between the vulnerability type of the target vulnerability, the injection method that matches the target vulnerability, and the target hot patch package corresponding to the target vulnerability can be found in Figure 4 ;like Figure 4 As shown in the figure, after obtaining the target vulnerability to be processed in the target process, the target hot patch package and the hot patch engine matching the target vulnerability can be obtained; wherein the hot patch engine can be used to inject the target hot patch package into the target process. Among them: ① When the vulnerability type of the target vulnerability is a short-term type, that is, the target vulnerability belongs to a vulnerability in the target process with a short life cycle (such as Figure 4Scenario 1); the injection method that matches the target vulnerability is: injecting the target hot patch package before the target process starts; the target hot patch package corresponding to the target vulnerability can be called the first fixed logic hot patch package, and the hot patch processing logic represented by the first fixed logic hot patch package is: replacing the target vulnerability through fixed logic. ② When the vulnerability type of the target vulnerability is the type without general rules, it means that the target vulnerability can only be patched with fixed logic; the injection method that matches the target vulnerability is: injecting the target hot patch package when the target process is running; the target hot patch package corresponding to the target vulnerability can be called the second fixed logic hot patch package, and the hot patch processing logic represented by the second fixed logic hot patch package is: replacing the target vulnerability through fixed logic. ③ When the vulnerability type of the target vulnerability is a general rule type, it means that the target vulnerability can be patched using dynamic rules; the injection method that matches the target vulnerability is: injecting the target hot patch package when the target process is running; the target hot patch package corresponding to the target vulnerability can be called a flexible logic hot patch package, and the hot patch processing logic represented by the flexible logic hot patch package is: hot patching the target vulnerability through a dynamically configured rule configuration file, and the hot patch processing at this time includes detection or interception.
[0148] The following describes the specific implementation process of injecting a target hot patch into a target process and using a target hot patch package to perform hot patch processing on a target vulnerability in a target process when the vulnerability type of the target vulnerability is a short-cycle type, a type without a general rule, and a general rule type, respectively. In particular:
[0149] 1. The vulnerability type of the target vulnerability is a short-term type.
[0150] When the vulnerability type of the target vulnerability is a short-cycle type, the injection method that matches the target vulnerability includes: injecting before the target process is started. Then, the process of injecting the target hot patch package into the target process using the hot patch engine according to the injection method that matches the target vulnerability may include: before the target process is started, the target command corresponding to the target process is obtained based on the hot patch engine, and the target command is a piece of code used to trigger the start of the target process; then, the target command line is added to the target command to obtain a new target command, and the target command line is a command line used to trigger the loading of the target hot patch package. Among them, the command line can be called a command prompt, which is a work prompt for prompting command input, and can be used to command the server to be repaired to perform certain functions. For example, the target command line added to the target command in the embodiment of the present application can be "-javaagent: target hot patch package", and the target command line can be used to trigger the loading of the target hot patch package; in this way, when the new target command (i.e., the target command that adds the target command line) is run, the start of the target process and the loading of the target hot patch package will be triggered.
[0151] Furthermore, when the vulnerability type of the target vulnerability is a short-cycle type, the target vulnerability is replaced by using fixed logic to achieve repair. At this time, the target hot patch package corresponding to the target vulnerability can be called the first fixed logic hot patch package. Among them, the first fixed logic hot patch package includes a first replacement function (such as a premain() function, which is used to implement file replacement, that is, replace the target vulnerability in the target process), a vulnerability identifier of the target vulnerability, and a target file; the target file is a file of the target vulnerability in the target process to be replaced (such as a default file or a personalized file specified by a business person). In this implementation method, assuming that the target vulnerability is located in the class of the target process, then after the target hot patch package is injected into the target process, the specific implementation process of using the target hot patch package to perform hot patch processing on the target vulnerability in the target process may include: in the process of the class loader loading the class in the target process, calling the first replacement function according to the vulnerability identifier of the target vulnerability, intercepting the class loader from loading the target vulnerability; then, using the target file to replace the target vulnerability, and using the class loader to continue loading the target file. Among them, a class loader (ClassLoader) is a loader that loads a class Class, which can be used to load the class into memory and realize the conversion of the bytecode form of the class into an object in memory form.
[0152] like Figure 5a As shown, after the hot patch engine injects the first fixed logic hot patch package into the target process by means of a command line; when the target process is started by means of a new target command (the target command in the target command line), the first fixed logic hot patch package can be loaded together, so that the target vulnerability at risk in the target process is replaced with a safe target file by the first fixed logic hot patch package, and the operation of the target business corresponding to the target process is not affected. Among them, the first fixed logic hot patch package also includes a reference file MAINFEST.MF file, which is used to indicate that the first replacement function is executed before the main() function of the target business is executed; that is, when the target process is started, it is determined according to the reference file MAINFEST.MF file that before executing the target business (specifically executing the main() function of the target business), the first replacement function contained in the first fixed logic hot patch package is executed first, so as to repair the target vulnerability before running the target business, thereby ensuring the security of the target business.
[0153] The process of hot patching the target vulnerability in the target process based on the first replacement function can be seen in Figure 5b ;like Figure 5b As shown:
[0154] First, the first replacement function registers the conversion method in the target process; specifically, based on the API interface of Instrumentation in java.lang.Instrument provided by the target process, a Transformer object instantiated by the ClassFileTransformer class is registered in the target process, and the Transformer contains a conversion method (such as the transform method). Then, in the target process, when the class loader ClassLoader is about to load the class to be used (i.e., the class containing the target vulnerability), the target vulnerability in the class (such as the bytecode to be patched in the class A file (a binary file containing the executable file) or a byte array) is intercepted, that is, the class loader is prevented from loading the target vulnerability; and the intercepted target vulnerability is sent to the first fixed logic hot patch package. Then, the first fixed logic hot patch package can replace the target vulnerability with the target file (i.e., the safe bytecode that is desired to be changed); specifically, the target vulnerability can be replaced with the target file through the ASM (assembly) framework (java bytecode manipulation framework), such as replacing part of the bytecode of the class A file with a safe bytecode through the ASE framework. Among them, the ASM framework is a general Java bytecode operation and analysis framework that can be used to modify classes or dynamically generate classes directly in binary form. The ASM framework provides bytecode conversion and analysis algorithms and is a tool that can be used to build custom complex conversion and code analysis. Finally, the replaced target file is returned to the class loader ClassLoader for loading. At this time, the class loader ClassLoader loads a safe target file.
[0155] Through the above process, the risky class Class (specifically the target vulnerability in the class) can be replaced with a safe class before loading, so that when the target business main() function is subsequently executed, the safe target file is loaded, thereby ensuring the safe operation of the target business.
[0156] 2. The vulnerability type of the target vulnerability is a type without common rules.
[0157] When the vulnerability type of the target vulnerability is a type without a general rule, the injection method that matches the target vulnerability includes: injecting during the operation of the target process. Then the process of injecting the target hot patch package into the target process using the hot patch engine in accordance with the injection method that matches the target vulnerability may include: calling the injection tool through the hot patch engine during the operation of the target process; injecting the target hot patch package into the target process using the injection tool. In addition, after the target hot patch package is injected into the target process through the injection tool, the target hot patch package will automatically run in the target process to implement the process of hot patching the target vulnerability in the target process using the target hot patch package. Among them, the injection tool can be independent of the programming environment of the computer device and support any tool that injects the program into the process; this can ensure that in the case of uncertainty whether a certain programming environment (such as a java environment) is installed in the server to be repaired, the target hot patch package can still be injected into the target process through the injection tool; the injection tool provided in the embodiment of the present application may include a binary jattach tool, and the embodiment of the present application does not limit the specific type of the injection tool.
[0158] Furthermore, when the vulnerability type of the target vulnerability is a type without general rules, the target vulnerability is replaced by using fixed logic to achieve repair. At this time, the target hot patch package corresponding to the target vulnerability can be called a second fixed logic hot patch package. The second fixed logic hot patch package includes a second replacement function (such as the agentmain() function, which is used to implement file replacement, that is, replace the target vulnerability in the target process), a vulnerability identifier of the target vulnerability, and a target file; the target file is the file of the target vulnerability in the target process to be replaced. In this implementation method, it is assumed that the target vulnerability is located in the class of the target process, such as Figure 6 As shown, after injecting the target hot patch package into the target process, the specific implementation process of using the target hot patch package to perform hot patch processing on the target vulnerability in the target process may include:
[0159] First, the second replacement function will register the transformation method in the target process just like the first replacement function; specifically, based on the Instrumentation API interface in java.lang.Instrument provided by the target process, a Transformer object instantiated by the ClassFileTransformer class is registered in the target process, and the Transformer contains transformation methods (such as the transform method). Then, considering that the vulnerability type of the target vulnerability is a type without common rules, the injection method that matches the target vulnerability is: injection during the running of the target process, which means that when the target hot patch package is injected into the target process, all classes in the target process have been loaded when the target process is started; therefore, at this time, based on the second replacement function and the vulnerability identifier of the target vulnerability, the loaded classes in the target process can be traversed to obtain the target class containing the target vulnerability (such as Figure 6 The class A shown in the figure is used to traverse the classes in the target process through the interface provided by Instrumentation in java.lang.Instrument provided by the target process. Then, the reloading of the target class containing the target vulnerability is triggered, specifically, the target class is reloaded by the class loader; and the loading of the target vulnerability of the class loader is intercepted by the transformation method in the Transformer during the reloading process. Finally, the target vulnerability is replaced by the target file, and the target file is continued to be loaded by the class loader.
[0160] In summary, when the vulnerability type of the target vulnerability is a short-cycle type or a type without general rules, the hot patch of the target vulnerability is implemented by fixed logic replacement; that is, after determining the target vulnerability, if a member function contained in a class in the target process is risky, a fixed logic hot patch package (such as the first fixed logic hot patch package, or the second fixed logic hot patch package) matching the target vulnerability will be used for replacement and repair, so as to achieve the purpose of quickly repairing the target vulnerability. An exemplary schematic diagram of hot patching the target vulnerability by using fixed logic replacement can be seen in Figure 7 ;like Figure 7 As shown in the figure, assuming that the lookup() function in the code is risky, the relevant logic of the lookup() function (that is, the specific statement part of the function) can be directly replaced with the return function return() function; then when the lookup() function is subsequently executed, the logic of the return() function is executed, such as Figure 7The logic of the return() function shown is: return the string "{modified by tencent RASP}" + string + "}}", thereby avoiding the execution of the original logic of the lookup() function and circumventing the risks that the lookup() function brings to the target business. Of course, the target file used to replace the lookup() function in this embodiment of the application is not limited. For example, the return() function may not replace the related logic of the lookup() function, or the string returned by the return() function is another string. The specific content of the target text used to replace the lookup() function is not limited in this embodiment of the application.
[0161] 3. The vulnerability type of the target vulnerability is a common rule type.
[0162] It should be noted that when the vulnerability type of the target vulnerability is a general rule type, the injection method that matches the target vulnerability is the same as the injection method when the vulnerability type of the target vulnerability is a non-general rule type; that is, when the vulnerability type of the target vulnerability is a non-general rule type or a general rule type, the injection method that matches the target vulnerability refers to: injection during the running process of the target process; here, when the vulnerability type of the target vulnerability is a general rule type, the relevant content of the injection method that matches the target vulnerability is not repeated.
[0163] Furthermore, when the vulnerability type of the target vulnerability is a general rule type, the target vulnerability is dynamically intercepted or collected by configuring a rule configuration file to implement hot patch processing (including repair or observation at this time). At this time, the target hot patch package corresponding to the target vulnerability can be called a flexible logic hot patch package. In order to ensure the versatility, ease of use and flexibility of the flexible logic hot patch package, the flexible logic hot patch package does not contain specific business logic, but mainly contains a detection function check() function, which is used to detect all classes in the target process (specifically, each function contained in the class, and even the function parameters of the function) to determine some classes that need to be processed.
[0164] In this implementation, it is assumed that the target vulnerability is located in the class of the target process; Figure 8 As shown, after injecting the target hot patch package into the target process, the specific implementation process of using the target hot patch package to perform hot patch processing on the target vulnerability in the target process may include:
[0165] First, obtain the first rule configuration file through the target hot patch package. The first rule configuration file contains the class identifier of the target class corresponding to the target vulnerability, the blacklist parameter in the target class, and the hot patch mode; the blacklist parameter contains the vulnerability identifier of the target vulnerability. For the sake of convenience, take the target vulnerability as an example, where the target function has an incorrect function parameter in the class. At this time, the first rule configuration file contains the function identifier of the target function that needs to be hot patched, the blacklist parameter of the target function, and the hot patch mode. Among them, the blacklist parameter of the target function contains a regular expression of one or more parameters that need to be intercepted; Regular Expression (Regular Expression) is often abbreviated as regex, regexp or RE in the code, which uses a single string to describe or match a series of string search patterns that conform to a certain syntactic rule.
[0166] Then, based on the detection function, one or more function parameters in the target class (specifically the target function in the target class) are obtained, and one or more function parameters are compared with the blacklist parameters respectively to obtain the comparison result of each function parameter. It should be noted that in order to fully obtain each function parameter in the target function, it is supported to inject the detection function into the first line of the target function, so that when reading the target function, the detection function can be read first, so that all parameters of the target function can be obtained through the detection function. Among them, considering that the target hot patch package is injected when the target process is running, all classes (including member functions in the class) in the target process have been loaded, so the specific implementation process of injecting the detection function into the first line of the target function is similar to the specific implementation process of reloading the target vulnerability when the second fixed logic hot patch is injected when the target process is running as described above; specifically, it may include: based on the API interface of Instrumentation in java.lang.Instrument provided by the target process, a Transformer object instantiated by the ClassFileTransformer class is registered in the target process, and the Transformer contains a conversion method (such as a transform method). Then, based on the vulnerability identifier of the target vulnerability, the loaded member functions in the target process are traversed to obtain the target function containing the target vulnerability. Then, trigger the reloading of the target function containing the target vulnerability, specifically, use the class loader to reload the target function; and inject the detection function into the target function during the reloading process to achieve the injection of the detection function into the target function.
[0167] Finally, based on the comparison result of the hot patch mode and each function parameter, the target vulnerability in the target process is hot patched. The hot patch mode provided in the embodiment of the present application includes: bypass mode and interception mode; according to different hot patch modes, after the detection function obtains the comparison result of each function parameter, the process of hot patching the target vulnerability in the target process is different.
[0168] The following is an introduction to the specific implementation process of the detection function when the hot patch mode is bypass mode and interception mode, where: ① When the hot patch mode in the first rule configuration file is bypass mode, the detection function plays a role similar to information collection, which is used to output the comparison result of each function, specifically reporting the comparison result of each function parameter to the business personnel in the form of a log; such as the comparison result of function parameter 1 is that function parameter 1 meets the blacklist parameter (that is, the function parameter 1 is a parameter that needs to be intercepted), and the comparison result of function parameter 2 is that parameter parameter 2 does not meet the blacklist parameter (that is, the function parameter 2 is a parameter that does not need to be intercepted); in this way, the business personnel can intuitively understand whether each function parameter belongs to the blacklist parameter by querying the log. In other words, the embodiment of the present application provides vulnerability observation capabilities. When the flexible logic hot patch package matches the corresponding target vulnerability, the target vulnerability can be temporarily not intercepted, but the target vulnerability can be uploaded through the observation mode first, and further diagnosed by the business personnel. ② When the hot patch mode in the first rule configuration file is interception mode, the detection function can be used to directly intercept the operation of the target process on the target vulnerability, that is, the detection function can directly interrupt the subsequent business logic of the target function to achieve the effect of blocking risks.
[0169] Furthermore, the embodiment of the present application also supports the business personnel to dynamically adjust the hot patch mode in the rule configuration file to achieve flexible conversion between bypass mode and interception mode. For example, when the hot patch mode in the first rule configuration file is bypass mode, the detection function can report the comparison result of each function parameter to the business personnel; if the business personnel want to intercept the target vulnerability (such as the comparison result of the function parameter indicates that the function parameter meets the blacklist parameter) after consulting the comparison result of the function parameter in the form of a log, the business personnel can modify the configuration file to change the bypass mode to interception mode (the hot patch mode modification can take effect at the second level); specifically, the hot patch mode in the first rule configuration file is changed from bypass mode to interception mode to obtain an updated second rule configuration file. Then, after obtaining the second rule configuration file, the detection function can perform the steps of function parameter comparison described above, and after obtaining the comparison result of each function parameter, directly intercept the target process from running the target vulnerability to block the target vulnerability and ensure the security of the target business. It can be seen that by switching between the two hot patch modes, business personnel can first use the bypass mode to observe the business in real time, and then use the interception mode to intercept vulnerabilities, avoiding large-scale business failures caused by intercepting vulnerabilities at the beginning.
[0170] It is worth noting that if the rule configuration files obtained twice consecutively meet the matching conditions, then the embodiment of the present application also supports the detection function to intercept the target vulnerability directly based on the comparison result of each function parameter during the previous information collection (such as determining the comparison result of each function parameter according to the first rule configuration file), without the need to use the detection function to repeatedly perform steps such as function parameter comparison, thereby improving the vulnerability interception efficiency to a certain extent. Assuming that the rule configuration files obtained twice consecutively are the first rule configuration file and the second rule configuration file, respectively, at this time, the first rule configuration file and the second rule configuration file meet the matching conditions, which may include: the hot patch mode in the second rule configuration file is the interception mode, and the class identifier to be detected contained in the second rule configuration file includes the class identifier of the target class in the first rule configuration file, and one or more blacklist parameters contained in the second rule configuration file include the blacklist parameter in the first rule configuration file. That is to say, if the rule configuration file obtained for the second time contains: the target function to be processed in the rule configuration file obtained for the first time (i.e., the target vulnerability), and the rule configuration file obtained for the second time contains: the blacklist parameter in the rule configuration file obtained for the first time, it means that the business personnel want to intercept the target vulnerability detected by the first vulnerability patch during the second vulnerability patch, then the detection function can directly intercept the target process from running the target vulnerability.
[0171] In a specific implementation, after determining the comparison results of each function parameter based on the first rule configuration file, the comparison results of each function parameter can be stored; after reporting the comparison results of each function parameter, the second rule configuration file can be obtained based on the flexible logic hot patch package. The second rule configuration file is obtained by modifying the first rule configuration file by the business object (i.e., business personnel). If the second rule configuration file meets the matching conditions with the first rule configuration file, the detection function can be used to intercept the operation of the target process for the target vulnerability directly based on the comparison results of each stored function parameter, that is, directly intercept the operation of the function parameters that indicate risks in the comparison results of each function parameter, thereby ensuring the security of the target business.
[0172] It should also be noted that in order to save memory space, the embodiment of the present application also supports directly obtaining the comparison results of each function parameter stored in the memory space for vulnerability interception only when the time interval for obtaining two rule configuration files is less than a time threshold (such as 24 hours); conversely, when the time interval for obtaining the two rule configuration files is greater than or equal to the time threshold, it is necessary to re-perform the comparison of the function parameters based on the rule configuration file obtained for the second time.
[0173] To sum up, the vulnerability handling solution provided in the embodiment of the present application uses the hot patch service server, hot patch engine agent and hot patch package as the technical architecture, supports the setting of personalized hot patch processing logic for vulnerabilities of different vulnerability types in Java components, and can repair the target vulnerability through fixed logic or process the target vulnerability through dynamic interception, so that the vulnerabilities that can be patched by this solution can cover most vulnerability types, so that this solution can adapt to vulnerability patches in all services or businesses.
[0174] Above Figure 2 The embodiment shown mainly describes the specific process of the vulnerability processing method being executed by the server to be repaired separately. Fig. 9 Provides the process of the operation platform, hot patch server and the server to be repaired to jointly implement the vulnerability handling method. Fig. 9 , Fig. 9 This is a flowchart of another vulnerability processing method provided by an exemplary embodiment of the present application; the steps of the vulnerability processing method may include but are not limited to steps S901-S907:
[0175] S901: The operation platform generates a hot patch instruction according to the target vulnerability to be processed.
[0176] The operation platform refers to the terminal device held by the business personnel, in which an application or applet with vulnerability scanning function is deployed. In this way, when the business personnel have the need to perform vulnerability scanning on the server to be repaired, they can use the vulnerability scanning function deployed in the operation platform to perform remote vulnerability scanning on the server to be repaired, so that the operation platform can obtain the target vulnerability in the server to be repaired, specifically the target vulnerability to be processed in the target process in the server to be repaired. An exemplary schematic diagram of the operation platform performing remote vulnerability scanning on the server to be repaired can be seen in Fig.10 .
[0177] Further, if the business personnel refer to the target vulnerability through the operation platform and specifically have a hot patch processing requirement for the target vulnerability, then the operation platform can generate a hot patch instruction according to the target vulnerability to be processed, and the hot patch instruction is used to instruct the hot patch engine and the target hot patch package under the hot patch server to the server to be repaired. Among them, the specific process of the operation platform generating a hot patch instruction according to the target vulnerability to be processed may include: first, the operation platform determines the hot patch method that matches the target vulnerability according to the vulnerability type of the target vulnerability to be processed. Then, according to the hot patch method, the corresponding reference hot patch method is searched from the hot patch database. Then, when the vulnerability type of the target vulnerability is a short cycle type or there is no general rule type, the vulnerability identifier of the target vulnerability is added to the reference hot patch package to obtain the target hot patch package corresponding to the target vulnerability; of course, if the business personnel want to use a personalized file to replace the target vulnerability, then it is also supported to add the personalized file provided by the business personnel to the reference hot patch package to obtain the target hot patch package corresponding to the target vulnerability. Similarly, when the vulnerability type of the target vulnerability is a general rule type, the reference hot patch package is used as the target hot patch package corresponding to the target vulnerability. Finally, a hot patch instruction is generated based on the target hot patch package corresponding to the target vulnerability, the pre-set hot patch engine, and the service identifier of the server to be repaired. It can be seen that the hot patch instruction generated by the operation platform at least includes: the hot patch engine, the target hot patch package corresponding to the target vulnerability, and the server identifier of the server to be repaired, so that after receiving the hot patch instruction, the hot patch server can send the hot patch engine and the target hot patch package corresponding to the target vulnerability to the server to be repaired corresponding to the server identifier.
[0178] It should be noted that the embodiment of the present application can also add other information in the hot patch instruction according to the patch requirements of the business personnel. Optionally, if the business personnel want to send the same hot patch engine and target hot patch package to multiple servers to be repaired, so as to realize batch hot patch processing of vulnerabilities in multiple servers to be repaired, then the embodiment of the present application supports adding the service identification of each server to be repaired in the multiple servers to be repaired to the hot patch instruction, so as to realize the one-time batch sending of the hot patch engine and the target hot patch package to multiple servers to be repaired. Optionally, if the business personnel want some or all of the relevant information of the hot patch processing to be returned in the multiple servers to be repaired (such as the repair information about the target vulnerability (such as the repair time, duration, etc.) and the operation log of the target hot patch package, etc.), then the service identification of the part of the server to be repaired that needs to return information can also be marked in the hot patch instruction. The embodiment of the present application does not limit the way of marking the service identification in the hot patch instruction, such as adding the service identification of the part of the server to be repaired that needs to return information to the return function return() function in the hot patch instruction. Optionally, if the business personnel have the need to uninstall the hot patch engine and target hot patch package originally injected into the server to be repaired (such as the business personnel do not want to monitor the vulnerability of the server to be repaired anymore), then it is also supported to mark the part of the server to be repaired that needs to uninstall the hot patch engine and the target hot patch package in the hot patch instruction. Optionally, as can be seen from the aforementioned related description, when the vulnerability type of the target vulnerability is a general rule type, the target hot patch package dynamically intercepts or observes the target vulnerability through the rule configuration file. Therefore, if the business personnel have the need to adjust the rule configuration file (such as adjusting the hot patch mode, or adding or deleting the functions to be processed, or adding or deleting the blacklist parameters), the hot patch instruction also includes rewrite information (or configuration modification information) for the rule configuration file.
[0179] In summary, the hot patch instruction generated by the operation platform based on the target vulnerability includes: a hot patch engine, a target hot patch package corresponding to the target vulnerability, one or more service identifiers of servers to be repaired, service identifiers of some servers to be repaired that need to return relevant information about the hot patch processing, service identifiers of some servers to be repaired that need to uninstall the hot patch engine and the target hot patch package, or, when the vulnerability type is a general rule type, rewrite information for the rule configuration file. Of course, the above are only several exemplary information that may be included in the hot patch instruction. In actual applications, the hot patch instruction may also include other information according to the different business needs of business personnel; the embodiment of the present application does not limit the information contained in the hot patch instruction.
[0180] S902: The operation platform sends the hot patch instruction to the hot patch server.
[0181] S903: The hot patch server forwards the hot patch engine and the target hot patch package to the server to be repaired.
[0182] In steps S902-S903, after generating a hot patch instruction based on the target vulnerability, the operation platform may send the hot patch instruction to the hot patch server so that the hot patch server performs subsequent operations in response to the received hot patch instruction.
[0183] In a specific implementation, after receiving the hot patch instruction sent by the operation platform, the hot patch server can determine the service identifier of the server to be repaired that needs the vulnerability patch from the hot patch instruction; then, according to the service identifier, the hot patch engine and the target hot patch package carried by the hot patch instruction are sent to the server to be repaired corresponding to the service identifier. In other words, the hot patch instruction contains the target hot patch package and the hot patch engine; and the target hot patch package and the hot patch engine are forwarded by the hot patch server to the server to be repaired.
[0184] In addition, as described above, the hot patch server also pre-stores a rule configuration file; if the business personnel want to adjust the rule configuration file in this vulnerability patch, the hot patch instruction also contains rewrite information about the rule configuration file. At this time, the hot patch server also obtains the rewrite information from the hot patch instruction, and adjusts the rule configuration file according to the rewrite information to obtain an updated rule configuration file. It should be understood that the embodiment of the present application does not limit the specific content of the rewrite information; for example, the rewrite information may include: changing the hot patch mode in the rule configuration file from bypass mode to intercept mode; for another example, the rewrite information may include: adding a function identifier of a member function that needs to be patched in the rule configuration file, and a blacklist parameter of the function; and so on.
[0185] S904: After receiving the hot patch engine and the target hot patch package, the server to be repaired injects the target hot patch package into the target process through the hot patch engine.
[0186] S905: The server to be repaired performs hot patch processing on the target vulnerability in the target process through the target hot patch package.
[0187] In steps S904-S905, the server to be repaired injects the target hot patch package into the target process through the hot patch engine according to the different vulnerability types of the target vulnerability, and the specific implementation process of hot patching the target vulnerability in the target process through the target hot patch package is different.
[0188] like Fig.11As shown, when the vulnerability type of the target vulnerability is a short-cycle type, the hot patch engine associates the target hot patch package with the target process by adding a target command line to the target command before the target process is started; and when the target process is started by the new target command (i.e., the target command containing the target command line), the target hot patch package is loaded together. Then, the target hot patch package includes a first replacement function premain() function, which can intercept the class loader's loading of the target vulnerability when the class loader loads the target vulnerability, and replace the target vulnerability with a safe target file, so that the class loader avoids the risks of loading the target vulnerability by loading the safe target file. It should be noted that the above is only a brief introduction to the implementation process of injecting the target hot patch package into the target process through the hot patch engine when the vulnerability type of the target vulnerability is a short-cycle type, and hot patching the target vulnerability in the target process through the target hot patch package; for the detailed process of implementing the above operations on the server to be repaired, please refer to Figure 2 The relevant description of step S204 in the illustrated embodiment is not repeated here.
[0189] like Fig.12 As shown, when the vulnerability type of the target vulnerability is a type without common rules, the hot patch engine injects the target hot patch package into the target process by means of an injection tool (such as a binary jattach tool) when the target process is running, and once the target hot patch package is injected into the target process, the target hot patch package automatically runs. Then, the target hot patch package contains a second replacement function, agentmain(), which can be used to find the target vulnerability that needs to be repaired from the classes loaded in the target process, and then trigger the class loader to reload the target vulnerability, and replace the target vulnerability with a safe target file during reloading, so that the class loader can load the safe target file to avoid the risks caused by loading the target vulnerability. It should be noted that the above is only a brief introduction to the implementation process of injecting the target hot patch package into the target process through the hot patch engine when the vulnerability type of the target vulnerability is a type without common rules, and hot patching the target vulnerability in the target process through the target hot patch package; for the detailed process of implementing the above operations on the server to be repaired, please refer to Figure 2 The relevant description of step S204 in the illustrated embodiment is not repeated here.
[0190] like Fig.13As shown, when the vulnerability type of the target vulnerability is a general rule type, the hot patch engine injects the target hot patch package into the target process by means of an injection tool (such as a binary jattach tool) when the target process is running, and once the target hot patch package is injected into the target process, the target hot patch package automatically runs. Then, when the target hot patch package is running, the first rule configuration file can be pulled from the hot patch server through the target hot patch package; that is, the first rule configuration file is obtained from the hot patch server by the server to be repaired through the target hot patch package. Among them, the determination method of the first rule configuration file may include: pre-stored in the hot patch server by the business personnel through the operation platform; in this implementation method, in the process of this vulnerability patch, the hot patch instruction generated by the operation platform based on the target vulnerability does not need to include rewriting information about the rule configuration file, that is, the first rule configuration file used in this vulnerability patch has been pre-stored in the hot patch server. Alternatively, it is sent to the hot patch server by the operation platform through a hot patch instruction; in this implementation method, the hot patch instruction sent by the operation platform contains the first rule configuration file, and also contains the target hot patch package and the hot patch engine. Alternatively, the reference rule configuration file pre-stored in the hot patch server is modified according to the configuration modification information contained in the hot patch instruction (i.e., the rewrite information described above); in this implementation mode, the hot patch instruction issued by the operation platform contains configuration modification information for the pre-stored reference rule configuration file (such as the configuration modification information is to change the hot patch mode from bypass mode to interception mode), then the hot patch server needs to update the reference rule configuration file based on the configuration modification information to obtain the first rule configuration file. It can be seen that the embodiment of the present application supports business personnel to adjust the rule configuration file stored in the hot patch server in real time on demand. For example, as long as the corresponding function identifier and repair rule (such as hot patch mode) that need to be repaired are adjusted, the observation / interception of any function can be achieved, so that the present solution can adapt to the hot patch processing of all functions, not limited to a special vulnerability; and patching the vulnerability by intercepting the vulnerability has the characteristics of high emergency efficiency. For vulnerabilities with high timeliness such as 0day, the vulnerability can be patched quickly to avoid affecting the target business.
[0191] Furthermore, after obtaining the first rule configuration file, the target hot patch package can obtain the function identifier of the target function in the first rule configuration file, and the target function is the function containing the target vulnerability, so that the detection function check() function contained in the target hot patch package can be injected into the first line of the target function, so that the detection function can obtain the function parameters of the target function. Furthermore, the detection function compares the obtained function parameters of the target function with the blacklist parameters of the target function in the first rule configuration file to obtain the comparison result of each function parameter. Furthermore, when the hot patch mode in the first rule configuration file is the bypass mode, the target hot patch package can report the comparison results of each function parameter to the hot patch server, so that the hot patch server reports the comparison results of each function parameter to the operation platform, so that the business personnel can intuitively check whether each function parameter is a parameter that needs to be repaired through the operation platform; when the hot patch mode in the first rule configuration file is the interception mode, the detection function can block the subsequent business logic of the target function, thereby ensuring that the business logic of the target function is not executed, and ensuring the security of the target business. It should be noted that the above is only a brief introduction to the implementation process of injecting the target hot patch package into the target process through the hot patch engine, and hot patching the target vulnerability in the target process through the target hot patch package when the vulnerability type of the target vulnerability is a general rule type; the detailed process of implementing the above operations on the server to be repaired can be found in Figure 2 The relevant description of step S204 in the illustrated embodiment is not repeated here.
[0192] It should also be noted that the hot patch engine provided in the embodiment of the present application has the ability to perform core control. In addition to having the function of injecting the target hot patch package into the target process, it also has but is not limited to the following functions: ① According to the operating parameters of the server to be repaired, the target hot patch package is conditionally injected. Among them, the operating parameters of the server to be repaired may include but are not limited to: the amount of free memory, the number of process intervals and the CPU occupancy rate, etc., and the embodiment of the present application does not limit the operating parameters; in a specific implementation, the server to be repaired can obtain the operating parameters of the computer device (i.e., the server to be repaired) based on the hot patch engine; if the operating parameters meet the injection conditions, the hot patch engine is triggered to inject the target hot patch package into the target process according to the injection method matching the target vulnerability. Among them, depending on the different operating parameters, the injection conditions corresponding to the operating parameters are also different. For example, if the operating parameter is the CPU occupancy rate, then the operating parameter meets the injection condition, which may include: the CPU occupancy rate of the server to be repaired is less than the occupancy threshold, and at this time, it is determined that the CPU is still capable of processing other tasks except the target business, so that the relevant operations of the vulnerability patch are performed only when the target business is ensured to operate normally. On the contrary, if the CPU occupancy rate of the server to be repaired is greater than or equal to the occupancy threshold, it means that the CPU load is high. At this time, the injection process needs to be suspended and the injection process can be executed again after the CPU occupancy rate is less than the occupancy threshold to avoid affecting the normal operation of the target business.
[0193] ② Regularly scan all Java processes in the server to be repaired, and try to execute patches for processes that have not executed security patches. That is to say, after the server to be repaired receives the hot patch engine, the hot patch engine can regularly perform patch scans on the processes in the server to be repaired, and when it is found that there are processes that have not executed patches, try to inject the target hot patch package into the process, so as to achieve the purpose of intelligently and dynamically performing vulnerability patches on the server to be repaired, and improve the security of the server to be repaired. Among them, the embodiment of the present application does not limit the patch scanning period of the hot patch server, such as the patch scanning period can be 24 hours, 48 hours or 72 hours, etc.
[0194] ③ Injection intervals between processes. That is to say, when the hot patch engine injects the target hot patch package into the target process, it needs to follow a certain interval between the two injection processes, so as to ensure that multiple injection processes will not be executed in a short period of time, thereby ensuring the performance of the software and hardware of the server to be repaired, and ensuring the normal operation of the target business running in the server to be repaired.
[0195] ④ Reporting of relevant information on hot patch processing. That is to say, the hot patch engine also has the function of reporting relevant information on hot patch processing after the hot patch processing is completed, so that business personnel can understand the patch status of the target vulnerability in a timely and intuitive manner.
[0196] It should be understood that the functions of the hot patch engine provided in the embodiment of the present application are not limited to the functions provided above; the capabilities of the hot patch engine provided in the embodiment of the present application can provide security protection for the target business during the hot patch processing and ensure the normal operation of the target business.
[0197] S906: The server to be repaired transmits the hot patch processing related information back to the hot patch server.
[0198] S907: The hot patch server reports the hot patch processing related information to the operation platform.
[0199] In steps S906-S907, as described above, the hot patch engine provided in the embodiment of the present application has the function of reporting information. This allows the hot patch engine to transmit relevant information of the hot patch processing back to the hot patch server after the target hot patch package completes the hot patch processing of the target vulnerability in the target process. The hot patch server then reports it to the operation platform, which is beneficial for business personnel to timely grasp the patch status of the target vulnerability and improve human-computer interactivity.
[0200] In summary, after obtaining the target vulnerability to be repaired in the target process, the embodiment of the present application supports the vulnerability type based on the target vulnerability, and determines the hot patch method that matches the target vulnerability; for example, when the vulnerability type is a target vulnerability of a short-cycle type (i.e., the life cycle of the target process where the target vulnerability is located is short), the target vulnerability can be repaired by replacing the target vulnerability when the target process is started; for another example, when the vulnerability type is a target vulnerability with a higher risk, the target vulnerability can be repaired by intercepting the target vulnerability when the target process is running. After obtaining the target hot patch package corresponding to the target vulnerability based on the hot patch method that matches the target vulnerability, the target hot patch package is used to perform hot patch processing on the target vulnerability in the target process, which can not only ensure that the target vulnerability is accurately repaired, but also avoid other problems caused by the mismatch between the vulnerability type and the hot patch method. It can be seen from this that the embodiment of the present application prepares different hot patch methods for vulnerabilities of different vulnerability types, which can meet the patch requirements of different vulnerabilities, and is convenient for flexibly selecting matching hot patch methods for vulnerabilities of different vulnerability types, ensuring the efficiency of vulnerability patches.
[0201] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0202] Fig.14The schematic diagram of the structure of a vulnerability processing device provided by an exemplary embodiment of the present application is shown; the vulnerability processing device can be a computer program (including program code) running on a computer device, for example, the vulnerability processing device can be an application program of the computer device; the vulnerability processing device can be used to execute Figure 2 as well as Fig. 9 Some or all of the steps in the method embodiment shown. Fig.14 , the vulnerability processing device includes the following units:
[0203] An acquisition unit 1401 is used to acquire a target vulnerability to be processed in a target process;
[0204] The processing unit 1402 is used to determine a hot patch method matching the target vulnerability based on the vulnerability type of the target vulnerability;
[0205] The processing unit 1402 is further used to obtain a target hot patch package corresponding to the target vulnerability according to the hot patch method, and the target hot patch package is used to indicate: a processing logic when performing hot patch processing on the target vulnerability according to the hot patch method;
[0206] The processing unit 1402 is further configured to perform hot patch processing on a target vulnerability in a target process using a target hot patch package.
[0207] In one implementation, the vulnerability type includes any of the following: a short-cycle type, a no-general-rule type, and a general-rule type; wherein,
[0208] The vulnerability type of the target vulnerability is a short-cycle type, and the hot patch methods matching the target vulnerability include: replacing the target vulnerability with a target file when the target process is started;
[0209] The vulnerability type of the target vulnerability is a type without common rules. The hot patch methods matching the target vulnerability include: replacing the target vulnerability with a target file when the target process is running;
[0210] The vulnerability type of the target vulnerability is a common rule type, and the hot patch methods matching the target vulnerability include: intercepting the target vulnerability.
[0211] In one implementation, the processing unit 1402 is used to obtain the target hot patch package corresponding to the target vulnerability according to the hot patch method, specifically to:
[0212] Searching for a reference hot patch package corresponding to the hot patch method from a hot patch package database; wherein the hot patch package database contains hot patch packages pre-set for different hot patch methods, each hot patch package is used to indicate the processing logic when hot patching is performed on the target vulnerability according to the corresponding hot patch method;
[0213] Based on the vulnerability type of the target vulnerability and the reference hot patch package, a target hot patch package corresponding to the target vulnerability is generated.
[0214] In one implementation, when the vulnerability type of the target vulnerability includes a short-cycle type or a type without a general rule, the processing unit 1402 is configured to generate a target hot patch package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hot patch package, specifically to:
[0215] The vulnerability identifier of the target vulnerability is added to the reference hot patch package to generate a target hot patch package corresponding to the target vulnerability.
[0216] In one implementation, when the vulnerability type of the target vulnerability is a general rule type, the processing unit 1402 is configured to generate a target hotfix package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hotfix package, including:
[0217] The reference hotfix package is used as the target hotfix package corresponding to the target vulnerability.
[0218] In one implementation, the processing unit 1402 is further configured to:
[0219] Based on the vulnerability type of the target vulnerability, determine the injection method that matches the target vulnerability;
[0220] The hot patch engine is used to inject the target hot patch package into the target process according to the injection method that matches the target vulnerability.
[0221] In one implementation, the processing unit 1402 is further configured to:
[0222] Acquiring operating parameters of computer equipment based on a hot patch engine;
[0223] If the operating parameters meet the injection condition, the step of injecting the target hot patch package into the target process by using the hot patch engine according to the injection method matching the target vulnerability is triggered;
[0224] The operating parameters include at least one of the following: free memory, process interval number, and CPU occupancy rate.
[0225] In one implementation, the vulnerability type of the target vulnerability is a short-cycle type, and the injection method matching the target vulnerability includes: injecting before the target process is started; the processing unit 1402 is used to use the hot patch engine to inject the target hot patch package into the target process according to the injection method matching the target vulnerability, specifically for:
[0226] Before the target process is started, a target command corresponding to the target process is obtained based on the hot patch engine, where the target command is used to trigger the start of the target process;
[0227] Add the target command line to the target command to obtain a new target command. The target command line is used to trigger the loading of the target hot patch package.
[0228] When a new target command is run, the target process is started and the target hot patch package is loaded.
[0229] In one implementation, the target hot patch package includes a first replacement function, a vulnerability identifier of a target vulnerability, and a target file, where the target file is a file of a target vulnerability in a target process to be replaced; the target vulnerability is located in a class of the target process; and the processing unit 1402 is used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package, specifically for:
[0230] In the process of the class loader loading the class in the target process, calling the first replacement function according to the vulnerability identifier of the target vulnerability to intercept the class loader from loading the target vulnerability;
[0231] The target vulnerability is replaced with the target file, and the class loader is used to continue loading the target file.
[0232] In one implementation, the vulnerability type of the target vulnerability is a type without common rules or a type with common rules, and the injection method matching the target vulnerability refers to: injecting during the running process of the target process; the processing unit 1402 is used to use the hot patch engine to inject the target hot patch package into the target process according to the injection method matching the target vulnerability, specifically for:
[0233] During the operation of the target process, the injection tool is called through the hot patch engine, and the injection tool does not depend on the programming environment of the computer device;
[0234] Use the injection tool to inject the target hot patch package into the target process.
[0235] In one implementation, when the vulnerability type of the target vulnerability is a type without a general rule, the target hot patch package includes a second replacement function, a vulnerability identifier of the target vulnerability, and a target file, and the target file is a default file or a setting file; the target vulnerability is located in a class of a target process; and the processing unit 1402 is used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package, specifically for:
[0236] Based on the second replacement function and the vulnerability identifier of the target vulnerability, traverse the classes loaded in the target process to obtain a target class containing the target vulnerability;
[0237] Use the class loader to reload the target class, and intercept the class loader's loading of the target vulnerability during the reloading process;
[0238] The target vulnerability is replaced with the target file, and the class loader is used to continue loading the target file.
[0239] In one implementation, when the vulnerability type of the target vulnerability is a general rule type, the target hot patch package includes a detection function; the target vulnerability is located in the class of the target process; the processing unit 1402 is used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package, specifically for:
[0240] Obtaining a first rule configuration file through a target hot patch package, the first rule configuration file includes a class identifier of a target class corresponding to a target vulnerability, a blacklist parameter in the target class, and a hot patch mode; the blacklist parameter includes a vulnerability identifier of the target vulnerability;
[0241] Obtain one or more function parameters in the target class based on the detection function, and compare the one or more function parameters with the blacklist parameters respectively to obtain a comparison result of each function parameter;
[0242] Based on the comparison result of the hot patch mode and each function parameter, hot patch is performed on the target vulnerability in the target process.
[0243] In one implementation, the hot patch mode includes: a bypass mode and an intercept mode;
[0244] When the hot patch mode is the bypass mode, the processing unit 1402 is used to perform hot patch processing on the target vulnerability in the target process based on the comparison result between the hot patch mode and each function parameter, specifically to:
[0245] Output the comparison results of each function parameter;
[0246] Alternatively, when the hot patch mode is the interception mode, the processing unit 1402 is used to perform hot patch processing on the target vulnerability in the target process based on the comparison result of the hot patch mode and each function parameter, specifically to:
[0247] The detection function is used to intercept the target process from executing the target vulnerability.
[0248] In one implementation, the processing unit 1402 is further configured to:
[0249] Acquire a second rule configuration file based on the target hot patch package, where the second rule configuration file is obtained by modifying the first rule configuration file by the business object;
[0250] If the second rule configuration file meets the matching condition with the first rule configuration file, the detection function is used to intercept the operation of the target process on the target vulnerability;
[0251] Among them, the second rule configuration file and the first rule configuration file meet the matching conditions including: the hot patch mode in the second rule configuration file is the interception mode, and the class identifier to be detected contained in the second rule configuration file includes the class identifier of the target class in the first rule configuration file, and one or more blacklist parameters contained in the second rule configuration file include the blacklist parameter in the first rule configuration file.
[0252] In one implementation, the first rule configuration file is obtained by the server to be repaired from the hot patch server through the target hot patch package, and the target process runs on the server to be repaired; the first rule configuration file is determined by:
[0253] The operation platform stores the data in the hot patch server in advance;
[0254] The operation platform sends the hot patch instruction to the hot patch server; the hot patch instruction includes the first rule configuration file, the target hot patch package and the hot patch engine; the target hot patch package and the hot patch engine are forwarded by the hot patch server to the server to be repaired;
[0255] Or, it is obtained by modifying the reference rule configuration file pre-stored in the hot patch server according to the configuration modification information contained in the hot patch instruction.
[0256] According to one embodiment of the present application, Fig.14 The various units in the vulnerability processing device shown can be individually or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the vulnerability processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units. According to another embodiment of the present application, it can be executed by running on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM). Figure 2 as well as Fig. 9 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Fig.14 The vulnerability processing device shown in and the vulnerability processing method of the embodiment of the present application are implemented. The computer program can be recorded on, for example, a computer readable recording medium, and loaded into the above-mentioned computing device through the computer readable recording medium and run therein.
[0257] In the embodiment of the present application, after obtaining the target vulnerability to be repaired in the target process, support the vulnerability type based on the target vulnerability, and determine the hot patch method that matches the target vulnerability; for example, when the vulnerability type is a target vulnerability of a short-cycle type (i.e., the target process where the target vulnerability is located has a short life cycle), the target vulnerability can be repaired by replacing the target vulnerability when the target process is started; for another example, when the vulnerability type is a target vulnerability with a higher risk, the target vulnerability can be repaired by intercepting the target vulnerability when the target process is running. After obtaining the target hot patch package corresponding to the target vulnerability based on the hot patch method that matches the target vulnerability, the target hot patch package is used to perform hot patch processing on the target vulnerability in the target process, which can not only ensure that the target vulnerability is accurately repaired, but also avoid other problems caused by the mismatch between the vulnerability type and the hot patch method. It can be seen from this that the embodiment of the present application prepares different hot patch methods for vulnerabilities of different vulnerability types, which can meet the patch requirements of different vulnerabilities, and is convenient for flexibly selecting matching hot patch methods for vulnerabilities of different vulnerability types, ensuring the efficiency of vulnerability patches.
[0258] Fig.15 FIG. 1 shows a schematic diagram of a computer device provided by an exemplary embodiment of the present application. Fig.15 , the computer device includes a processor 1501, a communication interface 1502 and a computer-readable storage medium 1503. The processor 1501, the communication interface 1502 and the computer-readable storage medium 1503 can be connected via a bus or other means. The communication interface 1502 is used to receive and send data. The computer-readable storage medium 1503 can be stored in the memory of the computer device, the computer-readable storage medium 1503 is used to store a computer program, the computer program includes program instructions, and the processor 1501 is used to execute the program instructions stored in the computer-readable storage medium 1503. The processor 1501 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function.
[0259] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the processing system of the computer device. In addition, one or more instructions suitable for being loaded and executed by the processor 1501 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0260] In one embodiment, the computer device may be the operation platform, hot patch server or server to be repaired mentioned in the above embodiment; one or more instructions are stored in the computer-readable storage medium; the processor 1501 loads and executes the one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the above vulnerability handling method embodiment; in a specific implementation, the one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and the following steps are executed:
[0261] Get the target vulnerability to be processed in the target process;
[0262] Based on the vulnerability type of the target vulnerability, determine the hot patch method that matches the target vulnerability;
[0263] Obtaining a target hot patch package corresponding to a target vulnerability according to a hot patch method, where the target hot patch package is used to indicate: processing logic when hot patching is performed on the target vulnerability according to the hot patch method;
[0264] Use the target hot patch package to hot patch the target vulnerability in the target process.
[0265] In one implementation, the vulnerability type includes any of the following: a short-cycle type, a no-general-rule type, and a general-rule type; wherein,
[0266] The vulnerability type of the target vulnerability is a short-cycle type, and the hot patch methods matching the target vulnerability include: replacing the target vulnerability with a target file when the target process is started;
[0267] The vulnerability type of the target vulnerability is a type without common rules. The hot patch methods matching the target vulnerability include: replacing the target vulnerability with a target file when the target process is running;
[0268] The vulnerability type of the target vulnerability is a common rule type, and the hot patch methods matching the target vulnerability include: intercepting the target vulnerability.
[0269] In one implementation, one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when executing to obtain a target hot patch package corresponding to a target vulnerability according to the hot patch method, the following steps are specifically performed:
[0270] Searching for a reference hot patch package corresponding to the hot patch method from a hot patch package database; wherein the hot patch package database contains hot patch packages pre-set for different hot patch methods, each hot patch package is used to indicate the processing logic when hot patching is performed on the target vulnerability according to the corresponding hot patch method;
[0271] Based on the vulnerability type of the target vulnerability and the reference hot patch package, a target hot patch package corresponding to the target vulnerability is generated.
[0272] In one implementation, when the vulnerability type of the target vulnerability includes a short-cycle type or a type without a general rule, one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and are executed based on the vulnerability type of the target vulnerability and the reference hot patch package to generate a target hot patch package corresponding to the target vulnerability. Specifically, the following steps are performed:
[0273] The vulnerability identifier of the target vulnerability is added to the reference hot patch package to generate a target hot patch package corresponding to the target vulnerability.
[0274] In one implementation, when the vulnerability type of the target vulnerability is a general rule type, one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and executed based on the vulnerability type of the target vulnerability and the reference hotfix package to generate a target hotfix package corresponding to the target vulnerability, specifically performing the following steps:
[0275] The reference hotfix package is used as the target hotfix package corresponding to the target vulnerability.
[0276] In one implementation, one or more instructions in the computer readable storage medium are loaded by the processor 1501 and further perform the following steps:
[0277] Based on the vulnerability type of the target vulnerability, determine the injection method that matches the target vulnerability;
[0278] The hot patch engine is used to inject the target hot patch package into the target process according to the injection method that matches the target vulnerability.
[0279] In one implementation, one or more instructions in the computer readable storage medium are loaded by the processor 1501 and further perform the following steps:
[0280] Acquiring operating parameters of computer equipment based on a hot patch engine;
[0281] If the operating parameters meet the injection condition, the step of injecting the target hot patch package into the target process by using the hot patch engine according to the injection method matching the target vulnerability is triggered;
[0282] The operating parameters include at least one of the following: free memory, process interval number, and CPU occupancy rate.
[0283] In one implementation, the vulnerability type of the target vulnerability is a short-cycle type, and the injection method matching the target vulnerability includes: injecting before the target process is started; one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when the hot patch engine is used to inject the target hot patch package into the target process according to the injection method matching the target vulnerability, the following steps are specifically performed:
[0284] Before the target process is started, a target command corresponding to the target process is obtained based on the hot patch engine, where the target command is used to trigger the start of the target process;
[0285] Add the target command line to the target command to obtain a new target command. The target command line is used to trigger the loading of the target hot patch package.
[0286] When a new target command is run, the target process is started and the target hot patch package is loaded.
[0287] In one implementation, the target hot patch package includes a first replacement function, a vulnerability identifier of a target vulnerability, and a target file, where the target file is a file of a target vulnerability in a target process to be replaced; the target vulnerability is located in a class of the target process; one or more instructions in a computer-readable storage medium are loaded by the processor 1501 and when executing the hot patch processing of the target vulnerability in the target process using the target hot patch package, the following steps are specifically performed:
[0288] In the process of the class loader loading the class in the target process, calling the first replacement function according to the vulnerability identifier of the target vulnerability to intercept the class loader from loading the target vulnerability;
[0289] The target vulnerability is replaced with the target file, and the class loader is used to continue loading the target file.
[0290] In one implementation, the vulnerability type of the target vulnerability is a type without common rules or a type with common rules, and the injection method matching the target vulnerability refers to: injecting during the running process of the target process; one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when the hot patch engine is used to inject the target hot patch package into the target process according to the injection method matching the target vulnerability, the following steps are specifically performed:
[0291] During the operation of the target process, the injection tool is called through the hot patch engine, and the injection tool does not depend on the programming environment of the computer device;
[0292] Use the injection tool to inject the target hot patch package into the target process.
[0293] In one implementation, when the vulnerability type of the target vulnerability is a type without a general rule, the target hot patch package includes a second replacement function, a vulnerability identifier of the target vulnerability, and a target file, and the target file is a default file or a setting file; the target vulnerability is located in the class of the target process; one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when executing the hot patch processing of the target vulnerability in the target process using the target hot patch package, the following steps are specifically performed:
[0294] Based on the second replacement function and the vulnerability identifier of the target vulnerability, traverse the classes loaded in the target process to obtain a target class containing the target vulnerability;
[0295] Use the class loader to reload the target class, and intercept the class loader's loading of the target vulnerability during the reloading process;
[0296] The target vulnerability is replaced with the target file, and the class loader is used to continue loading the target file.
[0297] In one implementation, when the vulnerability type of the target vulnerability is a general rule type, the target hot patch package includes a detection function; the target vulnerability is located in the class of the target process; one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when the target hot patch package is used to perform hot patch processing on the target vulnerability in the target process, the following steps are specifically performed:
[0298] Obtaining a first rule configuration file through a target hot patch package, the first rule configuration file includes a class identifier of a target class corresponding to a target vulnerability, a blacklist parameter in the target class, and a hot patch mode; the blacklist parameter includes a vulnerability identifier of the target vulnerability;
[0299] Obtain one or more function parameters in the target class based on the detection function, and compare the one or more function parameters with the blacklist parameters respectively to obtain a comparison result of each function parameter;
[0300] Based on the comparison result of the hot patch mode and each function parameter, hot patch is performed on the target vulnerability in the target process.
[0301] In one implementation, the hot patch mode includes: a bypass mode and an intercept mode;
[0302] When the hot patch mode is the bypass mode, one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when hot patching is performed on the target vulnerability in the target process based on the comparison result of the hot patch mode and each function parameter, the following steps are specifically performed:
[0303] Output the comparison results of each function parameter;
[0304] Alternatively, when the hot patch mode is the interception mode, one or more instructions in the computer-readable storage medium are loaded by the processor 1501 and when hot patching the target vulnerability in the target process based on the comparison result of the hot patch mode and each function parameter is executed, the following steps are specifically performed:
[0305] The detection function is used to intercept the target process from executing the target vulnerability.
[0306] In one implementation, one or more instructions in the computer readable storage medium are loaded by the processor 1501 and further perform the following steps:
[0307] Acquire a second rule configuration file based on the target hot patch package, where the second rule configuration file is obtained by modifying the first rule configuration file by the business object;
[0308] If the second rule configuration file meets the matching condition with the first rule configuration file, the detection function is used to intercept the operation of the target process on the target vulnerability;
[0309] Among them, the second rule configuration file and the first rule configuration file meet the matching conditions including: the hot patch mode in the second rule configuration file is the interception mode, and the class identifier to be detected contained in the second rule configuration file includes the class identifier of the target class in the first rule configuration file, and one or more blacklist parameters contained in the second rule configuration file include the blacklist parameter in the first rule configuration file.
[0310] In one implementation, the first rule configuration file is obtained by the server to be repaired from the hot patch server through the target hot patch package, and the target process runs on the server to be repaired; the first rule configuration file is determined by:
[0311] The operation platform stores the data in the hot patch server in advance;
[0312] The operation platform sends the hot patch instruction to the hot patch server; the hot patch instruction includes the first rule configuration file, the target hot patch package and the hot patch engine; the target hot patch package and the hot patch engine are forwarded by the hot patch server to the server to be repaired;
[0313] Or, it is obtained by modifying the reference rule configuration file pre-stored in the hot patch server according to the configuration modification information contained in the hot patch instruction.
[0314] Based on the same inventive concept, the principle and beneficial effects of solving the problem by the computer device provided in the embodiment of the present application are similar to the principle and beneficial effects of solving the problem by the vulnerability handling method in the method embodiment of the present application. Please refer to the principle and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.
[0315] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the blockchain node device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned vulnerability processing method.
[0316] A person skilled in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0317] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium or transmitted by a computer-readable storage medium. The computer instruction can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (for example, coaxial cable, optical fiber, digital line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data processing device such as a server, a data center, etc. that contains one or more available media integration. Available media can be magnetic media (for example, floppy disk, hard disk, tape), optical media (for example, DVD), or semiconductor media (for example, solid-state drive (Solid State Disk, SSD)) and the like.
[0318] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technical object familiar with the technical field within the technical scope disclosed in the present application can be easily thought of for changes or replacements, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A vulnerability handling method, It is characterized in that include: Get the target vulnerability to be processed in the target process; Based on the vulnerability type of the target vulnerability, determining a hot patch method that matches the target vulnerability; Acquire a target hot patch package corresponding to the target vulnerability according to the hot patch method, wherein the target hot patch package is used to indicate: a processing logic when hot patch processing is performed on the target vulnerability according to the hot patch method; The target hot patch package is used to perform hot patch processing on the target vulnerability in the target process.
2. The method according to claim 1, It is characterized in that The vulnerability type includes any of the following: short-cycle type, no general rule type and general rule type; wherein, The vulnerability type of the target vulnerability is the short-cycle type, and the hot patch method matching the target vulnerability includes: replacing the target vulnerability with a target file when the target process is started; The vulnerability type of the target vulnerability is the type without common rules, and the hot patch method matching the target vulnerability includes: replacing the target vulnerability with a target file when the target process is running; The vulnerability type of the target vulnerability is the general rule type, and the hot patch method matching the target vulnerability includes: intercepting the target vulnerability.
3. The method according to claim 1, It is characterized in that The step of obtaining a target hot patch package corresponding to the target vulnerability according to the hot patch method includes: Searching for a reference hot patch package corresponding to the hot patch method from a hot patch package database; wherein the hot patch package database contains hot patch packages pre-set for different hot patch methods, each hot patch package is used to indicate the processing logic when hot patching is performed on the target vulnerability according to the corresponding hot patch method; Based on the vulnerability type of the target vulnerability and the reference hotfix package, a target hotfix package corresponding to the target vulnerability is generated.
4. The method according to claim 3, It is characterized in that When the vulnerability type of the target vulnerability includes a short-cycle type or a type without a general rule, generating a target hot patch package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hot patch package includes: The vulnerability identifier of the target vulnerability is added to the reference hotfix package to generate a target hotfix package corresponding to the target vulnerability.
5. The method according to claim 3, It is characterized in that When the vulnerability type of the target vulnerability is a general rule type, generating a target hotfix package corresponding to the target vulnerability based on the vulnerability type of the target vulnerability and the reference hotfix package includes: The reference hotfix package is used as the target hotfix package corresponding to the target vulnerability.
6. The method according to claim 1, It is characterized in that Before using the target hot patch package to perform hot patch processing on the target vulnerability in the target process, the method further includes: Based on the vulnerability type of the target vulnerability, determining an injection method that matches the target vulnerability; A hot patch engine is used to inject the target hot patch package into the target process according to an injection method that matches the target vulnerability.
7. The method according to claim 6, It is characterized in that Before the target hot patch package is injected into the target process by using the hot patch engine in an injection mode matching the target vulnerability, the method further includes: Acquiring operating parameters of a computer device based on the hot patch engine; If the operating parameters meet the injection condition, the step of injecting the target hot patch package into the target process by using the hot patch engine in an injection manner matching the target vulnerability is triggered; The operating parameters include at least one of the following: amount of free memory, number of process intervals and CPU occupancy rate.
8. The method according to claim 6, It is characterized in that The vulnerability type of the target vulnerability is a short-cycle type, and the injection method matching the target vulnerability includes: injecting before the target process is started; the use of the hot patch engine to inject the target hot patch package into the target process according to the injection method matching the target vulnerability includes: Before the target process is started, obtaining a target command corresponding to the target process based on the hot patch engine, wherein the target command is used to trigger the start of the target process; Adding a target command line to the target command to obtain a new target command, wherein the target command line is used to trigger loading of the target hot patch package; When the new target command is run, the target process is started and the target hot patch package is loaded.
9. The method according to claim 8, It is characterized in that The target hotfix package includes a first replacement function, a vulnerability identifier of the target vulnerability, and a target file, where the target file is a file to be used to replace the target vulnerability in the target process; The target vulnerability is located in a class of the target process; The using the target hot patch package to perform hot patch processing on the target vulnerability in the target process includes: In the process of the class loader loading the class in the target process, calling the first replacement function to intercept the class loader loading the target vulnerability according to the vulnerability identifier of the target vulnerability; The target vulnerability is replaced by the target file, and the class loader is used to continue loading the target file.
10. The method according to claim 6, It is characterized in that The vulnerability type of the target vulnerability is a type without common rules or a type with common rules, and the injection method matching the target vulnerability is: injecting during the running process of the target process; and the using the hot patch engine to inject the target hot patch package into the target process according to the injection method matching the target vulnerability includes: During the operation of the target process, an injection tool is called by the hot patch engine, and the injection tool does not depend on the programming environment of the computer device; The target hotfix package is injected into the target process using the injection tool.
11. The method according to claim 10, It is characterized in that When the vulnerability type of the target vulnerability is the type without common rules, the target hotfix package includes a second replacement function, a vulnerability identifier of the target vulnerability and a target file, and the target file is a default file or a setting file; The target vulnerability is located in a class of the target process; The using the target hot patch package to perform hot patch processing on the target vulnerability in the target process includes: Based on the second replacement function and the vulnerability identifier of the target vulnerability, traverse the classes loaded in the target process to obtain a target class containing the target vulnerability; Reloading the target class using a class loader, and intercepting the class loader's loading of the target vulnerability during the reloading process; The target vulnerability is replaced by the target file, and the class loader is used to continue loading the target file.
12. The method according to claim 10, It is characterized in that When the vulnerability type of the target vulnerability is the general rule type, the target hotfix package includes a detection function; the target vulnerability is located in the class of the target process; The using the target hot patch package to perform hot patch processing on the target vulnerability in the target process includes: Obtaining a first rule configuration file through the target hot patch package, wherein the first rule configuration file includes a class identifier of a target class corresponding to the target vulnerability, a blacklist parameter in the target class, and a hot patch mode; the blacklist parameter includes a vulnerability identifier of the target vulnerability; Acquire one or more function parameters in the target class based on the detection function, and compare the one or more function parameters with the blacklist parameters respectively to obtain a comparison result of each function parameter; Based on the comparison result between the hot patch mode and each function parameter, hot patch processing is performed on the target vulnerability in the target process.
13. The method according to claim 12, It is characterized in that The hot patch mode includes: bypass mode and intercept mode; When the hot patch mode is the bypass mode, performing hot patch processing on the target vulnerability in the target process based on the comparison result between the hot patch mode and each function parameter includes: Output the comparison result of each function parameter; Alternatively, when the hot patch mode is the interception mode, performing hot patch processing on the target vulnerability in the target process based on the comparison result between the hot patch mode and each function parameter includes: The detection function is used to intercept the target process from executing the target vulnerability.
14. The method according to claim 13, It is characterized in that After outputting the comparison result of each function parameter, the method further includes: Acquire a second rule configuration file based on the target hotfix package, where the second rule configuration file is obtained by modifying the first rule configuration file by the business object; If the second rule configuration file meets the first rule configuration file matching condition, the detection function is used to intercept the target process from running the target vulnerability; Among them, the second rule configuration file and the first rule configuration file meet the matching conditions including: the hot patch mode in the second rule configuration file is the interception mode, and the class identifier to be detected contained in the second rule configuration file includes the class identifier of the target class in the first rule configuration file, and the one or more blacklist parameters contained in the second rule configuration file include the blacklist parameter in the first rule configuration file.
15. The method of claim 14, It is characterized in that The first rule configuration file is obtained by the server to be repaired from the hot patch server through the target hot patch package, and the target process runs on the server to be repaired; The method for determining the first rule configuration file includes: The operation platform is pre-stored in the hot patch server; The operation platform sends the hot patch instruction to the hot patch server; the hot patch instruction includes the first rule configuration file, the target hot patch package and the hot patch engine; the target hot patch package and the hot patch engine are forwarded by the hot patch server to the server to be repaired; Or, it is obtained by modifying the reference rule configuration file pre-stored in the hot patch server according to the configuration modification information contained in the hot patch instruction.
16. A vulnerability processing device, It is characterized in that include: An acquisition unit, used to acquire a target vulnerability to be processed in a target process; A processing unit, configured to determine a hot patch method matching the target vulnerability based on the vulnerability type of the target vulnerability; The processing unit is further used to obtain a target hot patch package corresponding to the target vulnerability according to the hot patch method, and the target hot patch package is used to indicate: a processing logic when hot patch processing is performed on the target vulnerability according to the hot patch method; The processing unit is further used to perform hot patch processing on the target vulnerability in the target process using the target hot patch package.
17. A computer device, It is characterized in that include: a processor adapted to execute a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the vulnerability processing method according to any one of claims 1 to 15 is implemented.
18. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer application, and when the computer application is executed, the vulnerability processing method according to any one of claims 1 to 15 is implemented.
19. A computer program product, It is characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed by a processor, the vulnerability method according to any one of claims 1 to 15 is implemented.
