A SOAR script running method, device, readable medium and server
By obtaining the information set of parallel running paths and running SOAR script nodes sequentially, the blocking problem during SOAR script running is solved, operating efficiency and stability are improved, and low resource consumption and fast response are achieved.
Patent Information
- Application Number
- CN202111650770.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-12-30
AI Technical Summary
During the running of SOAR scripts, especially when a large number of scripts are executed simultaneously or in complex business scenarios, blocking situations are likely to occur when executing multiple application node tasks, resulting in low operating efficiency and high failure rate.
By obtaining the information collection of parallel running paths, including branch script nodes, subordinate script nodes and aggregate script nodes, these nodes are run sequentially according to the running order, and synchronous execution is used to achieve parallel processing and ensure multiple slave nodes of each branch script node. Run synchronously and run the root script node followed by slave nodes in the serial path.
It improves operating efficiency and response speed, reduces memory, CPU and disk IO resource consumption, ensures stable execution in complex business scenarios, supports true parallel processing, avoids blocking waiting, responds quickly and releases resources.
Smart Images

Figure CN114385278B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a SOAR script running method, device, readable medium and server. Background Art
[0002] SOAR (Security Orchestration, Automation and Response) stands for security orchestration automation and response, and is considered to be a fusion of three technologies / tools: Security Orchestration and Automation (SOA), Security Incident Response Platform (SIRP) and Threat Intelligence Platform (TIP). Security orchestration refers to the process of combining the security capabilities of different customer systems or different components within a system through programmable interfaces API (Application Programming Interface) and manual detection points according to certain logical relationships to complete a specific security operation. The SOAR platform can flexibly orchestrate existing security capabilities, complete scenario construction by writing playbooks, and achieve automated operations.
[0003] Among them, the SOAR platform includes application nodes and virtual nodes corresponding to multiple application apps, and each application app includes a series of actions. The script is composed of a series of actions and virtual nodes, which includes a complete analysis and disposal process of security operations. However, in the current related technologies, when running the script process, each application node in each execution path in the script process is usually processed serially. For example, when the parallel running path includes two serial paths, four application nodes are located in two different hierarchies, and each two nodes form a serial path, it is usually necessary to execute the application nodes in the first serial path before the second serial path can be executed. As a result, in the process of executing a large number of scripts at the same time or in complex business scenarios, blocking will occur when executing multiple application node tasks, resulting in low script running efficiency and high execution failure rate. Summary of the invention
[0004] The present application provides a SOAR script running method, device, readable medium and server to solve the problem that when a large number of scripts are executed simultaneously or in complex business scenarios, there will be blocking when executing multiple application node tasks, resulting in low script running efficiency and high execution failure rate.
[0005] In the first aspect, the present application provides a SOAR script running method, which specifically includes the following steps:
[0006] Obtain a path running information set corresponding to a SOAR script, the path information set including multiple parallel running paths, wherein the parallel running paths include branch script nodes, subordinate script nodes, and aggregate script nodes, each branch script node corresponds to multiple subordinate script nodes, and multiple subordinate script nodes correspond to one aggregate script node; the branch script nodes, subordinate script nodes, and aggregate script nodes are used to execute preset tasks corresponding to the SOAR script;
[0007] Get the running order of all branch script nodes, subordinate script nodes and aggregate script nodes;
[0008] The branch script nodes, subordinate script nodes and aggregate script nodes are run in sequence according to the running order, wherein multiple subordinate script nodes at the same level corresponding to each branch script node are run synchronously.
[0009] Optionally, the path information set further includes a plurality of serial operation paths, the serial operation paths including a root script node and a subordinate script node, each root script node corresponding to a subordinate script node; the method further includes:
[0010] Get the running order of all root script nodes and subordinate script nodes;
[0011] The root script node and the subordinate script nodes are run in sequence according to the running order, wherein the root script node and the subordinate script node are located at different levels in the SOAR script.
[0012] Optionally, before obtaining the path running information set corresponding to the SOAR script, the method further includes:
[0013] Get SOAR script information, which includes a script node set;
[0014] The script node set is traversed forward and backward in sequence to obtain a node information set, wherein the node information set includes the preceding script node information and the succeeding script node information corresponding to each script node in the script node set.
[0015] Optionally, run the root script node and the subordinate script nodes in order, including:
[0016] Get the predecessor script node information corresponding to the subordinate script node;
[0017] Determine whether the preceding script node information meets the preset conditions, and if the preceding script node information meets the preset conditions, run the subordinate script node.
[0018] Optionally, also include:
[0019] If the node information of the preceding script does not meet the preset conditions, the SOAR script is terminated.
[0020] Optionally, also include:
[0021] Determine the branch script node as the initial script node, and the initial script node is the first script node in the SOAR script;
[0022] Get the initial script node and the input information of the initial script node;
[0023] Starts running the SOAR script based on the input information of the initial script node.
[0024] Optionally, also include:
[0025] The root script node is determined as the initial script node, and the initial script node is the first script node in the SOAR script;
[0026] Get the initial script node and the input information of the initial script node;
[0027] Starts running the SOAR script based on the input information of the initial script node.
[0028] In a second aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute a SOAR script running method when running.
[0029] In a third aspect, the present application provides an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute a SOAR script running method.
[0030] In a fourth aspect, the present application provides a server including a memory and a processor, wherein program instructions are stored in the memory, and the processor executes a SOAR script running method by running the program instructions.
[0031] It can be seen from the above technical scheme that the present application provides a SOAR script running method, device, readable medium and server, and the method specifically includes the following steps: obtaining a path running information set corresponding to the SOAR script, the path information set includes multiple parallel running paths, wherein the parallel running path includes a branch script node, a subordinate script node and an aggregated script node, each branch script node corresponds to multiple subordinate script nodes, and multiple subordinate script nodes correspond to an aggregated script node; the branch script node, the subordinate script node and the aggregated script node are used to execute the preset tasks corresponding to the SOAR script; obtain the running order corresponding to all branch script nodes, subordinate script nodes and aggregated script nodes; run the branch script node, the subordinate script node and the aggregated script node in sequence according to the running order, wherein the multiple subordinate script nodes corresponding to each branch script node at the same level are synchronously run. In order to solve the problem that blocking occurs when executing multiple application node tasks during the simultaneous execution of a large number of scripts or in complex business scenarios, resulting in low script running efficiency and high execution failure rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0033] Figure 1 A flowchart of a SOAR script running method provided according to some embodiments is shown;
[0034] Figure 2 A schematic diagram showing a first script including script nodes provided according to some embodiments;
[0035] Figure 3 A schematic diagram showing a second script including script nodes provided according to some embodiments. DETAILED DESCRIPTION
[0036] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0037] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0038] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0039] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0040] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0041] In the related art, when the SOAR script is automatically arranged and run, each application node in each execution path in the script process is usually processed serially. For example, when the parallel running path includes two serial paths, four application nodes are located in two different hierarchical orders, and every two nodes form a serial path, it is usually necessary to execute the application nodes in the first serial path before the second serial path can be executed. As a result, in the process of executing a large number of scripts at the same time or in complex business scenarios, blocking will occur when executing multiple application node tasks, resulting in low script running efficiency, unstable running process and high execution failure rate. There will also be problems with high occupied memory, CPU and disk IO resources. Especially in the parallel running path, it is not truly parallel execution.
[0042] This application provides a SOAR script running method. Figure 1 See the flowchart of the SOAR script operation method provided for this application. Figure 1 , specifically including the following steps:
[0043] S1: Obtain a path operation information set corresponding to a SOAR script, the path information set including multiple parallel operation paths, wherein the parallel operation paths include branch script nodes, subordinate script nodes, and aggregate script nodes, each branch script node corresponds to multiple subordinate script nodes, and multiple subordinate script nodes correspond to one aggregate script node; the branch script nodes, subordinate script nodes, and aggregate script nodes are used to execute preset tasks corresponding to the SOAR script;
[0044] S2: Get the running order of all branch script nodes, subordinate script nodes and aggregate script nodes;
[0045] S3: Run the branch script nodes, subordinate script nodes and aggregate script nodes in sequence according to the running order, wherein multiple subordinate script nodes at the same level corresponding to each branch script node run synchronously.
[0046] For example, Figure 2 A schematic diagram of a script node included in a script provided by this application. Figure 2 , the parallel running path includes branch script nodes, subordinate script nodes and aggregate script nodes. Each branch script node corresponds to multiple subordinate script nodes, and multiple subordinate script nodes correspond to one aggregate script node. In the figure, the start node is the branch script node, A1 and A2 are subordinate script nodes, and C2 and D1 are aggregate script nodes. Figure 2 In the script process, starting from the start node, two subordinate tasks are obtained, namely A1 and A2, and the nodes on the two paths corresponding to A1 and A2 are intersected until D1. At this time, two thread pools are used to run the script nodes on the A1 and A2 lines respectively and simultaneously, so that the execution efficiency is higher than the serial one in the related technology. In other words, the multiple subordinate script nodes corresponding to the branch script node are respectively run at the same time. Simultaneous operation, i.e. parallel processing, means that multiple serial paths in the parallel operation path are run simultaneously.
[0047] Similarly, after executing the A2 node, two subordinate script nodes B2 and B3 are obtained as subordinate tasks. These two subordinate script nodes will not intersect until the aggregate script node C2. At this time, two thread pools are used to run B2 and B3 respectively at the same time. After waiting for B2 and B3 to be executed, the thread pool itself is destroyed and the execution response data is saved to the cache. Then execute the subsequent C2. Furthermore, when executing the aggregate script node D1, it is necessary to wait for all the previous nodes to run and then close the thread pools of the two previously opened lines to release resources. After executing D1, two subordinate tasks are obtained, namely E1 and E2. There will be an intersection only when the End node ends, so the two thread pools are started again to run the script nodes on the two paths of E1 and E2 respectively. Through the above synchronous execution, the execution efficiency can be maximized and stably improved, and the execution response experience can be improved.
[0048] In some embodiments, the path information set further includes a plurality of serial operation paths, the serial operation paths including a root script node and a subordinate script node, each root script node corresponding to a subordinate script node. The method further includes: obtaining the operation order corresponding to all root script nodes and subordinate script nodes; and sequentially executing the root script nodes and the subordinate script nodes according to the operation order, wherein the root script nodes and the subordinate script nodes are located at different levels in the SOAR script.
[0049] For example, see Figure 2, the above-mentioned starting node, i.e., the branch script node, corresponds to two parallel running paths, and the subordinate script node A1 is a path in the parallel running path relative to the subordinate script node A2. However, starting from the execution of A1, only one subordinate task, i.e., B1, is obtained, and after executing B1, only one subordinate task, i.e., C1, is obtained. Furthermore, the script nodes A1, B1, and C1 form a serial running path. Script node A1 is the root script node, script node B1 is the subordinate script node of A1, and script node C1 is the subordinate script node of B1. In other words, each script node is in a different hierarchical order in the serial running path. Each script node needs to be run in sequence according to the running order, that is, it needs to be processed and run in series in the order from the root script node to the subordinate script node.
[0050] In some embodiments, the root script node and the subordinate script node are sequentially executed according to the execution order, including: obtaining the preceding script node information corresponding to the subordinate script node; determining whether the preceding script node information meets the preset conditions, and executing the subordinate script node if the preceding script node information meets the preset conditions. If the preceding script node information does not meet the preset conditions, the execution of the SOAR script is terminated.
[0051] For example, see Figure 2 , the script nodes A1, B1 and C1 form a serial running path. When running the current script node B1, it is necessary to obtain the information of the previous script node A1, that is, the execution information. Determine whether the previous script node A1 is running. Only when the previous script node A1 is executed can the current script node B1 be run. And so on, no further details are given here.
[0052] In some embodiments, before obtaining the path execution information set corresponding to the SOAR script, the method also includes: obtaining SOAR script information, the SOAR script information includes a script node set; traversing the script node set forward and backward in sequence to obtain a node information set, the node information set includes the preceding script node information and the succeeding script node information corresponding to each script node in the script node set.
[0053] Exemplarily, first obtain all the information of the target SOAR script, including the running order information of multiple script nodes. According to the running order information of each script node, forward traverse is performed in sequence from the start node in the SOAR script, that is, the post-script node information corresponding to each script node is obtained. Similarly, reverse traverse is performed in sequence from the end node in the SOAR script, that is, the pre-script node information corresponding to each script node is obtained. Then obtain each running path to implement the subsequent step of judging the pre-script node information.
[0054] In some embodiments, it also includes: determining the branch script node as the initial script node, the initial script node is the first script node in the SOAR script; obtaining the initial script node and input information of the initial script node; and starting to run the SOAR script according to the input information of the input initial script node.
[0055] In some embodiments, it also includes: determining the root script node as the initial script node, the initial script node is the first script node in the SOAR script; obtaining the initial script node and input information of the initial script node; and starting to run the SOAR script according to the input information of the input initial script node.
[0056] It should be noted that in a SOAR script, parallel processing is established on the basis of serial processing. When a fork appears in the serial processing, parallel processing will be performed. Similarly, parallel processing will also include serial processing. Therefore, parallel processing and serial processing are nested with each other. If the outermost layer is serial, the inner layer can be freely combined according to the actual business needs. For example, in parallel processing, subordinate script nodes belonging to the same level are processed synchronously. Furthermore, the initial script node can be a branch script node in the parallel operation path, and of course it can also be a root script node in the serial operation path. The same is true for the end script node, which will not be repeated here.
[0057] In some embodiments, see Figure 3 When parallel processing and serial processing are mutually nested, that is, when there are common script nodes in the parallel running path and the serial running path, the SOAR script running method proposed in this application performs the following processing, as follows:
[0058] (1) Run the root node first, and then run the application processing logic of the start node.
[0059] (2) It is subsequently discovered that there are slave script nodes, and slave script node A1 and slave script node A2 are simultaneously running the corresponding application processing logic.
[0060] (3) It is subsequently found that there are subordinate scenario nodes, and the subordinate scenario nodes B1 and B2 simultaneously run the corresponding application processing logic. The subordinate scenario node B3 runs the corresponding application processing logic.
[0061] (4) Subsequently, it is discovered that there is a subordinate script node, and the subordinate script node D1 runs the corresponding application processing logic.
[0062] (5) A subordinate script node, namely, the subordinate script node D2, is subsequently found. However, before the subordinate script node D2 runs the corresponding application processing logic, it is necessary to determine whether the preceding script node meets the preset conditions. Because the preceding script node of D2 includes C1 in addition to B2, the subordinate script node C1 must run the corresponding application processing logic before the subordinate script node D2 runs the corresponding application processing logic.
[0063] (6) Similarly, after the subordinate scenario node D2 runs the corresponding application processing logic, the subordinate scenario node E1 is run in the order of serial processing. After the subordinate scenario node E1 runs the corresponding application processing logic, the end node application processing logic is run to complete the scenario running.
[0064] In some embodiments, the script usually executes the script node, and usually calls the application executor to execute. If the script node is an application node, the application executor executes the application in the specific application node. Furthermore, when the script executes the node, the input object data includes but is not limited to the complete description information file object of the current application node, the currently selected action name and the specific parameter set information. For example: execute the Email application App. The execution input object data is the complete application structure system Yaml data object, the user selects the text action name Text to send, and the input recipient, subject and text content, etc. This application does not limit the specific implementation process of the script execution when each script node is executed. It can be set according to the actual situation, and will not be repeated here.
[0065] In some embodiments, the present application also provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute a SOAR script running method at runtime, which will not be described in detail here.
[0066] In some embodiments, the present application also provides an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the SOAR script running method, which will not be repeated here.
[0067] In some embodiments, the present application also provides a server including a memory and a processor, wherein program instructions are stored in the memory, and the processor executes the SOAR script running method by running the program instructions, which will not be repeated here.
[0068] It can be seen from the above embodiments that the present application provides a SOAR script running method, which specifically includes the following steps: S1: Obtain a path running information set corresponding to the SOAR script, the path information set including multiple parallel running paths, wherein the parallel running paths include branch script nodes, subordinate script nodes and aggregate script nodes, each branch script node corresponds to multiple subordinate script nodes, and multiple subordinate script nodes correspond to one aggregate script node; branch script nodes, subordinate script nodes and aggregate script nodes are used to execute preset tasks corresponding to SOAR scripts; S2: Obtain the running order corresponding to all branch script nodes, subordinate script nodes and aggregate script nodes; S3: Run branch script nodes, subordinate script nodes and aggregate script nodes in sequence according to the running order, wherein multiple subordinate script nodes corresponding to each branch script node run synchronously.
[0069] The SOAR script running method provided in this application has the following advantages: 1. High operating efficiency and fast execution response speed. If there is an exception, it will quickly return failure, and if the execution is successful, it will quickly return a response. 2. In the scenario where a large number of scripts are executed at the same time, the execution process is orderly and stable. Support complex business scenarios and support multi-node blocking and waiting. After the preceding node is completed, it will automatically execute backward. For example, when executing node D, it is necessary to execute node A, node B, and node C before it can be executed, but node B needs to execute the preceding node Z before it can be executed. At this time, the current node will be automatically blocked, the preceding node Z will be executed first, and then B or A or C will be executed in sequence, and finally D will be executed. 3. It has low memory, low CPU usage and low disk IO resource consumption. After the script is executed, it will respond quickly and self-destruct the execution process regardless of success or failure. It is convenient for subsequent script execution to obtain the memory, CPU, disk IO and other resources required for execution. It has an automatic destruction mechanism to release resources. 4. True parallel execution processing, without blocking and waiting one by one, and combined with complex business scenarios, it can be applied to more complex businesses to solve practical problems.
[0070] The same and similar parts between the various embodiments in this specification can be referenced to each other and will not be described again here.
[0071] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps of each embodiment of the method for expanding the display quantity of media resources provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0073] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A SOAR script running method, characterized in that: The specific steps include: Obtain a path operation information set corresponding to a SOAR script, wherein the path operation information set includes multiple parallel operation paths, wherein the parallel operation paths include branch script nodes, subordinate script nodes, and aggregate script nodes, each of the branch script nodes corresponds to multiple subordinate script nodes, and multiple subordinate script nodes correspond to one aggregate script node; the branch script nodes, subordinate script nodes, and aggregate script nodes are used to execute preset tasks corresponding to the SOAR script; Obtain the corresponding running order of all the branch script nodes, subordinate script nodes and aggregate script nodes; The branch script node, the subordinate script node and the aggregate script node are sequentially run according to the running order, wherein the multiple subordinate script nodes corresponding to each branch script node and located at the same level are synchronously run, and after the multiple subordinate script nodes located at the same level are synchronously run, the thread pools of the multiple subordinate script nodes are destroyed, and the response data is saved to the cache; when the aggregate script node is run, all the preceding subordinate script nodes of the aggregate script node have finished running; if the aggregate script node includes a first preceding subordinate script node and a second preceding subordinate script node, and the second preceding subordinate script node includes a third preceding subordinate script node, the third preceding subordinate script node is run first, and then the first preceding subordinate script node and the second preceding subordinate script node are run, and when the first preceding subordinate script node and the second preceding subordinate script node are finished running, the aggregate script node is run.
2. The method according to claim 1, characterized in that The path operation information set also includes a plurality of serial operation paths, the serial operation paths include a root script node and the subordinate script nodes, and each of the root script nodes corresponds to one subordinate script node; The method further comprises: Obtain the running order corresponding to all the root script nodes and the subordinate script nodes; The root script node and the subordinate script node are sequentially executed according to the execution order, wherein the root script node and the subordinate script node are located at different levels in the SOAR script.
3. The method according to claim 2, characterized in that Before obtaining the path operation information set corresponding to the SOAR script, the method further includes: Obtaining SOAR script information, wherein the SOAR script information includes a script node set; The script node set is traversed forward and backward in sequence to obtain a node information set, wherein the node information set includes the preceding script node information and the succeeding script node information corresponding to each script node in the script node set.
4. The method according to claim 3, characterized in that The step of sequentially running the root script node and the subordinate script node according to the running order includes: Obtain the preceding script node information corresponding to the subordinate script node; Determine whether the preceding script node information meets the preset conditions, and if the preceding script node information meets the preset conditions, run the subordinate script node.
5. The method according to claim 4, characterized in that Also includes: When the preceding script node information does not meet the preset conditions, the SOAR script is terminated.
6. The method according to claim 1, characterized in that Also includes: Determine the branch script node as an initial script node, the initial script node being the first script node in the SOAR script; Obtaining the initial script node and input information of the initial script node; The SOAR script starts running according to the input information of the initial script node.
7. The method according to claim 2, characterized in that Also includes: Determine the root script node as the initial script node, the initial script node being the first script node in the SOAR script; Obtaining the initial script node and input information of the initial script node; The SOAR script starts running according to the input information of the initial script node.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
9. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
10. A server comprising a memory and a processor, wherein the memory stores program instructions, and the processor executes the method according to any one of claims 1 to 7 by running the program instructions.
