Command processing method and device, electronic equipment, storage medium and program product
By analyzing and evaluating the threat level of the operation and maintenance platform, identifying and defending against potential threat tasks, the problem of improving operation and maintenance security is solved, and the security and defense accuracy of the operation and maintenance platform are improved.
Patent Information
- Application Number
- CN202310576396.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2024-11-22
AI Technical Summary
The existing technology lacks effective solutions for operation and maintenance security, especially when the operation and maintenance platform faces threats, it is difficult to effectively improve operation and maintenance security.
Provide a command processing method, which analyzes the set of commands to be executed by the operation and maintenance platform, performs code text filtering, splitting, threat level evaluation and defense processing, identifies and defends against potential threat tasks, and achieves the security improvement of the operation and maintenance platform.
It improves the accuracy of the identification of command code data, accurately identify operation and maintenance security risks, realizes defense processing for different threat levels, and improves the security and defense accuracy of the operation and maintenance platform.
Smart Images

Figure CN119004448A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to technical fields such as cloud technology and cloud security, and the present application relates to a command processing method, device, electronic device, storage medium and program product. Background Art
[0002] Operation and maintenance security refers to protecting the security of systems, software and network environments to ensure the reliability, integrity and security of computer systems, network environments and data. Operation and maintenance security is the cornerstone of enterprise security. Especially in Internet companies, unlike WEB security, mobile security or business security, operation and maintenance security is at the bottom layer, involving servers, network equipment, basic applications, etc. Once there is a problem with operation and maintenance security, it will directly threaten the security of the server.
[0003] However, the system security defense technology in this field is mainly aimed at external intrusions, such as hacker intrusions; there is a lack of technology aimed at operation and maintenance security. Therefore, how to effectively improve the operation and maintenance security of the operation and maintenance platform is still a problem that needs to be solved urgently in this field. Summary of the invention
[0004] The present application provides a command processing method, device, electronic device, storage medium and program product. The technical solution is as follows:
[0005] In one aspect, a command processing method is provided, the method comprising:
[0006] In response to a command analysis request of the operation and maintenance platform, acquiring execution data corresponding to a set of commands to be executed of the operation and maintenance platform, wherein the execution data includes a first code text of the set of commands to be executed and an execution element of the set of commands to be executed;
[0007] Filtering the first code text according to at least one preconfigured filtering rule to obtain a second code text;
[0008] Splitting the second code text according to a preconfigured command division rule to obtain at least one command included in the set of commands to be executed;
[0009] Based on a pre-configured threat command set corresponding to at least one threat level, performing a threat level assessment on at least one command in the set of commands to be executed, and obtaining a target level corresponding to the set of commands to be executed;
[0010] Based on the target level and execution element corresponding to the set of commands to be executed, a threat level assessment is performed on the target task corresponding to the set of commands to be executed to obtain the threat level corresponding to the target task;
[0011] The set of commands to be executed is defensively processed according to a target defense operation that matches the threat level of the target task.
[0012] In another aspect, a command processing device is provided, the device comprising:
[0013] An acquisition module, configured to, in response to a command analysis request of an operation and maintenance platform, acquire execution data corresponding to a set of commands to be executed of the operation and maintenance platform, wherein the execution data includes a first code text of the set of commands to be executed and an execution element of the set of commands to be executed;
[0014] A filtering module, configured to filter the first code text according to at least one preconfigured filtering rule to obtain a second code text;
[0015] A splitting module, used for splitting the second code text according to a preconfigured command division rule to obtain at least one command included in the set of commands to be executed;
[0016] A command level assessment module, configured to perform a threat level assessment on at least one command in the set of commands to be executed based on a threat command set corresponding to at least one pre-configured threat level, and obtain a target level corresponding to the set of commands to be executed;
[0017] A task level assessment module, configured to perform a threat level assessment on a target task corresponding to the set of commands to be executed based on a target level and an execution element corresponding to the set of commands to be executed, so as to obtain a threat level corresponding to the target task;
[0018] The defense processing module is used to perform defense processing on the set of commands to be executed according to a target defense operation that matches the threat level of the target task.
[0019] In a possible implementation, the command level assessment module is used to:
[0020] Using the hit conditions corresponding to each threat command in each threat level, obtaining the hit results of the code data corresponding to each command in the threat command set corresponding to each threat level, the hit result of each command indicating whether the command hits the threat command in each threat command set;
[0021] Based on the hit result of each command in the set of commands to be executed, a target level corresponding to the set of commands to be executed is determined.
[0022] In a possible implementation, the hit condition corresponding to each threat command includes key code data of each threat command;
[0023] The command level assessment module is used to:
[0024] Matching the key code data corresponding to each threat command with the code data of each command to obtain a matching relationship between each command and each threat command;
[0025] Based on the matching relationship between each command and each threat command, a hit result between each command and each threat command is obtained.
[0026] In a possible implementation, the command level assessment module is used for at least one of the following:
[0027] If the critical code data includes a write-operation sensitive path, in response to detecting that the code data of any one of the commands includes an operation path matching the write-operation sensitive path, determining that the any one of the commands matches a write-operation threat command corresponding to the write-operation sensitive path;
[0028] If the critical code data includes a read operation sensitive path, in response to detecting that the code data of any one of the commands includes an operation path matching the read operation sensitive path, determining that the any one of the commands matches a read operation threat command corresponding to the read operation sensitive path;
[0029] If the key code data includes blacklist command definition data, in response to detecting that the code data of any one of the commands includes the blacklist command definition data, determining that the any one of the commands matches a blacklist command corresponding to the blacklist command definition data;
[0030] If the critical code data includes a potential threat parameter, in response to detecting that the code data of any command includes the potential threat parameter, determining that the any command matches a preconfigured high-risk command including the potential threat parameter;
[0031] If the key code data includes preset download path data corresponding to the download class command, in response to detecting that the code data of any command includes the preset download path data, it is determined that the any command matches the target download class command corresponding to the preset download path data.
[0032] In a possible implementation, the command level assessment module is used to:
[0033] For each command, if the hit result of each command indicates that each command hits any threat command set, determine the threat level of each command as the threat level corresponding to the hit threat command set;
[0034] Based on the threat level of each command, counting the number of commands corresponding to each threat level of the set of commands to be executed;
[0035] Based on the number of commands corresponding to the to-be-executed command set at each threat level, a target level corresponding to the to-be-executed command set is determined.
[0036] In a possible implementation, the filtering module is used for at least one of the following:
[0037] Matching the whitelist command set and the first code text, filtering out at least one whitelist command data belonging to the whitelist command in the first code text based on the matching result, to obtain the second code text;
[0038] Matching a target symbol set with the first code text, filtering symbol data matching any target symbol in the code text based on the matching result to obtain the second code text, wherein the target symbol set includes at least one target symbol;
[0039] At least one pseudocode data in the code text is identified based on the pseudocode identification condition, and based on the generation method corresponding to the at least one pseudocode data, the at least one pseudocode data is restored to the corresponding at least one source code data to obtain the second code text.
[0040] In a possible implementation, the task level assessment module is used to:
[0041] Based on the status data of the execution element, a threat level assessment is performed on the execution element of the target task to obtain an element threat level of the execution element;
[0042] Based on the target level and the element threat level, the threat level of the target task is comprehensively evaluated to obtain the threat level of the target task.
[0043] In a possible implementation, the task level assessment module is used for at least one of the following:
[0044] The execution element includes a trigger object that triggers the target task, and if the target level is in the first level interval and the element threat level corresponding to the on-the-job status of the trigger object is in the first level interval, determining the threat level of the target task to be the target level;
[0045] The execution element includes an executed device corresponding to the target task, and if the target level is in the first level interval and the element threat level corresponding to the execution host data of the executed device is in the first level interval, determining the threat level of the target task to be the target level;
[0046] The execution element includes the execution frequency of the target task within the target time period. If the target level is in the first level interval and the element threat level corresponding to the execution frequency is in the first level interval, the threat level of the target task is determined to be the target level;
[0047] The execution element includes the electronic device where the operation and maintenance platform is located. If the target level is in the first level interval and the element threat level corresponding to the electronic device where the operation and maintenance platform is located is in the first level interval, the threat level of the target task is determined to be the target level.
[0048] In a possible implementation, the defense processing module is used to:
[0049] Based on the threat level of the target task, determining a target defense operation corresponding to the target task from at least one correspondence between the threat level and the defense processing operation; the higher the threat level, the higher the defense level corresponding to the defense processing operation;
[0050] Based on the target defense operation corresponding to the target task, a defense instruction is sent to the operation and maintenance platform, wherein the defense instruction instructs to perform defense processing on the to-be-executed set according to the target defense operation.
[0051] On the other hand, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the above-mentioned command processing method.
[0052] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the command processing method described above is implemented.
[0053] On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program implements the above command processing method when executed by a processor.
[0054] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0055] The command processing method provided in the present application obtains the first code text and execution element corresponding to the set of commands to be executed of the operation and maintenance platform, and filters and splits the first code text to obtain at least one command included in the set of commands to be executed. Then, based on the threat command set corresponding to at least one threat level, the threat level of each command is evaluated to obtain the target level corresponding to the set of commands to be executed; the accuracy of command code data recognition is improved. In addition, the threat level of the target task corresponding to the set of commands to be executed is comprehensively evaluated in combination with the target level and execution element corresponding to the set of commands to be executed; the execution tasks with operation and maintenance security risks can be accurately identified. Therefore, the set of commands to be executed is defensively processed based on the threat level of the target task; hierarchical processing of commands for the operation and maintenance platform according to different threat levels can be achieved, and tasks with high threat levels can be effectively defended, the accuracy of command processing is improved, and the accuracy of defense of tasks of different levels is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in describing the embodiments of the present application.
[0057] Figure 1 A schematic diagram of an implementation environment for implementing a command processing method provided in an embodiment of the present application;
[0058] Figure 2 A flowchart of a command processing method provided in an embodiment of the present application;
[0059] Figure 3 A flowchart of a command processing method provided in an embodiment of the present application;
[0060] Figure 4 A flowchart of a command processing method provided in an embodiment of the present application;
[0061] Figure 5 A schematic diagram of the system architecture of a command processing method provided in an embodiment of the present application;
[0062] Figure 6 A schematic diagram of a system access and command preprocessing process provided in an embodiment of the present application;
[0063] Figure 7 A schematic diagram of a command detection process provided in an embodiment of the present application;
[0064] Figure 8 A schematic diagram of a threat detection and threat processing process provided in an embodiment of the present application;
[0065] Fig. 9 A schematic diagram of the structure of a command processing device provided in an embodiment of the present application;
[0066] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0068] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said", and "the" used herein may also include plural forms. The terms "include" and "comprise" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, and operations, but do not exclude the implementation as other features, information, data, steps, operations, etc. supported by the technical field.
[0069] It is understandable that in the specific implementation of the present application, when the above embodiments of the present application are applied to specific products or technologies, such as the set of pending commands triggered by the object, the status data of the object, the employment or resignation status, or any other data related to the object, it is necessary to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0070] Figure 1 A schematic diagram of an implementation environment of a command processing method provided by this application. Figure 1 As shown, the implementation environment includes: a server 101 and an operation and maintenance platform device 102, and data interaction can be performed between the server 101 and the operation and maintenance platform device 102 based on the application.
[0071] The operation and maintenance platform device 102 may be an electronic device installed with any application having an operation and maintenance function, such as an operation and maintenance platform, an operation and maintenance tool, or an operation and maintenance application. The operation and maintenance platform device 102 may be a server or a terminal device. The operation and maintenance function may be a function of performing system management and operation and maintenance on a system of multiple electronic devices.
[0072] In a possible scenario, when a set of commands to be executed is triggered in the operation and maintenance platform of the operation and maintenance platform device 102, before the operation and maintenance platform device 102 executes, the operation and maintenance platform device 102 may send a processing request to the server 101. The server 101 receives the processing request and determines the threat level of the set of commands to be executed. It may also comprehensively evaluate the threat level of the execution task corresponding to the set of commands by combining the execution elements of the set of commands to be executed and the determination result of the threat level of the set of commands to be executed; the server 101 may perform defense processing on the set of commands to be executed according to the evaluated task threat level. For example, the server 101 may send a defense instruction to the operation and maintenance platform device 102 according to the defense operation matching the task threat level. The operation and maintenance platform device 102 may perform hierarchical defense processing on the set of commands to be executed according to the defense instruction. For example, the server 101 may adopt the command processing flow provided in the embodiment of the present application to implement hierarchical defense processing on the set of commands to be executed.
[0073] It should be noted that the server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, digital broadcast receiver, desktop computer, vehicle-mounted terminal (such as vehicle-mounted navigation terminal, vehicle-mounted computer, etc.), smart speaker, smart watch, etc. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and can also be determined based on the actual application scenario requirements, which is not limited here.
[0074] Figure 2 The flowchart of a command processing method provided in an embodiment of the present application is shown in FIG. The execution subject of the method may be an electronic device. Figure 2 As shown, the method includes the following steps.
[0075] Step 201: The electronic device obtains execution data corresponding to a set of to-be-executed commands of the operation and maintenance platform in response to a command analysis request of the operation and maintenance platform.
[0076] The execution data includes the first code text of the set of commands to be executed and the execution element of the set of commands to be executed. The set of commands to be executed is a set of commands to be executed triggered on the operation and maintenance platform. The set of commands to be executed may be a shell command.
[0077] It should be noted that Shell is a command line interpreter for controlling and managing operating systems. Shell commands support controlling the operation of a computer by inputting a series of text commands; for example, shell commands can be used to implement at least one of the following tasks: starting an application, performing system management tasks, viewing and modifying files, checking system status, and executing scripts, etc. Among them, the first code text can be a text file encapsulating code data of Shell commands; for example, Shell script, Shell script is a scripting language, which is a combination of a group of Shell commands, used to automatically execute a series of tasks.
[0078] The present application can perform threat analysis on the set of pending commands in the operation and maintenance platform to identify threat tasks that may affect the system and assess their possible risks, so as to achieve the purpose of improving the security of the system and ensuring the availability of the system; and further preventive measures can be taken based on the threat analysis results to reduce possible risks.
[0079] After the electronic device obtains the first code text of the set of commands to be executed, it can analyze the first code text to obtain at least one command included in the set of commands to be executed.
[0080] Exemplarily, the electronic device may analyze and process the code data in the first code text according to the preconfigured preprocessing method through the following step 202, and split the analyzed and processed first code text to obtain code data corresponding to multiple commands through the following step 203. The preconfigured preprocessing method is to filter the code data in the first code text to obtain the code data that needs to be subjected to threat level determination and defense processing.
[0081] Step 202: The electronic device filters the first code text according to at least one preconfigured filtering rule to obtain a second code text.
[0082] Step 203: The electronic device splits the second code text into code data corresponding to at least one command according to a preconfigured command division rule.
[0083] Exemplarily, in step 202, the at least one filtering rule may include but is not limited to at least one of the following: a first filtering rule for filtering whitelist command data, a second filtering rule for filtering symbol data of a target symbol, or a third filtering rule for filtering pseudocode data. The electronic device may filter the code data in the first code text based on the at least one filtering rule to obtain a second code text.
[0084] In a possible manner, the implementation of step 202 may include at least one of the following steps 2021, 2022, or 2023:
[0085] Step 2021: The electronic device matches the whitelist command set and the first code text, and based on the matching result, filters out at least one whitelist command data belonging to the whitelist command in the first code text to obtain the second code text.
[0086] Exemplarily, the whitelist command set can be divided into a first whitelist set and a second whitelist set, wherein the first whitelist set is a whitelist command set for filtering single commands, and the second whitelist set is a whitelist command set for filtering combined commands.
[0087] For example, filtering based on the first whitelist set, that is, single command whitelist filtering, is applicable to the case where the command set contains the command string. When the command set to be detected contains only the regular blacklist in the single string of commands, and the other parts of the command set no longer trigger other blacklist commands, the final command combination result is white. For example, filtering based on the second whitelist set, that is, the combined command whitelist, is applicable to the case where the combined command set needs to be fully matched. When the command set to be detected is the same as the combined command, the detection combination result is white. It is often used for those that have been audited to be risk-free. Command sets are generally provided in the form of tools and Demo commands, which are basically copied and used directly without modification or recombination.
[0088] Exemplarily, the electronic device may pre-configure the correspondence between multiple operation and maintenance platforms and the whitelist command set corresponding to each operation and maintenance platform. Then the method for obtaining the whitelist command set includes: the electronic device may determine the whitelist command set corresponding to the current operation and maintenance platform from the correspondence between at least one candidate operation and maintenance platform and the candidate whitelist command set according to the current operation and maintenance platform. For example, after the electronic device obtains the execution data, it may enter the command preprocessing program after the command data is accessed to identify the command source, so as to match the whitelists of different operation and maintenance platforms.
[0089] Step 2022: The electronic device matches the target symbol set and the first code text, and based on the matching result, filters the symbol data in the code text that matches any target symbol to obtain the second code text, wherein the target symbol set includes at least one target symbol.
[0090] The target symbol may be a pre-configured special symbol or a specific character used to generate pseudocode. For example, for filtering special symbols, the electronic device may filter out special characters such as blank, tab, and carriage return. For specific characters used to generate pseudocode, such as using specific characters such as \, ', ", $, ?, {}, etc. to bypass defense and bypass command detection, the electronic device may filter the specific characters.
[0091] Step 2023: The electronic device identifies at least one pseudocode data in the code text based on the pseudocode identification condition, and based on the generation method corresponding to the at least one pseudocode data, restores the at least one pseudocode data to the corresponding at least one source code data to obtain the second code text.
[0092] For example, for pseudocode data generated using special encoding methods such as base64 encryption and decryption, the pseudocode data can be identified to avoid the situation where the special encoding method bypasses command detection, and the identified pseudocode data can be restored to obtain the source code data.
[0093] Exemplarily, the following Table 1 shows several examples of filtering out target symbols to restore source code data:
[0094] Table 1
[0095]
[0096]
[0097] In Table 1, the left column is a code example that uses special characters and special encodings to bypass detection; the right column is the source code restored after filtering out the special characters, or the source code restored according to the special encoding method.
[0098] It should be noted that after filtering out special characters, special codes, single command whitelists, and combined command whitelists, it is determined whether the code data in the second code text is empty; if it is not empty, the second code text is divided into lines according to the pre-configured command division rules to obtain at least one command; and the command detection layer is entered to perform threat leveling of the command. In a possible example, the pre-configured command division rules may include line break processing according to pre-configured line break characters; for example, the pre-configured line break characters may be used to divide the second code text into lines to obtain code data corresponding to a command in each line.
[0099] Step 204: The electronic device determines a target level corresponding to the set of commands to be executed based on a matching result between the at least one command and a threat command set corresponding to at least one threat level.
[0100] Exemplarily, the electronic device may match each command with a threat command set corresponding to each threat level, and determine the target level corresponding to the set of commands to be executed based on the matching result between each command and each threat command set. For example, if there is a command in the set of commands to be executed that matches any threat command set, the threat level corresponding to any threat command set is used as the target level of the set of commands to be executed.
[0101] One possible way is Figure 3 As shown, step 204 can be implemented by following steps 2041-2042:
[0102] Step 2041: The electronic device uses the hit conditions corresponding to each threat command in each threat level to obtain the hit results of the code data corresponding to each command in the threat command set corresponding to each threat level.
[0103] The hit result of each command indicates whether the command hits the threat command in each threat command set; the hit condition corresponding to each threat command refers to the condition that must be met to hit the threat command. Exemplarily, the electronic device can use the matching between the code data of each command and the hit condition corresponding to each threat command to determine the hit condition of each command corresponding to each threat command set, so as to determine the hit result of each command based on this.
[0104] In one possible manner, the hit condition corresponding to each threat command includes the key code data of each threat command, and the electronic device can match each command and each threat command based on the key code data. Exemplarily, step 2041 can be implemented by following the steps 2041a-2041b:
[0105] Step 2041a: The electronic device matches the key code data corresponding to each threat command with the code data of each command to obtain a matching relationship between each command and each threat command;
[0106] Step 2041b: The electronic device obtains a hit result between each command and each threat command based on a matching relationship between each command and each threat command.
[0107] The matching relationship between each command and the threat command refers to whether the command matches or does not match the threat command.
[0108] Exemplarily, the electronic device identifies whether the code data of each command includes the key code data corresponding to each threat command based on the key code data in the hit condition corresponding to each threat command; for each command, if the code data of each command includes the key code data corresponding to any threat command, it is determined that each command hits the any threat command.
[0109] The key code data may be identification data for identifying whether each command is a threat command. If the code data of each command includes the key code data of any threat command, then each command matches the any threat command, and it can be determined that the command hits the any threat command; otherwise, if the code data of each command does not include the key code data of any threat command, it means that each command does not hit any threat command.
[0110] In one possible manner, the key code data corresponding to each threat command includes at least one of the following:
[0111] Write operation sensitive path corresponding to the write operation command;
[0112] The read operation sensitive path corresponding to the read operation command;
[0113] Pre-configure the command definition data corresponding to the blacklist command;
[0114] Potential threat parameters corresponding to each pre-configured command;
[0115] Download path data corresponding to download commands.
[0116] Accordingly, the implementation of step 2041a may include at least one of the following:
[0117] If the critical code data includes a write-operation sensitive path, in response to detecting that the code data of any command includes an operation path matching the write-operation sensitive path, determining that the any command matches a write-operation threat command corresponding to the write-operation sensitive path;
[0118] If the critical code data includes a read operation sensitive path, in response to detecting that the code data of any command includes an operation path matching the read operation sensitive path, determining that the any command matches a read operation threat command corresponding to the read operation sensitive path;
[0119] If the key code data includes blacklist command definition data, in response to detecting that the code data of any command includes the blacklist command definition data, determining that the any command matches a blacklist command corresponding to the blacklist command definition data;
[0120] If the critical code data includes a potential threat parameter, in response to detecting that the code data of any command includes the potential threat parameter, determining that the any command matches a preconfigured high-risk command including the potential threat parameter;
[0121] If the key code data includes preset download path data corresponding to the download class command, in response to detecting that the code data of any command includes the preset download path data, it is determined that the any command matches the target download class command corresponding to the preset download path data.
[0122] In a possible example, each threat command may include a write threat operation command or a read operation threat command, and the key code data may include at least one of a read operation sensitive path or a write operation sensitive path. If the key code data includes a read / write operation sensitive path, the electronic device may detect whether the code data of each command includes an operation path that matches the read / write operation sensitive path. Taking the write operation as an example, if the code data of any command includes an operation path that matches the write operation sensitive path, it can be determined that the command hits the write operation threat command match corresponding to the write operation sensitive path; that is, each command is a threat command of the write operation threat command.
[0123] For example, for the detection of the write operation path, the write operation path can be used to detect whether the file of the write operation is a sensitive path, such as / etc / crontab, so as to accurately determine whether the command to be executed this time writes a sensitive file of the system.
[0124] The write operation sensitive paths include but are not limited to those shown in Table 2 below:
[0125] Table 2
[0126]
[0127]
[0128] For example, for the detection of the read operation path, it is detected whether the file of the read operation is a sensitive path, such as / etc / passwd, so as to detect whether the command to be executed this time needs to read sensitive system files, such as modifying / overwriting important system files.
[0129] The read operation sensitive paths include but are not limited to those shown in Table 3 below:
[0130] Table 3
[0131] Read-sensitive path (example) / etc / passwd / etc / shadow ……
[0132] In another possible example, each threat command may include each pre-configured high-risk command, and accordingly, the key code data may include potential threat parameters corresponding to each pre-configured high-risk command. It can be detected whether the code data of each command includes the potential threat parameter; if the code data of any command includes the potential threat parameter, it is determined that the any command matches the pre-configured high-risk command including the potential threat parameter, that is, the pre-configured high-risk command in the commands.
[0133] By setting the potential threat parameters of pre-configured high-risk commands, the high-risk parameters of some commands are detected to determine whether the command hits the high-risk command parameters, such as the cp-rf forced overwrite command. For example, the following table 4 shows the following high-risk parameters:
[0134] Table 4
[0135]
[0136]
[0137] In Table 4, the left column is the corresponding pre-configured commands, and the right column is the high-risk parameters corresponding to the pre-configured commands. Among them, the command cp is a copy command, and the parameter -rf of this command indicates forced overwriting without prompting; the command rm is a delete command, and the parameter -rf of this command indicates direct deletion of files or directories without confirmation; the command fdisk is a partition operation command, and the parameter -d of this command indicates deleting a partition.
[0138] In another possible example, each threat command may include a pre-configured blacklist command, and accordingly, the key code data may include blacklist command definition data corresponding to the pre-configured blacklist command. Among them, the blacklist command can be used to detect whether each command hits the blacklist. The following Table 5 shows several possible blacklist commands:
[0139] Table 5
[0140] category Command (example) Delete files / directories / accounts and other related commands rm Format disk related commands mkfs Clear / overwrite file related commands > / dev / sda Script sends related commands Python Upload and download related detection curl Permanently erase data related commands shred Service interruption related commands shutdown
[0141] The left column in Table 5 is the pre-configured blacklist commands, and the right column is the command definition data corresponding to each blacklist command; for example, the command definition data may be a function name, a command name, and the like.
[0142] In another possible example, the download command in the set of commands to be executed can also be detected. In one example, each threat command may include a download command, and the key code data may include the download path data of the download command; for example, the download path data may include a download address, such as a URL address. Then the electronic device can identify whether the download address of the download command in the set of commands to be executed matches the download path data based on the download path data of the download command; such as whether the download address of the download command overlaps with the download path, whether the download address of the download command includes the key file name in the download path data, etc.; based on this, it can be realized to identify whether the download address of the download command includes a blacklist address, whether it includes a confidential file address, etc. In another example, the download path data of the download command may also include the download content corresponding to the download address, such as the downloaded file, video, APP, etc.; for example, the wget / curl command indicates downloading a file from the network; then the electronic device can download the target data corresponding to the download address based on the download address in the download command in the set of commands to be executed; and based on the download path data of the download command, the composite file detection technology performs combined detection to detect whether the target data is threatened. For example, the target data is the same as the downloaded file corresponding to the threat command; the downloaded APP installation package corresponding to the target data and the threat command is the same type of APP, etc. In another example, a regular expression may be pre-configured, and the regular expression may be an expression for detecting whether a specified threat command is included; based on the regular expression, it may be detected whether the set of commands to be executed hits the specified threat command.
[0143] Step 2042: The electronic device determines a target level corresponding to the set of commands to be executed based on the hit result of each command in the set of commands to be executed.
[0144] Exemplarily, for each command, if the hit result of each command represents that each command hits any threat command set, the threat level of each command is determined to be the threat level corresponding to the hit threat command set; the electronic device can determine the target level corresponding to the command set to be executed based on the threat level of each command.
[0145] For example, the threat level can be classified according to the hit results of each command in the set of commands to be executed. The threat levels may include high risk level, medium risk level and low risk level. Of course, the threat levels can also be configured as needed, and this application does not limit this.
[0146] The following shows a rule for grading the threat of a set of commands to be executed based on the hit results of each command:
[0147] If there is a command that hits the high-risk command set, such as a permanent erase command, a disk format, a forced overwrite (such as deleting a database), and other commands that cause irreversible damage, the target level of the command set to be executed is determined to be high-risk.
[0148] If there are commands that hit the medium-risk command set, such as commands that read sensitive paths, write sensitive paths, maliciously upload and download, clear and overwrite files, send scripts, interrupt services, and hit regular matching rules, then the target level of the command set to be executed is determined to be medium-risk.
[0149] If any command does not hit the above high-risk command set and medium-risk command set, the target level of the command set to be executed is determined to be low-risk.
[0150] In one possible manner, the electronic device may comprehensively determine the threat level of the set of commands to be executed based on the number of commands distributed at each threat level. Exemplarily, the electronic device determines the target level corresponding to the set of commands to be executed based on the threat level of each command, including: the electronic device counts the number of commands corresponding to each threat level of the set of commands to be executed based on the threat level of each command; the electronic device determines the target level corresponding to the set of commands to be executed based on the number of commands corresponding to each threat level of the set of commands to be executed.
[0151] For example, the threat levels may include a high risk level, a medium risk level, and a low risk level. If 5 commands in the set of commands to be executed hit the threat command set corresponding to the high risk level, 1 command hits the threat command set corresponding to the medium risk level, and 1 command hits the threat command set corresponding to the low risk level, then the target level of the set of commands to be executed may be determined as a high risk level.
[0152] Step 205: The electronic device performs a threat level assessment on the target task corresponding to the set of commands to be executed based on the target level and execution elements corresponding to the set of commands to be executed, and obtains the threat level of the target task.
[0153] Exemplarily, the execution element of the set of commands to be executed is an element associated with the target task. In this step, the electronic device can comprehensively determine the threat level of the target task in combination with the status data of the execution element and the target level. For example, the electronic device can obtain the interval where the status data of the execution element is located, determine the element threat level of the execution element based on the interval where the status data of the execution element is located, and determine the threat level of the target task corresponding to the set of commands to be executed based on the element threat level of the execution element and the target level corresponding to the set of commands to be executed.
[0154] In one possible approach, the threat level of the target task can be determined based on the target level of the set of commands to be executed and combined with the execution elements according to the situation. Figure 3 As shown, step 205 can be implemented by following steps 2051-2052:
[0155] Step 2051: The electronic device performs a threat level assessment on the execution element of the target task based on the state data of the execution element to obtain an element threat level of the execution element;
[0156] Step 2052: The electronic device performs a comprehensive assessment of the threat level of the target task based on the target level and the element threat level to obtain the threat level of the target task.
[0157] Among them, if the target level corresponding to the set of commands to be executed is in the first level range, the electronic device can combine the status data of the execution element to comprehensively evaluate the threat level of the target task; if the target level is in the second level range, the electronic device can directly determine the target level as the threat level of the target task.
[0158] In one possible manner, the execution element may include but is not limited to at least one of the following:
[0159] The object that triggers the target task;
[0160] The executed device corresponding to the target task;
[0161] The execution frequency of the target task within the target period;
[0162] The electronic device where the operation and maintenance platform is located.
[0163] Exemplarily, after the target level corresponding to the set of commands to be executed is determined, the final threat level of the execution task can be obtained by integrating characteristic information such as the executor, execution time, and number of execution hosts of the command execution task.
[0164] Accordingly, the implementation of step 2052 may include at least one of the following:
[0165] The execution element includes a trigger object that triggers the target task, and if the target level is in the first level interval and the element threat level corresponding to the on-the-job status of the trigger object is in the first level interval, determining the threat level of the target task to be the target level;
[0166] The execution element includes an executed device corresponding to the target task, and if the target level is in the first level interval and the element threat level corresponding to the execution host data of the executed device is in the first level interval, determining the threat level of the target task to be the target level;
[0167] The execution element includes the execution frequency of the target task in the target time period. If the target level is in the first level interval and the element threat level corresponding to the execution frequency is in the first level interval, the threat level of the target task is determined to be the target level;
[0168] The execution element includes the electronic device where the operation and maintenance platform is located. If the target level is in the first level interval and the element threat level corresponding to the electronic device where the operation and maintenance platform is located is in the first level interval, the threat level of the target task is determined to be the target level.
[0169] In one example, the execution element may include a trigger object that triggers the target task. The electronic device may obtain the state data of the object, which may be the object's on-the-job status; for example, the on-the-job status may be divided into "on-the-job", "to be resigned (active)", "to be resigned (passive)", and "abnormal user"; each status may correspond to its own object threat level; the object may be the operation and maintenance personnel who triggers the execution of the pending command, and the electronic device performs personnel feature detection on the operation and maintenance personnel, detects the on-the-job status of the task executor, and determines the object threat level of the task executor, for example, if it is passive resignation, it may correspond to a medium-risk level, and if it is on-the-job, it may correspond to a low-risk level, etc.; the electronic device may focus on detecting commands triggered by passively resigned employees on the operation and maintenance platform.
[0170] In another example, the execution element may include the executed device corresponding to the target task, that is, the target task controls which executed devices to execute the task; for example, the target task is for the operation and maintenance personnel to control the connected host devices on the operation and maintenance platform to perform download operations, update version tasks, etc. Then the electronic device can obtain status data such as the number of devices and the online status of the devices being executed. For example, the host number detection, different numbers of execution hosts or different number intervals to which the execution host data belongs, can correspond to different element threat levels. The electronic device can determine the element threat level corresponding to the executed device by detecting the number of executed hosts, so as to detect the impact range of the command execution task. For example, the more hosts there are, the higher the corresponding threat level; the electronic device can focus on detecting execution behaviors involving too many hosts and too large a proportion of the total business machines.
[0171] In another example, the execution element may include the execution frequency of the target task within the target period. For example, if the target task is batch operation detection, the electronic device may detect whether the target task has been frequently executed in batches within the target period. The more frequent the execution frequency, the higher the corresponding element threat level; among them, the electronic device may focus on detecting the execution behavior of issuing high-risk and medium-risk commands continuously in a short period of time.
[0172] In another example, the execution element may include the electronic device where the operation and maintenance platform is located. For example, the electronic device may obtain the historical execution status of the electronic device where the operation and maintenance platform is located, whether the login verification is passed, etc. Different states of the electronic device where the operation and maintenance platform is located correspond to different element threat levels. Among them, if the historical execution status is that the device has a vulnerability or anomaly, or there is a login anomaly in the device, the element level can be considered to have a potential threat, such as medium risk, high risk, etc.
[0173] For example, the first level interval may be a medium-risk level; if it is a medium-risk level, the task threat level of the target task can be comprehensively assessed in combination with the element threat level of the execution element. The second level interval may include a high-risk and above interval; if it is a high-risk level, the task threat level of the task is directly defined as high-risk.
[0174] The following shows a method of grading the threat of a target task by combining the threat level of the command and the status of the executor, execution time, number of hosts, etc.:
[0175] If the command threat level of the command set to be executed is high risk, such as permanent erase command, disk format, and forced overwrite command, the threat level of the target task is comprehensively determined to be high risk.
[0176] If the command threat level of the set of commands to be executed is medium, such as commands to read sensitive paths, write sensitive paths, malicious upload and download, etc., but the number of execution hosts is wide, for example, the number of machines accounts for more than 50%. The threat level of the target task is comprehensively determined to be medium.
[0177] If the command threat level of the command set to be executed is medium risk, such as sensitive path, write sensitive path, malicious upload and download commands, but the high-risk command is issued continuously within 2 hours, then the threat level of the target task is comprehensively determined to be medium risk.
[0178] If the command threat level of the set of commands to be executed is medium, such as sensitive path, write sensitive path, malicious upload and download commands, but the executor is a person who is about to leave (passive), then the threat level of the target task is comprehensively determined to be medium.
[0179] In cases other than those mentioned above, the threat level of the target mission is comprehensively determined to be low risk.
[0180] Step 206: The electronic device performs defense processing on the set of commands to be executed according to a target defense operation that matches the threat level of the target task.
[0181] The electronic device may pre-configure the defense processing operations corresponding to each level. In this step, the electronic device may perform the defense processing operations corresponding to the threat level of the target task on the to-be-executed command set based on the threat level of the target task and the defense processing operations corresponding to each level.
[0182] One possible way is Figure 3 As shown, the implementation of step 206 may include the following steps 2061-2062:
[0183] Step 2061: The electronic device determines, based on the threat level of the target task, a target defense operation corresponding to the target task from at least one correspondence relationship between the threat level and the defense processing operation; the higher the threat level, the higher the defense level corresponding to the defense processing operation;
[0184] Step 2062: The electronic device sends a defense instruction to the operation and maintenance platform based on the target defense operation corresponding to the target task. The defense instruction instructs to perform defense processing on the to-be-executed set according to the target defense operation.
[0185] Exemplarily, the electronic device may send the defense instruction to the device where the operation and maintenance platform is located. Based on the defense instruction, the device where the operation and maintenance platform is located performs defense processing on the to-be-executed set according to the target defense operation.
[0186] Exemplarily, if the threat level of the target task is high risk, the electronic device can actively intercept the set of commands to be executed to avoid high-risk situations. If the threat level of the target task is medium risk, the electronic device can trigger the designated object to approve the set of commands to be executed, and then control the device where the operation and maintenance platform is located to execute it after approval. For example, it can be approved by the leader of the object executing the target task or the backup person in charge of the target task. If the threat level of the target task is low risk, the electronic device can normally execute the set of commands to be executed. In addition, the electronic device can also record the execution process and store the recorded data in the relevant task log for subsequent auditing.
[0187] In one possible example, the electronic device can also perform corresponding defense processing based on the corresponding control strength of the operation and maintenance platform. Exemplarily, the control strength corresponding to the operation and maintenance platform can be strong control or weak control. Among them, if it is strong control, the electronic device can be processed according to the correspondence between the threat level and the defense processing operation: high risk-interception, medium risk-approval, low risk-pass. If it is weak control, the electronic device can issue an alarm to the pre-configured object based on the high risk or medium risk level, and can record it in the relevant task log based on the low risk level; that is, in weak control, the threat level does not need to be used to directly affect the execution of the target task, only to generate logs or alarms and push relevant persons in charge.
[0188] Figure 4 A flowchart of a command processing provided for this application, such as Figure 4 As shown, the present application establishes an integrated detection and response process of system access, command preprocessing, command detection, multi-dimensional task threat classification, and threat classification disposal to ensure operation and maintenance security, and can better prevent such behaviors of using Shell commands to execute or mistakenly execute threatening commands, for example, it can prevent malicious database deletion incidents. Figure 5 A schematic diagram of a system architecture provided for this application, and Figure 4 Corresponding to the integrated detection and response process in the system, the system architecture also includes the system access layer, command preprocessing layer, command detection layer, threat detection layer, and threat disposal layer.
[0189] like Figure 4 and Figure 5 As shown, the system access process is implemented in the system access layer, which can support authentication API access and bypass audit access. Authentication API access means that the system will take "pass", "reject", "trigger approval" and other disposal actions for the execution task according to the threat detection level. For example, the system intercepts command execution tasks with extremely high threat levels, and has a stronger control effect on malicious commands, which belongs to strong control; bypass audit access means that the system will only perform threat detection on the execution task, and its detection results will not affect the execution of the task. It only generates logs and alarms and pushes them to relevant persons in charge, which belongs to weak control.
[0190] like Figure 5 As shown, the command preprocessing process is implemented in the command preprocessing layer, and the process includes: (1) command source identification. After the command data is connected, the command preprocessing program is entered. The command source is identified to match different system whitelists. (2) Single command whitelist filtering is used to whitelist a single command in the command to be executed. (3) Combined command whitelist is used to whitelist a combined command in the command set to be executed. (4) Special symbol filtering. Special characters such as blank, tab, and carriage return are processed. (5) Bypass defense. Methods that use special characters such as \, ', ", $, ?, {} to bypass command detection are defended. The above special characters are identified and filtered. Methods that use special codes such as base64 encryption and decryption to bypass command detection are defended. The above special codes are identified and decoded to restore the source code. (6) Command branching. Based on the above processing, the second code text is branched according to the line break and split into code data corresponding to multiple commands.
[0191] like Figure 5As shown, the command detection process is implemented in the command detection layer, which includes: (1) write operation detection, detecting whether the file of the write operation is a sensitive path, such as / etc / crontab; used to detect whether the system sensitive file is written. (2) read operation detection, detecting whether the file of the read operation is a sensitive path, such as / etc / passwd; used to detect whether the system sensitive file is read, such as modifying / overwriting important system files. (3) high-risk parameter detection, detecting whether the command hits the high-risk command parameter, such as the cp-rf forced overwrite command. (4) blacklist detection, detecting whether the command hits the blacklist library, such as the mkfs disk formatting command. (5) download command detection, detecting the download address of the download command or the target data corresponding to the download address, such as the wget / curl command, downloading the file corresponding to the download address of the command, and performing combined detection based on the composite file detection technology of the downloaded file. (6) regular matching detection, detecting malicious commands by regular matching, mainly used to match preset command rules. Of course, this layer also includes a whitelist library, and whitelist detection can be performed again based on this.
[0192] like Figure 5 As shown in the figure, the multi-dimensional threat analysis process implemented in the threat detection layer includes: (1) Personnel feature detection, which detects the on-the-job status of the task executor, and can focus on detecting the command execution behavior of employees who have left the company passively. (2) Batch operation detection, which will focus on detecting the execution behavior of issuing high-risk and medium-risk commands continuously in a short period of time. (3) Host quantity detection, which detects the number of executed hosts and detects the impact scope of the command execution task. It can focus on detecting the execution behavior involving too many hosts and too large a proportion of the total business machines. (4) Task threat classification, which comprehensively classifies the threat level of the command and the executor's status, execution time, number of hosts and other characteristics.
[0193] like Figure 5 As shown, the threat classification process is implemented in the threat handling layer. For example, the threat level of the execution task can be classified into levels such as pass, reject, approve, pass, audit, etc.
[0194] Figure 6 The following is a flow chart of system access and command preprocessing. Figure 6 As shown, the process includes:
[0195] 1. System access process: Receive the set of commands to be executed from various shell command distribution channels, and determine the control intensity of the operation and maintenance platform, whether it is strong control or weak control. Then, execute the next process;
[0196] 2. Command preprocessing, including: (1) Identify which operation and maintenance platform the command comes from, so as to match the whitelist corresponding to the operation and maintenance platform; (2) Single command whitelist filtering, used to whitelist single commands in the commands to be executed. (3) Combined command whitelist, used to whitelist combined commands in the commands to be executed. (4) Special symbol filtering, processing special characters such as blank, tab, and carriage return. (5) Regular expression conversion, which can use regular expressions to filter or convert each command. (6) Bypass defense, identify and filter special characters such as \, ', ", $, ?, {} that bypass defense, and identify and restore special codes. (7) Determine whether the code text is empty. If it is empty, determine that the command set to be executed is a low-risk command; otherwise, the code text is processed in lines according to the command and split into code data corresponding to multiple commands.
[0197] Figure 7 Figure 1 is a flowchart of the command detection process. Figure 7 As shown, the process includes: starting to traverse the code data corresponding to each command, first performing sensitive path detection, mainly including: write operation detection, detecting whether the file of the write operation is a write operation sensitive path; then, read operation detection, detecting whether the file of the read operation is a write operation sensitive path. Then, perform high-risk parameter detection to detect whether the command hits the high-risk command parameter. Then, perform blacklist detection to detect whether the command hits the blacklist library. And judge whether the traversal is completed. If so, traverse the specified command; such as traversing the download command, detect the download command according to the download rule. Regular matching rules can also be used to determine the threat of the specified command, and malicious commands can be detected by regular matching. Based on this, the determination result of the command threat level of the set of commands to be executed can be obtained.
[0198] Figure 8 Figure 1 is a flowchart of the threat detection and threat handling process. Figure 8As shown, 4. The threat detection process includes: personnel feature detection; batch operation detection; host number detection; threat classification of the execution task based on the comprehensive command threat level and the execution personnel status, execution time, host number and other characteristics. 5. Threat handling includes: hierarchical handling according to the threat level of the execution task, such as interception processing for high-risk level, approval processing for medium-risk level, and approval for status level. In addition, the following post-log audit-related processes can also be executed at the threat handling layer, including: (1) Data storage, storing all kinds of data in the above-mentioned command preprocessing, command detection, and threat detection processes in the database according to the pre-configured data format to achieve data formatting and storage. (2) Strategy detection, auditing and analyzing the historical execution tasks to further identify whether there is any behavior that bypasses command detection through technical means. (3) Operational audit, in which the intercepted extremely high-risk command execution tasks are audited, and the triggering object of the high-risk command can be connected to directly reach the executor, confirm his motivation, and warn the behavior of executing high-risk commands such as deleting the database, and inform the security principles. Confirm the motivation of the trigger object of the bypass command detection behavior, warn the malicious bypass system detection behavior, and inform the security principles. Regularly analyze the historical detection data to determine whether there are undetected high-risk commands, so as to improve the blacklist library.
[0199] It should be noted that the command processing method of this application, through multi-dimensional threat analysis of commands / scripts such as sensitive paths, read and write operations, high-risk parameters, black and white lists, regular matching, etc., can accurately identify malicious commands that endanger operation and maintenance security, such as permanent erasure of data, formatting of disks, deletion of libraries, clearing and overwriting of files and directories, uploading and downloading, and service interruption. The threat level of commands is graded from the perspective of operation and maintenance security to prevent malicious library deletion incidents.
[0200] In addition, the present application can also conduct threat analysis on the task based on multiple dimensions such as task executors, execution time, number of execution hosts, etc., and perform threat rating on command execution tasks, so as to accurately identify execution tasks with operation and maintenance security risks.
[0201] In addition, this application is graded and handled according to the threat level of the execution task, and intercepted, approved or passed according to the risk level, which greatly improves the operation and maintenance security management effect, and the handling rules can be flexibly configured according to different business scenarios. While taking into account the availability of the business, it greatly improves the security of the business in command execution.
[0202] The command processing method provided in the present application obtains the first code text and execution element corresponding to the set of commands to be executed of the operation and maintenance platform, and filters and splits the first code text to obtain at least one command included in the set of commands to be executed. Then, based on the threat command set corresponding to at least one threat level, the threat level of each command is evaluated to obtain the target level corresponding to the set of commands to be executed; the accuracy of command code data recognition is improved. In addition, the threat level of the target task corresponding to the set of commands to be executed is comprehensively evaluated in combination with the target level and execution element corresponding to the set of commands to be executed; the execution tasks with operation and maintenance security risks can be accurately identified. Therefore, the set of commands to be executed is defensively processed based on the threat level of the target task; hierarchical processing of commands for the operation and maintenance platform according to different threat levels can be achieved, and tasks with high threat levels can be effectively defended, the accuracy of command processing is improved, and the accuracy of defense of tasks of different levels is improved.
[0203] The command processing method provided in this application relates to cloud computing, cloud storage, cloud security and other technologies.
[0204] It can be understood that cloud computing refers to the delivery and use model of IT infrastructure, which means obtaining required resources through the network in an on-demand and easily scalable manner; in a broad sense, cloud computing refers to the delivery and use model of services, which means obtaining required services through the network in an on-demand and easily scalable manner. This service can be IT and software, Internet-related, or other services. Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing.
[0205] With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from the previous parallel distributed computing, the emergence of cloud computing will promote revolutionary changes in the entire Internet model and enterprise management model from a conceptual perspective.
[0206] It can be understood that cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0207] It is understandable that cloud security refers to the general term for security software, hardware, users, institutions, and security cloud platforms based on cloud computing business model applications. Cloud security integrates emerging technologies and concepts such as parallel processing, grid computing, and unknown virus behavior judgment. Through a large number of networked clients, it detects abnormal software behavior in the network, obtains the latest information on Trojans and malicious programs on the Internet, and sends it to the server for automatic analysis and processing, and then distributes virus and Trojan solutions to each client.
[0208] The main research directions of cloud security include: 1. Cloud computing security, which mainly studies how to ensure the security of the cloud itself and various applications on the cloud, including cloud computer system security, secure storage and isolation of user data, user access authentication, information transmission security, network attack protection, compliance auditing, etc.; 2. Cloudification of security infrastructure, which mainly studies how to use cloud computing to build and integrate security infrastructure resources and optimize security protection mechanisms, including building a large-scale security event, information collection and processing platform through cloud computing technology, realizing the collection and correlation analysis of massive information, and improving the control ability of security events and risk control capabilities of the entire network; 3. Cloud security services, which mainly studies various security services provided to users based on cloud computing platforms, such as antivirus services.
[0209] Fig. 9 This is a schematic diagram of the structure of a command processing device provided in an embodiment of the present application. Fig. 9 As shown, the device comprises:
[0210] The acquisition module 901 is used to respond to the command analysis request of the operation and maintenance platform and acquire the execution data corresponding to the to-be-executed command set of the operation and maintenance platform, wherein the execution data includes the first code text of the to-be-executed command set and the execution element of the to-be-executed command set;
[0211] A filtering module 902, configured to filter the first code text according to at least one preconfigured filtering rule to obtain a second code text;
[0212] A splitting module 903 is used to split the second code text according to a preconfigured command division rule to obtain at least one command included in the to-be-executed command set;
[0213] A command level assessment module 904 is used to assess the threat level of at least one command in the set of commands to be executed based on a threat command set corresponding to at least one pre-configured threat level, and obtain a target level corresponding to the set of commands to be executed;
[0214] A task level assessment module 905 is used to assess the threat level of the target task corresponding to the set of commands to be executed based on the target level and execution element corresponding to the set of commands to be executed, so as to obtain the threat level corresponding to the target task;
[0215] The defense processing module 906 is used to perform defense processing on the set of commands to be executed according to the target defense operation that matches the threat level of the target task.
[0216] In a possible implementation, the command level evaluation module is used to:
[0217] Using the hit conditions corresponding to each threat command in each threat level, obtaining the hit results of the code data corresponding to each command in the threat command set corresponding to each threat level, the hit result of each command indicating whether the command hits the threat command in each threat command set;
[0218] Based on the hit result of each command in the set of commands to be executed, a target level corresponding to the set of commands to be executed is determined.
[0219] In a possible implementation, the hit condition corresponding to each threat command includes key code data of each threat command;
[0220] The command level assessment module is used to:
[0221] Matching the key code data corresponding to each threat command with the code data of each command to obtain a matching relationship between each command and each threat command;
[0222] Based on the matching relationship between each command and each threat command, a hit result between each command and each threat command is obtained.
[0223] In a possible implementation, the command level assessment module is used for at least one of the following:
[0224] If the critical code data includes a write-operation sensitive path, in response to detecting that the code data of any command includes an operation path matching the write-operation sensitive path, determining that the any command matches a write-operation threat command corresponding to the write-operation sensitive path;
[0225] If the critical code data includes a read operation sensitive path, in response to detecting that the code data of any command includes an operation path matching the read operation sensitive path, determining that the any command matches a read operation threat command corresponding to the read operation sensitive path;
[0226] If the key code data includes blacklist command definition data, in response to detecting that the code data of any command includes the blacklist command definition data, determining that the any command matches a blacklist command corresponding to the blacklist command definition data;
[0227] If the critical code data includes a potential threat parameter, in response to detecting that the code data of any command includes the potential threat parameter, determining that the any command matches a preconfigured high-risk command including the potential threat parameter;
[0228] If the key code data includes preset download path data corresponding to the download class command, in response to detecting that the code data of any command includes the preset download path data, it is determined that the any command matches the target download class command corresponding to the preset download path data.
[0229] In a possible implementation, the command level evaluation module is used to:
[0230] For each command, if the hit result of each command indicates that each command hits any threat command set, the threat level of each command is determined to be the threat level corresponding to the hit threat command set;
[0231] Based on the threat level of each command, count the number of commands corresponding to each threat level of the command set to be executed;
[0232] Based on the number of commands corresponding to the to-be-executed command set at each threat level, a target level corresponding to the to-be-executed command set is determined.
[0233] In a possible implementation, the filtering module is used for at least one of the following:
[0234] Matching the whitelist command set and the first code text, filtering out at least one whitelist command data belonging to the whitelist command in the first code text based on the matching result, to obtain the second code text;
[0235] Matching the target symbol set and the first code text, filtering the symbol data matching any target symbol in the code text based on the matching result to obtain the second code text, wherein the target symbol set includes at least one target symbol;
[0236] At least one pseudocode data in the code text is identified based on the pseudocode identification condition, and based on the generation method corresponding to the at least one pseudocode data, the at least one pseudocode data is restored to the corresponding at least one source code data to obtain the second code text.
[0237] In a possible implementation, the task level assessment module is used to:
[0238] Based on the status data of the execution element, a threat level assessment is performed on the execution element of the target task to obtain an element threat level of the execution element;
[0239] Based on the target level and the element threat level, a comprehensive assessment is made on the threat level of the target task to obtain the threat level of the target task.
[0240] In a possible implementation, the task level assessment module is used for at least one of the following:
[0241] The execution element includes a trigger object that triggers the target task, and if the target level is in the first level interval and the element threat level corresponding to the on-the-job status of the trigger object is in the first level interval, determining the threat level of the target task to be the target level;
[0242] The execution element includes an executed device corresponding to the target task, and if the target level is in the first level interval and the element threat level corresponding to the execution host data of the executed device is in the first level interval, determining the threat level of the target task to be the target level;
[0243] The execution element includes the execution frequency of the target task in the target time period. If the target level is in the first level interval and the element threat level corresponding to the execution frequency is in the first level interval, the threat level of the target task is determined to be the target level;
[0244] The execution element includes the electronic device where the operation and maintenance platform is located. If the target level is in the first level interval and the element threat level corresponding to the electronic device where the operation and maintenance platform is located is in the first level interval, the threat level of the target task is determined to be the target level.
[0245] In a possible implementation, the defense processing module is used to:
[0246] Based on the threat level of the target task, determine a target defense operation corresponding to the target task from at least one correspondence relationship between the threat level and the defense processing operation; the higher the threat level, the higher the defense level corresponding to the defense processing operation;
[0247] Based on the target defense operation corresponding to the target task, a defense instruction is sent to the operation and maintenance platform, where the defense instruction instructs to perform defense processing on the to-be-executed set according to the target defense operation.
[0248] The command processing method provided in the present application obtains the first code text and execution element corresponding to the set of commands to be executed of the operation and maintenance platform, and filters and splits the first code text to obtain at least one command included in the set of commands to be executed. Then, based on the threat command set corresponding to at least one threat level, the threat level of each command is evaluated to obtain the target level corresponding to the set of commands to be executed; the accuracy of command code data recognition is improved. In addition, the threat level of the target task corresponding to the set of commands to be executed is comprehensively evaluated in combination with the target level and execution element corresponding to the set of commands to be executed; the execution tasks with operation and maintenance security risks can be accurately identified. Therefore, the set of commands to be executed is defensively processed based on the threat level of the target task; hierarchical processing of commands for the operation and maintenance platform according to different threat levels can be achieved, and tasks with high threat levels can be effectively defended, the accuracy of command processing is improved, and the accuracy of defense of tasks of different levels is improved.
[0249] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0250] Fig.10 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the electronic device includes: a memory, a processor and a computer program stored in the memory, and the processor executes the above computer program to implement the steps of the command processing method. Compared with the related art, the following can be achieved:
[0251] The command processing method provided in the present application obtains the first code text and execution element corresponding to the set of commands to be executed of the operation and maintenance platform, and filters and splits the first code text to obtain at least one command included in the set of commands to be executed. Then, based on the threat command set corresponding to at least one threat level, the threat level of each command is evaluated to obtain the target level corresponding to the set of commands to be executed; the accuracy of command code data recognition is improved. In addition, the threat level of the target task corresponding to the set of commands to be executed is comprehensively evaluated in combination with the target level and execution element corresponding to the set of commands to be executed; the execution tasks with operation and maintenance security risks can be accurately identified. Therefore, the set of commands to be executed is defensively processed based on the threat level of the target task; hierarchical processing of commands for the operation and maintenance platform according to different threat levels can be achieved, and tasks with high threat levels can be effectively defended, the accuracy of command processing is improved, and the accuracy of defense of tasks of different levels is improved.
[0252] In an alternative embodiment, an electronic device is provided, such as Fig.10 As shown, Fig.10 The electronic device 1000 shown includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the electronic device 1000 may also include a transceiver 1004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 1004 is not limited to one, and the structure of the electronic device 1000 does not constitute a limitation on the embodiments of the present application.
[0253] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0254] The bus 1002 may include a path to transmit information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0255] The memory 1003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium\other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0256] The memory 1003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 1001. The processor 1001 is used to execute the computer program stored in the memory 1003 to implement the steps shown in the above method embodiment.
[0257] Among them, electronic equipment includes but is not limited to: servers, terminals or cloud computing center equipment, etc.
[0258] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0259] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0260] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said", and "the" used herein may also include plural forms. The terms "include" and "comprise" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, and operations, but do not exclude the implementation as other features, information, data, steps, operations, etc. supported by the technical field.
[0261] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0262] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0263] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A command processing method, characterized in that: The method comprises: In response to a command analysis request of the operation and maintenance platform, acquiring execution data corresponding to a set of commands to be executed of the operation and maintenance platform, wherein the execution data includes a first code text of the set of commands to be executed and an execution element of the set of commands to be executed; Filtering the first code text according to at least one preconfigured filtering rule to obtain a second code text; Splitting the second code text according to a preconfigured command division rule to obtain at least one command included in the set of commands to be executed; Based on a pre-configured threat command set corresponding to at least one threat level, performing a threat level assessment on at least one command in the set of commands to be executed, and obtaining a target level corresponding to the set of commands to be executed; Based on the target level and execution element corresponding to the set of commands to be executed, a threat level assessment is performed on the target task corresponding to the set of commands to be executed to obtain the threat level corresponding to the target task; The set of commands to be executed is defensively processed according to a target defense operation that matches the threat level of the target task.
2. The method according to claim 1, characterized in that The step of performing threat level assessment on at least one command in the set of commands to be executed based on the threat command set corresponding to at least one pre-configured threat level to obtain a target level corresponding to the set of commands to be executed includes: Using the hit conditions corresponding to each threat command in each threat level, obtaining the hit results of the code data corresponding to each command in the threat command set corresponding to each threat level, the hit result of each command indicating whether the command hits the threat command in each threat command set; Based on the hit result of each command in the set of commands to be executed, a target level corresponding to the set of commands to be executed is determined.
3. The method according to claim 2, characterized in that The hit condition corresponding to each threat command includes key code data of each threat command; The method adopts the hit conditions corresponding to each threat command in each threat level to obtain the hit results of the code data corresponding to each command in the threat command set corresponding to each threat level, including: Matching the key code data corresponding to each threat command with the code data of each command to obtain a matching relationship between each command and each threat command; Based on the matching relationship between each command and each threat command, a hit result between each command and each threat command is obtained.
4. The method according to claim 3, characterized in that The key code data corresponding to each threat command is matched with the code data of each command to obtain a matching relationship between each command and each threat command, including at least one of the following: If the critical code data includes a write-operation sensitive path, in response to detecting that the code data of any one of the commands includes an operation path matching the write-operation sensitive path, determining that the any one of the commands matches a write-operation threat command corresponding to the write-operation sensitive path; If the critical code data includes a read operation sensitive path, in response to detecting that the code data of any one of the commands includes an operation path matching the read operation sensitive path, determining that the any one of the commands matches a read operation threat command corresponding to the read operation sensitive path; If the key code data includes blacklist command definition data, in response to detecting that the code data of any one of the commands includes the blacklist command definition data, determining that the any one of the commands matches a blacklist command corresponding to the blacklist command definition data; If the critical code data includes a potential threat parameter, in response to detecting that the code data of any command includes the potential threat parameter, determining that the any command matches a preconfigured high-risk command including the potential threat parameter; If the key code data includes preset download path data corresponding to the download class command, in response to detecting that the code data of any command includes the preset download path data, it is determined that the any command matches the target download class command corresponding to the preset download path data.
5. The method according to claim 2, characterized in that: The determining, based on the hit result of each command in the set of commands to be executed, a target level corresponding to the set of commands to be executed, includes: For each command, if the hit result of each command indicates that each command hits any threat command set, determine the threat level of each command as the threat level corresponding to the hit threat command set; Based on the threat level of each command, counting the number of commands corresponding to each threat level of the set of commands to be executed; Based on the number of commands corresponding to the to-be-executed command set at each threat level, a target level corresponding to the to-be-executed command set is determined.
6. The method according to claim 1, characterized in that The filtering of the first code text according to at least one preconfigured filtering rule to obtain the second code text includes at least one of the following: Matching the whitelist command set and the first code text, filtering out at least one whitelist command data belonging to the whitelist command in the first code text based on the matching result, to obtain the second code text; Matching a target symbol set with the first code text, filtering symbol data matching any target symbol in the code text based on the matching result to obtain the second code text, wherein the target symbol set includes at least one target symbol; At least one pseudocode data in the code text is identified based on the pseudocode identification condition, and based on the generation method corresponding to the at least one pseudocode data, the at least one pseudocode data is restored to the corresponding at least one source code data to obtain the second code text.
7. The method according to claim 1, characterized in that The step of performing a threat level assessment on a target task corresponding to the set of commands to be executed based on the target level and execution element corresponding to the set of commands to be executed to obtain the threat level of the target task includes: Based on the status data of the execution element, a threat level assessment is performed on the execution element of the target task to obtain an element threat level of the execution element; Based on the target level and the element threat level, the threat level of the target task is comprehensively evaluated to obtain the threat level of the target task.
8. The method according to claim 7, characterized in that The step of evaluating the threat level of the target task corresponding to the set of commands to be executed based on the target level and the element threat level of the execution element includes at least one of the following: The execution element includes a triggering object that triggers the target task, and if the target level is in the first level interval and the element threat level corresponding to the on-the-job status of the triggering object is in the first level interval, determining the threat level of the target task to be the target level; The execution element includes an executed device corresponding to the target task, and if the target level is in the first level interval and the element threat level corresponding to the execution host data of the executed device is in the first level interval, determining the threat level of the target task to be the target level; The execution element includes the execution frequency of the target task within the target time period. If the target level is in the first level interval and the element threat level corresponding to the execution frequency is in the first level interval, the threat level of the target task is determined to be the target level; The execution element includes the electronic device where the operation and maintenance platform is located. If the target level is in the first level interval and the element threat level corresponding to the electronic device where the operation and maintenance platform is located is in the first level interval, the threat level of the target task is determined to be the target level.
9. The method according to claim 1, characterized in that: The performing defense processing on the set of commands to be executed according to the target defense operation matching the threat level of the target task includes: Based on the threat level of the target task, determining a target defense operation corresponding to the target task from at least one correspondence between the threat level and the defense processing operation; the higher the threat level, the higher the defense level corresponding to the defense processing operation; Based on the target defense operation corresponding to the target task, a defense instruction is sent to the operation and maintenance platform, wherein the defense instruction instructs to perform defense processing on the to-be-executed set according to the target defense operation.
10. A command processing device, characterized in that: The device comprises: An acquisition module, configured to, in response to a command analysis request of an operation and maintenance platform, acquire execution data corresponding to a set of commands to be executed of the operation and maintenance platform, wherein the execution data includes a first code text of the set of commands to be executed and an execution element of the set of commands to be executed; A filtering module, configured to filter the first code text according to at least one preconfigured filtering rule to obtain a second code text; A splitting module, used for splitting the second code text according to a preconfigured command division rule to obtain at least one command included in the set of commands to be executed; A command level assessment module, configured to perform a threat level assessment on at least one command in the set of commands to be executed based on a threat command set corresponding to at least one pre-configured threat level, and obtain a target level corresponding to the set of commands to be executed; A task level assessment module, configured to perform a threat level assessment on a target task corresponding to the set of commands to be executed based on a target level and an execution element corresponding to the set of commands to be executed, so as to obtain a threat level corresponding to the target task; The defense processing module is used to perform defense processing on the set of commands to be executed according to a target defense operation that matches the threat level of the target task.
11. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the command processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the command processing method according to any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the command processing method according to any one of claims 1 to 9 is implemented.
