Universal firewall policy execution method, apparatus and device, and storage medium
Through automated firewall policy execution methods, configuring and executing firewall policies is solved, and the problem of manual configuration is time-consuming and labor-intensive and error-prone, achieving more efficient and secure firewall policy management.
Patent Information
- Application Number
- CN202411700619.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-07
Smart Images

Figure CN119583156A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of firewalls, and in particular to a general firewall policy execution method, device, equipment and storage medium. Background Art
[0002] A firewall is a combination of software and hardware information security device that can control access to data packets passing through it by configuring firewall policies, thereby ensuring the security of the internal network. Currently, firewall policies are usually manually configured and updated by professional network operation and maintenance personnel, which is time-consuming and labor-intensive. Manual configuration may also lead to configuration errors, security risks, and business interruptions. Summary of the invention
[0003] The embodiments of the present application provide a general firewall policy execution method, apparatus, device and storage medium to solve at least one problem existing in the related art. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a general method for executing a firewall policy, including:
[0005] In response to the configuration instruction, configuring at least one firewall policy template;
[0006] Splitting at least one of the firewall policy templates to obtain at least one corresponding command set;
[0007] Acquire business requirement information, and determine a firewall device, a target firewall policy template, and a target command set according to the business requirement information and at least one of the command sets;
[0008] The target command set is sent to the firewall device for execution to obtain a firewall policy execution result.
[0009] In one embodiment, configuring at least one firewall policy template in response to the configuration instruction includes:
[0010] In response to the configuration instruction, configuring at least one firewall policy, command style, and dynamic parameter based on the firewall model of the firewall device;
[0011] At least one firewall policy template is obtained according to the firewall policy, the command style and the dynamic parameter.
[0012] In one implementation, the splitting of at least one firewall policy template to obtain the corresponding at least one command set includes:
[0013] According to the command style and the dynamic parameters of at least one firewall policy, splitting the at least one firewall policy template to obtain corresponding query commands, execution commands and rollback commands;
[0014] At least one corresponding command set is obtained according to the query command, the execution command and the rollback command, wherein the query command, the execution command and the rollback command include the dynamic parameter.
[0015] In one embodiment, determining a firewall device, a target firewall policy template, and a target command set according to the service requirement information and at least one of the command sets includes:
[0016] Determine the firewall device to be deployed according to the business demand information, determine a target firewall policy template from at least one of the firewall policy templates, a command set corresponding to the target firewall policy template, and a target parameter value corresponding to a dynamic parameter of the command set;
[0017] The target parameter value is mapped to the dynamic parameter of the command set to obtain the target command set.
[0018] In one implementation, sending the target command set to the firewall device for execution to obtain a firewall policy execution result includes:
[0019] Send the target command set to the firewall device to implement the SSH connection of the firewall through the JSch library, execute the query command in the target command set, and determine the query result;
[0020] According to the query result, executing the execution command in the target command set to obtain the execution result;
[0021] According to the execution result, executing the rollback command in the target command set to obtain a rollback result;
[0022] The firewall policy execution result includes one or more of the query result, the execution result and the rollback result.
[0023] In one implementation, executing the query command in the target command set and determining the query result includes:
[0024] Check whether the execution command in the target command set exists in the firewall;
[0025] If it exists, determine the prompt information, and display the prompt information as the query result;
[0026] If it does not exist, determine that the query result is not configured; when the query result is not configured, execute the execution command in the target command set.
[0027] In one implementation, executing the rollback command in the target command set according to the execution result to obtain the rollback result includes:
[0028] When there is an error in the execution result, executing the rollback command in the target command set;
[0029] Read all successfully executed execution subcommands and the corresponding execution order; the execution command includes a plurality of execution subcommands, and the rollback command includes a rollback subcommand corresponding to each of the execution subcommands;
[0030] The execution order is arranged in reverse order, and the rollback subcommands corresponding to all the corresponding execution subcommands in the reverse order are executed in sequence to obtain a rollback result.
[0031] In a second aspect, an embodiment of the present application provides a general firewall policy execution device, including:
[0032] A configuration module, configured to configure at least one firewall policy template in response to a configuration instruction;
[0033] A splitting module, used for splitting at least one of the firewall policy templates to obtain at least one corresponding command set;
[0034] A determination module, used to obtain business demand information, and determine a firewall device, a target firewall policy template, and a target command set according to the business demand information and at least one of the command sets;
[0035] The execution module is used to send the target command set to the firewall device for execution to obtain the firewall policy execution result.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.
[0038] The beneficial effects of the above technical solution include at least:
[0039] By responding to configuration instructions, configuring at least one firewall policy template, splitting at least one firewall policy template, obtaining at least one corresponding command set, obtaining business demand information, automatically determining the firewall device, the target firewall policy template and the target command set according to the business demand information and at least one command set, sending the target command set to the firewall device for execution, and obtaining the firewall policy execution result, the error risk of completely manual configuration is reduced to a certain extent, and the execution mode of splitting the firewall policy template into command sets is conducive to reducing the execution complexity of the firewall policy, and the execution is based on the form of splitting into command sets, which has universality.
[0040] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0042] Figure 1 A flowchart showing the steps of a firewall policy execution method generally used in an embodiment of the present application;
[0043] Figure 2 This is a structural block diagram of a general firewall policy execution device according to an embodiment of the present application;
[0044] Figure 3 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0045] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0046] In the related technologies, in order to configure firewall security policies efficiently and quickly, many companies currently think of firewall security policy configuration automation technology. However, developing automated programs specifically for different security policies will consume a lot of development costs, and R&D personnel lack professional knowledge in networks, which leads to reduced R&D efficiency, extended R&D cycles, and increased R&D costs. Although automated configuration technology can improve the configuration efficiency of firewall policies, once configuration errors occur or errors occur during the configuration process, it may affect the normal operation of the network, affect the normal use of the business, and cause certain security risks. Therefore, how to quickly and efficiently develop automated policies and how to ensure the safe and reliable execution of security policies are the problems to be solved in this application.
[0047] Reference Figure 1 , a flowchart of a general firewall policy execution method according to an embodiment of the present application is shown, and the general firewall policy execution method may at least include steps S100-S400:
[0048] S100. In response to a configuration instruction, configure at least one firewall policy template.
[0049] S200: Split at least one firewall policy template to obtain at least one corresponding command set.
[0050] S300: Obtain business demand information, and determine a firewall device, a target firewall policy template, and a target command set according to the business demand information and at least one command set.
[0051] S400: Send the target command set to the firewall device for execution, and obtain the firewall policy execution result.
[0052] The technical solution of the embodiment of the present application configures at least one firewall policy template in response to a configuration instruction, splits at least one firewall policy template to obtain at least one corresponding command set, obtains business demand information, and automatically determines the firewall device, the target firewall policy template and the target command set according to the business demand information and the at least one command set, sends the target command set to the firewall device for execution, and obtains the firewall policy execution result, thereby reducing the error risk of completely manual configuration to a certain extent, and splitting the firewall policy template into an execution mode of a command set is conducive to reducing the execution complexity of the firewall policy, and is executed based on the splitting into command sets, which has universality.
[0053] It should be noted that the various instructions involved in the present application can be generated based on keyboard, mouse, touch and other operations without specific limitation; the method of the embodiment of the present application can be executed by a terminal or a server, and the server is used as an example for explanation.
[0054] In one embodiment, step S100 includes steps S110-S120:
[0055] S110. In response to the configuration instruction, configure at least one firewall policy, command style, and dynamic parameter based on the firewall model of the firewall device.
[0056] S120. Obtain at least one firewall policy template according to the firewall policy, command style, and dynamic parameters.
[0057] Optionally, the terminal or server responds to the configuration instruction, and can configure a corresponding firewall policy for each firewall model based on actual needs and according to the firewall models of different firewall devices, and configure the command style and dynamic parameters of each firewall policy. For example, taking the firewall model H3CM9010 as an example, the command for configuring an address object of 172.40.9.219 is: Network host address 172.40.9.219, at this time the command style is Network host address$, $ is a dynamic parameter, and the address parameter is dynamically mapped to the dynamic parameter according to subsequent specific business needs to generate a specific instruction.
[0058] Therefore, after configuring the firewall policy, all command styles and dynamic parameters, a firewall policy template can be correspondingly determined based on each firewall policy, command style and dynamic parameter, and finally at least one firewall policy template is obtained.
[0059] In one implementation, step S200 includes steps S210-S220:
[0060] S210: Split at least one firewall policy template according to the command style and dynamic parameters of at least one firewall policy to obtain corresponding query commands, execution commands, and rollback commands.
[0061] Optionally, for each firewall policy template, the firewall policy of the firewall policy template is split based on the command style and dynamic parameters of the firewall policy template, and the firewall policy is split into commands, including query commands, execution commands and rollback commands; in the query commands, execution commands and rollback commands, the command style is used as the expression form and dynamic parameters are included.
[0062] S220. Obtain at least one corresponding command set according to the query command, the execution command, and the rollback command.
[0063] Optionally, the split query command, execution command and rollback command corresponding to each firewall policy template constitute a command set corresponding to each firewall policy template, so at least one corresponding command set can be obtained based on at least one firewall policy template.
[0064] In one implementation, when it is determined that a firewall device actually needs to be deployed, business requirement information is input into the system for the system to obtain business requirement information, which includes but is not limited to business parameters such as source address, source port, destination address, and destination port.
[0065] In one implementation, step S300 includes steps S310-S320:
[0066] S310. Determine the firewall device to be deployed according to the business demand information, determine a target firewall policy template from at least one firewall policy template, a command set corresponding to the target firewall policy template, and a target parameter value corresponding to a dynamic parameter of the command set.
[0067] In one embodiment, based on the business parameters in the business demand information, the system can determine the firewall device that needs to be deployed and its address, and then based on the firewall model of the firewall device, it can determine the target firewall policy template from at least one firewall policy template, the command set corresponding to the target firewall policy template, and the target parameter value corresponding to the dynamic parameter of the command set, the target parameter value being the content that can be filled in the dynamic parameter position in the business demand information.
[0068] S320: Map the target parameter value to the dynamic parameter of the command set to obtain the target command set.
[0069] Specifically, the target parameter value is mapped to the dynamic parameter of the command set, and the command set at this time is determined as the final target command set.
[0070] In one implementation, the firewall policy execution result includes one or more of a query result, an execution result, and a rollback result. Step S400 includes steps S410-S430:
[0071] S410, sending the target command set to the firewall device to implement the SSH connection of the firewall through the JSch library, executing the query command in the target command set, and determining the query result.
[0072] Optionally, the system sends the target command set to the firewall device, and implements the SSH connection of the firewall through the JSch library, that is, remotely logs in to the firewall based on SSH, thereby simulating the control of the firewall to execute the query command in the target command set and determine the query result. It should be noted that the JSch library is a library for implementing SSH connection on the Java platform, providing a Java-implemented SSH2 protocol client, which can be used for SSH connection, file transfer, remote command execution and other operations in Java applications.
[0073] In the embodiment of the present application, executing the query command in the target command set and determining the query result includes:
[0074] First, check whether the execution command in the target command set exists in the firewall. For example, in some cases, the firewall may have been configured with firewall policies before, so the execution command exists. Therefore, if it exists, determine the prompt information, display the prompt information as the query result, inform the user that it has been configured and does not need to be configured again, or prompt the user to change the policy and re-initiate; if it does not exist, determine that the query result is not configured. When the query result is not configured, continue to execute the execution command in the target command set.
[0075] S420. Execute the execution command in the target command set according to the query result to obtain the execution result.
[0076] Specifically, when the query result is not configured, the execution command in the target command set continues to be executed. The execution command may include several execution subcommands executed in sequence, such as execution subcommands A, B, C, D, and the execution order is A→B→C→D.
[0077] S430. Execute the rollback command in the target command set according to the execution result to obtain a rollback result.
[0078] Optionally, S430 includes steps S4301-S4302:
[0079] S4301. When there is an error in the execution result, execute the rollback command in the target command set.
[0080] Optionally, when there is an error in the execution result, it means that an error occurs when at least one execution subcommand is executed, and in this case, a rollback command in the target command set needs to be executed.
[0081] S4302. Read all successfully executed execution subcommands and the corresponding execution order, arrange the execution order in reverse order, and execute the rollback subcommands corresponding to all corresponding execution subcommands in the reverse order in sequence to obtain a rollback result.
[0082] Optionally, the fallback command includes a fallback subcommand corresponding to each execution subcommand, for example, including four fallback subcommands corresponding to execution subcommands A, B, C, and D. Wherein, when the fallback command needs to be executed, all successfully executed execution subcommands and the execution order of all execution subcommands are read, marked, and then the execution order is arranged in reverse order. For example, the execution order is A→B→C→D. Assuming that when executing subcommands A, B, C, and D, A, B, and C are executed successfully, while D fails to be executed. At this time, all successfully executed execution subcommands and the corresponding execution order are A, B, and C. Then, the execution order is arranged in reverse order to obtain C, B, and A, and the fallback subcommands corresponding to all corresponding execution subcommands after the reverse order are executed in sequence, that is, the fallback subcommand of C, the fallback subcommand of B, and the fallback subcommand of A are executed in sequence, and finally the fallback result is obtained. The embodiment of the present application automatically returns to the state before the policy configuration begins when an execution error occurs, ensuring that the firewall will not be unable to recover due to an error, resulting in partial configuration being retained on the firewall or affecting subsequent policy configurations. In addition, manual intervention is avoided, reliability is improved, and real-time performance is guaranteed.
[0083] In the embodiments of the present application, compared with the traditional manual configuration method and the existing automated configuration technology, the firewall policy template can be configured by the operation and maintenance personnel without the participation of developers, which effectively solves the problem of unclear responsibilities between the operation and maintenance personnel and the R&D personnel and the lack of professional network skills of the R&D personnel. In addition, general inspection, execution and rollback methods are provided for policy-related commands. Pre-execution inspection and error rollback can be performed during the execution process. When developing applications, the R&D personnel do not need to pay attention to the specific commands being run, and the policy execution process can be judged according to the results of the command execution. Compared with the current mode of executing related commands for specific policies, the complexity of firewall policy execution is greatly reduced. Therefore, it can not only improve the efficiency of newly launched policies for different businesses, but also ensure the safe and reliable execution of the execution policy. In addition, the present application is simple and convenient to implement, easy to popularize and promote, different firewall policy templates can be planned for different business needs, and similar business needs can share a firewall policy template, and the number of commands can also be set based on actual needs.
[0084] Reference Figure 2 , shows a structural block diagram of a general firewall policy execution device according to an embodiment of the present application, and the device may include:
[0085] A configuration module, configured to configure at least one firewall policy template in response to a configuration instruction;
[0086] A splitting module, used for splitting at least one firewall policy template to obtain at least one corresponding command set;
[0087] A determination module, used to obtain business demand information, and determine a firewall device, a target firewall policy template, and a target command set based on the business demand information and at least one command set;
[0088] The execution module is used to send the target command set to the firewall device for execution and obtain the firewall policy execution result.
[0089] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.
[0090] Reference Figure 3 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the general firewall policy execution method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.
[0091] In one embodiment, the electronic device also includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 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.
[0092] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.
[0093] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the general firewall policy execution method provided in the above embodiment.
[0094] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0095] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0096] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.
[0097] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).
[0098] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0099] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0100] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0101] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0102] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0103] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0104] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0105] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A general firewall policy execution method, characterized in that: include: In response to the configuration instruction, configuring at least one firewall policy template; Splitting at least one of the firewall policy templates to obtain at least one corresponding command set; Acquire business requirement information, and determine a firewall device, a target firewall policy template, and a target command set according to the business requirement information and at least one of the command sets; The target command set is sent to the firewall device for execution to obtain a firewall policy execution result.
2. The general firewall policy execution method according to claim 1, characterized in that: The configuring at least one firewall policy template in response to the configuration instruction includes: In response to the configuration instruction, configuring at least one firewall policy, command style, and dynamic parameter based on the firewall model of the firewall device; At least one firewall policy template is obtained according to the firewall policy, the command style and the dynamic parameter.
3. The general firewall policy execution method according to claim 2, characterized in that: The splitting of at least one firewall policy template to obtain at least one corresponding command set includes: According to the command style and the dynamic parameters of at least one firewall policy, splitting the at least one firewall policy template to obtain corresponding query commands, execution commands and rollback commands; At least one corresponding command set is obtained according to the query command, the execution command and the rollback command, wherein the query command, the execution command and the rollback command include the dynamic parameter.
4. The general firewall policy execution method according to claim 3, characterized in that: The determining of the firewall device, the target firewall policy template, and the target command set according to the business requirement information and at least one of the command sets includes: Determine the firewall device to be deployed according to the business demand information, determine a target firewall policy template from at least one of the firewall policy templates, a command set corresponding to the target firewall policy template, and a target parameter value corresponding to a dynamic parameter of the command set; The target parameter value is mapped to the dynamic parameter of the command set to obtain the target command set.
5. The general firewall policy execution method according to claim 3 or 4, characterized in that: The step of sending the target command set to the firewall device for execution to obtain the firewall policy execution result comprises: Send the target command set to the firewall device to implement the SSH connection of the firewall through the JSch library, execute the query command in the target command set, and determine the query result; According to the query result, executing the execution command in the target command set to obtain the execution result; According to the execution result, executing the rollback command in the target command set to obtain a rollback result; The firewall policy execution result includes one or more of the query result, the execution result and the rollback result.
6. The general firewall policy execution method according to claim 5, characterized in that: The executing the query command in the target command set and determining the query result comprises: Check whether the execution command in the target command set exists in the firewall; If it exists, determine the prompt information, and display the prompt information as the query result; If it does not exist, determine that the query result is not configured; when the query result is not configured, execute the execution command in the target command set.
7. The general firewall policy execution method according to claim 5, characterized in that: The executing the rollback command in the target command set according to the execution result to obtain the rollback result includes: When there is an error in the execution result, executing the rollback command in the target command set; Read all successfully executed execution subcommands and the corresponding execution order; the execution command includes a plurality of execution subcommands, and the rollback command includes a rollback subcommand corresponding to each of the execution subcommands; The execution order is arranged in reverse order, and the rollback subcommands corresponding to all the corresponding execution subcommands in the reverse order are executed in sequence to obtain a rollback result.
8. A general firewall policy execution device, characterized in that: include: A configuration module, configured to configure at least one firewall policy template in response to a configuration instruction; A splitting module, used for splitting at least one of the firewall policy templates to obtain at least one corresponding command set; A determination module, used to obtain business demand information, and determine a firewall device, a target firewall policy template, and a target command set according to the business demand information and at least one of the command sets; The execution module is used to send the target command set to the firewall device for execution to obtain the firewall policy execution result.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.
