WebLogic T3 filter configuration method and device

By obtaining Weblogic service information and generating configuration rules, Weblogic T3 filter configuration is automatically completed, which solves the problems of cumbersome and inefficient existing configuration methods, realizes the standardization and efficient configuration of T3 filters, and improves the efficiency of security risk rectification. Timeliness.

CN114143192BActive Publication Date: 2024-10-25CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111470169.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2024-10-25
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The existing Weblogic T3 filter configuration method is cumbersome and inefficient, making it difficult to complete within a limited time. Especially in the face of a large workload, security risk rectification cannot be ensured in a timely manner.

Method used

By obtaining the Weblogic service information of the AdminServer process, determine the target IP address and execute the preset rule generation script to generate configuration rules. Combined with the WLST script, the T3 filter configuration is automatically completed to achieve standardization and standardization of the configuration.

Benefits of technology

Encapsulating complex T3 filter configurations into one-click universal scripts reduces manual intervention and improves configuration efficiency, which can better meet the timeliness requirements of security risk rectification and achieve automation and standardization of configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114143192B_ABST
    Figure CN114143192B_ABST
Patent Text Reader

Abstract

The present invention provides a configuration method and device for a WebLogic T3 filter, comprising: when an AdminServer process exists on any server in a WebLogic domain, obtaining WebLogic service information corresponding to the AdminServer process, and determining each target IP address based on the WebLogic service information, and executing a pre-set rule generation script to generate a configuration rule corresponding to each target IP address; setting a filter name in a pre-set WLST script and adding each configuration rule to obtain a WLST configuration script; executing the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain. By using this method, the T3 filter configuration can be automatically completed, and the T3 filter configuration operation can be normalized and standardized, thereby improving the implementation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information processing, and in particular to a configuration method and device for a WebLogic T3 filter. Background Art

[0002] WebLogic is an enterprise-level Java EE application server platform (middleware) that fully supports the J2EE standard and is one of the mainstream J2EE servers in the commercial market. T3, also known as rich sockets, is a BEA internal protocol that can be used to transmit information between WebLogic servers and other types of Java programs. Since WebLogic has the T3 protocol enabled by default, the risk of WebLogic deserialization vulnerabilities frequently occurs. Attackers use the T3 protocol to remotely execute deserialization code to trigger the vulnerability, threatening data security. To prevent this risk, it is necessary to configure a T3 access filter on WebLogic to only allow specific IPs or ports to access the WebLogic domain through the T3 protocol, thereby mitigating the risk of the vulnerability being exploited.

[0003] The existing WebLogic T3 filter configuration method requires manual sorting out of the server IP address list allowed to be accessed through the T3 protocol, and then logging in to the WebLogic console to configure the T3 filter and add configuration policies one by one. The operation process is not standardized, the steps are cumbersome, and the implementation efficiency is low. When the workload increases, it is difficult to ensure that it can be completed in a limited time. Summary of the invention

[0004] In view of this, the present invention provides a configuration method for a WebLogic T3 filter. Through this method, the T3 filter configuration can be automatically completed, the T3 filter configuration operation can be normalized and standardized, and the implementation efficiency can be improved.

[0005] The present invention also provides a configuration device for a WebLogic T3 filter to ensure the implementation and application of the above method in practice.

[0006] A method for configuring a WebLogic T3 filter, comprising:

[0007] When any server in the WebLogic domain has an AdminServer process, obtain the WebLogic service information corresponding to the AdminServer process;

[0008] Based on the WebLogic service information, determine each target IP address, and execute a preset rule generation script to generate a configuration rule corresponding to each target IP address;

[0009] Setting the filter name in a preset WLST script and adding each of the configuration rules to obtain a WLST configuration script;

[0010] Execute the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain.

[0011] In the above method, optionally, obtaining the WebLogic service information corresponding to the AdminServer process includes:

[0012] Determine the WebLogic domain path corresponding to the AdminServer process;

[0013] According to the WebLogic domain path, obtain the configuration file corresponding to the WebLogic domain;

[0014] The WebLogic service information corresponding to the AdminServer process is obtained based on the configuration file.

[0015] The above method may optionally further include:

[0016] If each of the configuration rules exists in the connection filter rule item in the configuration file, the T3 filter configured in the WebLogic domain takes effect.

[0017] In the above method, optionally, the target IP address includes: a production IP address, a managed IP address, a first IP address, and a second IP address; the rule generation script includes a first rule generation script and a second rule generation script; the configuration rule includes a first configuration rule and a second configuration rule;

[0018] Determining each target IP address based on the WebLogic service information, and executing a preset rule generation script to generate a configuration rule corresponding to each target IP address includes:

[0019] Obtain the IP address of each server in the WebLogic service information, where the IP address of each server is the production IP address;

[0020] Determine the managed IP address corresponding to each of the production IP addresses according to a preset mapping rule;

[0021] According to the WebLogic service information, obtain a preset first IP address and a second IP address;

[0022] Based on the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address, executing the first rule generation script to generate a first configuration rule, wherein the first configuration rule stipulates that the server where the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address are located can access the WebLogic domain through the T3 protocol;

[0023] Based on the second IP address, the second rule generation script is executed to generate a second configuration rule, wherein the second configuration rule stipulates that the server where the second IP address is located cannot access the WebLogic domain through the T3 protocol.

[0024] The above method may optionally further include:

[0025] Clearing each of the configuration rules in the WLST configuration script to obtain a WLST rollback script;

[0026] The WLST rollback script is executed on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain.

[0027] A configuration device for a WebLogic T3 filter, comprising:

[0028] An acquisition unit, used for acquiring WebLogic service information corresponding to an AdminServer process when an AdminServer process exists on any server in a WebLogic domain;

[0029] A determination unit, configured to determine each target IP address based on the WebLogic service information, and execute a preset rule generation script to generate a configuration rule corresponding to each target IP address;

[0030] A setting unit, used for setting a filter name in a preset WLST script and adding each of the configuration rules to obtain a WLST configuration script;

[0031] The execution unit is used to execute the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain.

[0032] In the above device, optionally, the acquisition unit includes:

[0033] A first determining subunit is used to determine the WebLogic domain path corresponding to the AdminServer process;

[0034] A first acquisition subunit is used to acquire a configuration file corresponding to the WebLogic domain according to the WebLogic domain path;

[0035] The second acquisition subunit is used to acquire the WebLogic service information corresponding to the AdminServer process based on the configuration file.

[0036] The above device may optionally further include:

[0037] The checking unit is used for, if each of the configuration rules exists in the connection filter rule item in the configuration file, then the T3 filter configured in the WebLogic domain takes effect.

[0038] In the above device, optionally, the target IP address includes: a production IP address, a managed IP address, a first IP address, and a second IP address; the rule generation script includes a first rule generation script and a second rule generation script; the configuration rule includes a first configuration rule and a second configuration rule; and the determination unit includes:

[0039] The third acquisition subunit is used to acquire the IP address of each server in the WebLogic service information, and the IP address of each server is the production IP address;

[0040] A second determination subunit is used to determine the management IP address corresponding to each of the production IP addresses according to a preset mapping rule;

[0041] A fourth acquisition subunit, configured to acquire a preset first IP address and a second IP address according to the WebLogic service information;

[0042] A first generating subunit is used to execute the first rule generating script based on the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address to generate a first configuration rule, wherein the first configuration rule stipulates that the server where the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address are located can access the WebLogic domain through the T3 protocol;

[0043] The second generating subunit is used to execute the second rule generating script based on the second IP address to generate a second configuration rule, wherein the second configuration rule stipulates that the server where the second IP address is located cannot access the WebLogic domain through the T3 protocol.

[0044] The above device may optionally further include:

[0045] A clearing unit, configured to clear each of the configuration rules in the WLST configuration script to obtain a WLST rollback script;

[0046] The rollback unit is used to execute the WLST rollback script on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain.

[0047] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the configuration method of the WebLogic T3 filter.

[0048] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to configure the WebLogic T3 filter.

[0049] Compared with the prior art, the present invention has the following advantages:

[0050] Based on the embodiment provided by the invention, during the configuration process of the Weblogic T3 filter, when an AdminServer process exists on any server in the Weblogic domain, the Weblogic service information corresponding to the AdminServer process is obtained, and based on the Weblogic service information, each target IP address is determined, and a pre-set rule generation script is executed to generate a configuration rule corresponding to each target IP address; the filter name is set in a pre-set WLST script and each configuration rule is added to obtain a WLST configuration script; and the WLST configuration script is executed on the server where the AdminServer process is located to complete the configuration of the T3 filter in the Weblogic domain.

[0051] By using the configuration method of the WebLogic T3 filter provided by the present invention, the complex operations of the WebLogic T3 filter configuration can be encapsulated into a one-click universal script, thereby realizing the normalization and standardization of the T3 filter configuration operation. By executing the script, the T3 filter configuration is automatically completed, manual intervention is reduced, the configuration implementation efficiency of the T3 filter is improved, and the timeliness requirements of the security risk rectification can be better met. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0053] Figure 1 A method flow chart of a WebLogic T3 filter configuration method provided by an embodiment of the present invention;

[0054] Figure 2 Another method flow chart of a method for configuring a WebLogic T3 filter provided by an embodiment of the present invention;

[0055] Figure 3 A flowchart of another method for configuring a WebLogic T3 filter provided by an embodiment of the present invention;

[0056] Figure 4 Another method flow chart of a method for configuring a WebLogic T3 filter provided by an embodiment of the present invention;

[0057] Figure 5 A device structure diagram of a WebLogic T3 filter configuration device provided by an embodiment of the present invention;

[0058] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0061] The present invention can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc.

[0062] Some of the professional terms involved in the present invention are as follows:

[0063] AdminServer: Administration Server, or AS for short, is a server instance that performs management duties in a WebLogic domain. It is the central control point of the domain, stores the configuration information and logs of the domain, and runs the WebLogic management console.

[0064] WLST: WebLogic Scripting Tool is a command-line scripting interface. The scripting environment is based on the Java script interpreter (Jython). System administrators use it to monitor and manage WebLogic Server instances and domains.

[0065] The embodiment of the present invention provides a method for configuring a WebLogic T3 filter. The method can be applied to a variety of system platforms. The execution subject can be a computer terminal or a processor of various mobile devices. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:

[0066] S101: When an AdminServer process exists on any server in the WebLogic domain, WebLogic service information corresponding to the AdminServer process is obtained.

[0067] In the embodiment provided by the present invention, the T3 filter configuration is only executed on the server where the AdminServer is located, and does not need to be executed on other non-AdminServer machines. Therefore, it is necessary to check whether the WebLogic AdminServer process on the server exists. If it does not exist, the execution is exited. If it exists, the WebLogic service information corresponding to the AdminServer process is obtained. The WebLogic service information mainly includes the IP addresses of each server in the WebLogic domain.

[0068] S102: Based on the WebLogic service information, determine each target IP address, and execute a preset rule generation script to generate a configuration rule corresponding to each target IP address.

[0069] In the embodiment provided by the present invention, all servers in the domain (WebLogic Domain) must be configured with allow rules, that is, the rules for allowing access to the WebLogic domain through the T3 protocol, including production IP addresses and managed IP addresses. According to the WebLogic service information, the IP addresses of the servers that are allowed to access the WebLogic domain through the T3 protocol are obtained, these addresses are determined as target IP addresses, and the configuration rules corresponding to each target IP address are generated according to each target IP address using the pre-set rule script.

[0070] S103: Setting the filter name in a preset WLST script and adding each of the configuration rules to obtain a WLST configuration script.

[0071] The embodiment provided by the present invention needs to connect to the WebLogic domain through the WebLogic WLST command, set the T3 filter name in the pre-set WLST script, and add the configuration rules obtained in S102, that is, the configuration rules corresponding to each of the target IP addresses, to obtain the WLST configuration script.

[0072] The details are as follows:

[0073]

[0074] S104: Execute the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain.

[0075] In the embodiment provided by the present invention, a WLST configuration script is executed on the server where AdminServe is located to connect the servers where each target IP address is located to the WebLogic domain where the AdminServe server is located, so that the servers corresponding to each target IP address can access the WebLogic domain through the T3 protocol, thereby completing the configuration of the T3 filter in the WebLogic domain.

[0076] Based on the embodiment provided by the invention, during the configuration process of the Weblogic T3 filter, when an AdminServer process exists on any server in the Weblogic domain, the Weblogic service information corresponding to the AdminServer process is obtained, and based on the Weblogic service information, each target IP address is determined, and a pre-set rule generation script is executed to generate a configuration rule corresponding to each target IP address; the filter name is set in a pre-set WLST script and each configuration rule is added to obtain a WLST configuration script; and the WLST configuration script is executed on the server where the AdminServer process is located to complete the configuration of the T3 filter in the Weblogic domain.

[0077] By using the configuration method of the WebLogic T3 filter provided by the present invention, the complex operations of the WebLogic T3 filter configuration can be encapsulated into a one-click universal script, thereby realizing the normalization and standardization of the T3 filter configuration operation. By executing the script, the T3 filter configuration is automatically completed, manual intervention is reduced, the configuration implementation efficiency of the T3 filter is improved, and the timeliness requirements of the security risk rectification can be better met.

[0078] In the embodiment of the present invention, Figure 2 As shown, optionally, obtaining the WebLogic service information corresponding to the AdminServer process includes:

[0079] S201: Determine the WebLogic domain path corresponding to the AdminServer process.

[0080] S202: Acquire a configuration file corresponding to the WebLogic domain according to the WebLogic domain path.

[0081] S203: Acquire WebLogic service information corresponding to the AdminServer process based on the configuration file.

[0082] The WebLogic domain path is obtained according to the AdminServer process, and the configuration file corresponding to the WebLogic domain is obtained according to the WebLogic domain path. The WebLogic service information corresponding to the AdminServer process can be obtained by parsing the configuration file. The specific process involves the following code:

[0083] v_pid=$(ps-fu${USER}|grep-w"java"|grep"AdminServer"|grep-Evw"grep"|awk'{print$2}')

[0084] #Get the WebLogic Domain path

[0085] v_domain=$(ps wwwe${v_pid}|tr"""\n"|awk-F=' / ^DOMAIN_HOME= / {print$2}'|awk-F" / "'{print$(NF)}')

[0086] By using the embodiment provided by the present invention, the WebLogic domain path is automatically discovered through the AdminServer process of WebLogic, and the configuration file corresponding to the WebLogic domain is automatically obtained based on the obtained WebLogic domain path, thereby obtaining the WebLogic service information corresponding to the AdminServer process based on the configuration file. In this way, the IP addresses of all servers in the WebLogic domain can be automatically obtained based on the WebLogic service information, and the T3 filter configuration rules can be generated.

[0087] In the embodiment of the present invention, Figure 3 As shown, optionally, the target IP address includes: a production IP address, a management IP address, a first IP address, and a second IP address; the rule generation script includes a first rule generation script and a second rule generation script; the configuration rule includes a first configuration rule and a second configuration rule;

[0088] Determining each target IP address based on the WebLogic service information, and executing a preset rule generation script to generate a configuration rule corresponding to each target IP address includes:

[0089] S301: Acquire the IP address of each server in the WebLogic service information, where the IP address of each server is the production IP address.

[0090] In the embodiment of the present invention, WebLogic service information can be obtained by parsing the WebLogic domain configuration file config.xml, which defines the machine information in the domain, including the IP address information of all machines. By parsing the config.xml configuration, the production IP addresses of all host servers in the domain can be obtained.

[0091] S302: Determine the managed IP address corresponding to each of the production IP addresses according to a preset mapping rule.

[0092] In the embodiment of the present invention, according to the IP address planning strategy pre-set by the data center, a production IP address and a managed IP address are configured on the same server at the same time. Among the four domains of the production IP address and the managed IP address, the first three domains are different, but the last domain is the same. For example, the production IP address on a server is: 11.168.97.4, and the managed IP address is: 11.170.97.4.

[0093] Therefore, the mapping relationship between the server IP address production IP address prefix and the management IP address prefix can be used to further find the corresponding management IP address through the production IP address. Among them, the production IP address is the IP address of the server where the AdminServer process is located.

[0094] S303: Acquire a preset first IP address and a second IP address according to the WebLogic service information.

[0095] In the embodiment of the present invention, the first IP address and the second IP address where the T3 filter rule needs to be configured are obtained according to the WebLogic service information of the WebLogic domain. The first IP address may be a local IP (127.0.0.1), and the second IP address may be another address (0.0.0.0 / 0).

[0096] S304: Based on the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address, execute the first rule generation script to generate a first configuration rule, wherein the first configuration rule stipulates that the server where the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address are located can access the WebLogic domain through the T3 protocol.

[0097] In an embodiment of the present invention, according to each production IP address, a first rule generation script is executed to generate a configuration rule that allows the production IP address to access the WebLogic domain through the T3 protocol; according to each managed IP address, a first rule generation script is executed to generate a configuration rule that allows the managed IP address to access the WebLogic domain through the T3 protocol; according to the first IP address, a first rule generation script is executed to generate a configuration rule that allows the first IP address to access the WebLogic domain through the T3 protocol.

[0098] S305: Based on the second IP address, execute the second rule generation script to generate a second configuration rule, where the second configuration rule stipulates that the server where the second IP address is located cannot access the WebLogic domain through the T3 protocol.

[0099] In the embodiment of the present invention, a second rule generation script is executed according to the second IP address to generate a configuration rule that does not allow the second IP address to access the WebLogic domain through the T3 protocol.

[0100] Among them, some script codes involved in the above process are as follows:

[0101] Get the production IP addresses configured in config.xml:

[0102] local v_ip_list=$(grep"\<listen-address\> "${v_config}|awk-F"<|>"'{print$3}'|sort|uniq)

[0103] local v_ip=""

[0104] local v_flag=0

[0105] forv_ip in${v_ip_list}

[0106] do

[0107] For each production IP address, generate a configuration rule that allows it to access the WebLogic domain through the T3 protocol:

[0108] if[[-z$(grep-w"${v_ip}"${V_IP_LIST}|grep"allow")]]

[0109] then

[0110] echo "${v_ip}**allow t3 t3s">>${V_IP_LIST}

[0111] fi

[0112] Based on the existing production IP address, obtain the corresponding managed IP address by replacing the production IP address prefix with the managed IP address prefix:

[0113] local v_mng_ip=$(echo "${v_ip}"|sed's / "'${v_prd_ip_prefix}"' / "'${v_mng_ip_prefix}"' / g')

[0114] Based on the managed IP address, generate a configuration rule that allows it to access the WebLogic domain through the T3 protocol:

[0115] if[[-z$(grep-w"${v_mng_ip}"${V_IP_LIST}|grep"allow")]]

[0116] then

[0117] echo "${v_mng_ip}**allow t3 t3s">>${V_IP_LIST}

[0118] fi

[0119] Done

[0120] Based on the first IP address, generate a configuration rule that allows it to access the WebLogic domain through the T3 protocol:

[0121] echo "127.0.0.1**allow t3 t3s">>${V_IP_LIST}

[0122] Based on the second IP address, generate a configuration rule that does not allow it to access the WebLogic domain through the T3 protocol:

[0123] echo "0.0.0.0 / 0**denyt3 t3s">>${V_IP_LIST}

[0124] For example, the system AAA has 1 domain, 3 hosts, the production IP address is 192.1.1.1-3, and the management IP address is 192.2.2.1-3. The configuration rules required to configure the T3 filter on the AAA domain are as follows:

[0125] 192.1.1.1**allowt3 t3s

[0126] 192.1.1.2**allowt3 t3s

[0127] 192.1.1.3**allowt3 t3s

[0128] 192.2.2.1**allowt3 t3s

[0129] 192.2.2.2**allowt3 t3s

[0130] 192.2.2.3**allowt3 t3s---The above are hosts in this domain

[0131] 127.0.0.1**allowt3 t3s

[0132] 0.0.0.0 / 0**denyt3 t3s

[0133] By applying the embodiments provided by the present invention, each target IP address can be obtained through WebLogic service information, including: a first IP address that needs to be configured to allow access to the WebLogic domain through the T3 protocol, a second IP address that needs to be configured not to allow access to the WebLogic domain through the T3 protocol, and all production IP addresses, and then the managed IP address corresponding to each production IP address is obtained through a preset mapping rule, and then the configuration rules corresponding to each target IP address are automatically generated through a rule generation script, so that the service where each target IP address is located can be connected to the WebLogic domain according to the configuration rules, so that only specific IP addresses or ports are allowed to access the WebLogic domain through the T3 protocol, thereby alleviating the risk of WebLogic's deserialization vulnerability being exploited.

[0134] In the embodiment provided by the present invention, optionally, after executing the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain, the method further includes:

[0135] If each of the configuration rules exists in the connection filter rule item in the configuration file, the T3 filter configured in the WebLogic domain takes effect.

[0136] Specifically, check whether the configuration file (config.xml) corresponding to the WebLogic domain has configured the T3 filter. The inspection content includes two aspects: check whether the T3 filter is configured in the connection-filter; check whether the filtering rule is configured in the connection-filter-rule. For details, please refer to the following inspection command:

[0137] By applying the embodiment provided by the present invention, it is ensured that the WebLogic T3 filter configuration is completed and the T3 filter is effective by checking whether there is a configuration rule in the configuration file connection filter rule item. It is ensured that the server allowed to access the WebLogic domain through the T3 protocol can access the WebLogic domain, and other servers are blocked from accessing, so as to ensure the security of the WebLogic domain.

[0138] In the embodiment provided by the present invention, optionally, it also includes:

[0139] Clearing each of the configuration rules in the WLST configuration script to obtain a WLST rollback script;

[0140] The WLST rollback script is executed on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain.

[0141] Specifically, each configuration rule in the WLST configuration script is set to empty, and the resulting WLST rollback script has some script commands as follows:

[0142]

[0143] Execute the above WLST rollback script on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain. After executing the WLST rollback script, you can also check whether the connection-filter-rule configuration file (config.xml) of the WebLogic domain is empty. If it is empty, it means that the rollback has taken effect.

[0144] The main steps of rolling back the T3 filter on the WebLogic domain where the T3 filter has been set are basically the same as those of configuring the T3 filter. The difference is that the former uses WLST to take effect the T3 filter configuration, while the rollback operation cancels the T3 filter related configuration through WLST. Therefore, before executing the rollback script, it also includes an environment check to obtain the basic information of the WebLogic Server. This step is basically the same as the corresponding environment check and obtaining the basic information of the WebLogic Server in the configuration of the T3 filter, and will not be repeated here.

[0145] By applying the one-click rollback T3 filter configuration function provided by the embodiment of the present invention, the T3 filter configuration can be quickly rolled back to prevent unexpected business impact caused by the configuration of the T3 filter, thereby ensuring the security of the WebLogic domain.

[0146] like Figure 4As shown, the present invention provides a general and automated configuration method and device for setting WebLogic T3 filters. Operation and maintenance personnel can batch schedule and execute the configuration of WebLogic T3 filters through automated operation and maintenance tools. The specific configuration process of WebLogic T3 filters is: first, an environmental check is performed to obtain the basic information of the WebLogic Server, and each target IP address of the T3 filter to be configured is automatically obtained based on the WebLogic domain configuration file in the basic information of the WebLogic Server, and the configuration rules corresponding to each target IP address are generated according to the pre-set rule configuration script, and then the preset WLST script is configured based on each configuration rule to obtain the WLST configuration script, and the WLST configuration script is executed on the server where the AdminServer process is located to connect the server corresponding to each target IP address to the WebLogic domain, and check whether the configuration rule exists in the corresponding connection filter rule item in the WebLogic domain configuration file, so as to take effect the T3 filter configuration in the WebLogic domain, thereby realizing the standardized and automated processing of the T3 filter configuration. At the same time, in order to prevent unexpected business impacts caused by the configuration of the T3 filter, a one-click rollback T3 filter configuration operation is provided to support quick rollback. The specific process is similar to the configuration process of the WebLogic T3 filter. An environmental check is performed to obtain the basic information of the WebLogic Server, the configuration rules in the WLST script are cleared, the WLST rollback script is obtained, and the WebLogic domain is connected through the WLST rollback script to clear the T3 filter configuration. Finally, check whether the configuration rule exists in the corresponding connection filter rule item in the WebLogic domain configuration file. If not, the rollback of the T3 filter configuration takes effect.

[0147] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.

[0148] and Figure 1 Corresponding to the method described above, the embodiment of the present invention further provides a configuration device for a WebLogic T3 filter, for Figure 1 The specific implementation of the method in the embodiment of the present invention is that the configuration device of the WebLogic T3 filter provided in the embodiment of the present invention can be applied to a computer terminal or various mobile devices, and its structural diagram is as shown in FIG. Figure 5 As shown, specifically including:

[0149] The acquisition unit 501 is used to acquire the WebLogic service information corresponding to the AdminServer process when any server in the WebLogic domain has the AdminServer process;

[0150] A determination unit 502 is used to determine each target IP address based on the WebLogic service information, and execute a preset rule generation script to generate a configuration rule corresponding to each target IP address;

[0151] A setting unit 503, configured to set a filter name in a preset WLST script and add each of the configuration rules to obtain a WLST configuration script;

[0152] The execution unit 504 is used to execute the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain.

[0153] Based on the device provided by the embodiment of the invention, during the configuration process of the Weblogic T3 filter, when there is an AdminServer process on any server in the Weblogic domain, the acquisition unit obtains the Weblogic service information corresponding to the AdminServer process, the determination unit determines each target IP address based on the Weblogic service information, and executes a pre-set rule generation script to generate a configuration rule corresponding to each target IP address; the setting unit sets the filter name in a pre-set WLST script and adds each configuration rule to obtain a WLST configuration script; the execution unit executes the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the Weblogic domain.

[0154] By using the WebLogic T3 filter configuration device provided by the present invention, the complex operations of WebLogic T3 filter configuration can be encapsulated into a one-click universal script, thereby realizing the normalization and standardization of T3 filter configuration operations. By executing the script, the T3 filter configuration is automatically completed, manual intervention is reduced, the configuration implementation efficiency of the T3 filter is improved, and the timeliness requirements of security risk rectification can be better met.

[0155] In the above device, optionally, the acquisition unit 501 includes:

[0156] A first determining subunit is used to determine the WebLogic domain path corresponding to the AdminServer process;

[0157] A first acquisition subunit is used to acquire a configuration file corresponding to the WebLogic domain according to the WebLogic domain path;

[0158] The second acquisition subunit is used to acquire the WebLogic service information corresponding to the AdminServer process based on the configuration file.

[0159] The above device may optionally further include:

[0160] The checking unit is used for, if each of the configuration rules exists in the connection filter rule item in the configuration file, then the T3 filter configured in the WebLogic domain takes effect.

[0161] In the above device, optionally, the target IP address includes: a production IP address, a managed IP address, a first IP address, and a second IP address; the rule generation script includes a first rule generation script and a second rule generation script; the configuration rule includes a first configuration rule and a second configuration rule; the determination unit 502 includes:

[0162] The third acquisition subunit is used to acquire the IP address of each server in the WebLogic service information, and the IP address of each server is the production IP address;

[0163] A second determination subunit is used to determine the management IP address corresponding to each of the production IP addresses according to a preset mapping rule;

[0164] A fourth acquisition subunit, configured to acquire a preset first IP address and a second IP address according to the WebLogic service information;

[0165] A first generating subunit is used to execute the first rule generating script based on the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address to generate a first configuration rule, wherein the first configuration rule stipulates that the server where the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address are located can access the WebLogic domain through the T3 protocol;

[0166] The second generating subunit is used to execute the second rule generating script based on the second IP address to generate a second configuration rule, wherein the second configuration rule stipulates that the server where the second IP address is located cannot access the WebLogic domain through the T3 protocol.

[0167] The above device may optionally further include:

[0168] A clearing unit, configured to clear each of the configuration rules in the WLST configuration script to obtain a WLST rollback script;

[0169] The rollback unit is used to execute the WLST rollback script on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain.

[0170] For the specific working process of each unit and sub-unit in the configuration device of the WebLogic T3 filter disclosed in the above embodiment of the present invention, reference may be made to the corresponding content in the configuration method of the WebLogic T3 filter disclosed in the above embodiment of the present invention, which will not be repeated here.

[0171] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the configuration method of the WebLogic T3 filter.

[0172] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to perform the following operations:

[0173] When any server in the WebLogic domain has an AdminServer process, obtain the WebLogic service information corresponding to the AdminServer process;

[0174] Based on the WebLogic service information, determine each target IP address, and execute a preset rule generation script to generate a configuration rule corresponding to each target IP address;

[0175] Setting the filter name in a preset WLST script and adding each of the configuration rules to obtain a WLST configuration script;

[0176] Execute the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain.

[0177] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0178] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, computer software, or a combination of both.

[0179] In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0180] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for configuring a WebLogic T3 filter, characterized in that: include: When any server in the WebLogic domain has an AdminServer process, obtain the WebLogic service information corresponding to the AdminServer process; Based on the WebLogic service information, each target IP address is determined, and a pre-set rule generation script is executed to generate a configuration rule corresponding to each target IP address; the target IP address is an IP address of a server in the WebLogic domain that is allowed to be accessed through the T3 protocol; Setting the filter name in a preset WLST script and adding each of the configuration rules to obtain a WLST configuration script; Execute the WLST configuration script on the server where the AdminServer process is located to complete the configuration of the T3 filter in the WebLogic domain; The target IP address includes: a production IP address, a managed IP address, a first IP address, and a second IP address; the rule generation script includes a first rule generation script and a second rule generation script; the configuration rule includes a first configuration rule and a second configuration rule; the managed IP address is an IP address that has different first three fields from the production IP address and has the same last field; Correspondingly, based on the WebLogic service information, each target IP address is determined, and a preset rule generation script is executed to generate a configuration rule corresponding to each target IP address, including: Obtain the IP address of each server in the WebLogic service information, where the IP address of each server is the production IP address; Determine the managed IP address corresponding to each of the production IP addresses according to a preset mapping rule; According to the WebLogic service information, obtain a preset first IP address and a second IP address; Based on the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address, executing the first rule generation script to generate a first configuration rule, wherein the first configuration rule stipulates that the server where the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address are located can access the WebLogic domain through the T3 protocol; Based on the second IP address, the second rule generation script is executed to generate a second configuration rule, wherein the second configuration rule stipulates that the server where the second IP address is located cannot access the WebLogic domain through the T3 protocol.

2. The method according to claim 1, characterized in that The obtaining of WebLogic service information corresponding to the AdminServer process includes: Determine the WebLogic domain path corresponding to the AdminServer process; According to the WebLogic domain path, obtain the configuration file corresponding to the WebLogic domain; The WebLogic service information corresponding to the AdminServer process is obtained based on the configuration file.

3. The method according to claim 2, characterized in that Also includes: If each of the configuration rules exists in the connection filter rule item in the configuration file, the T3 filter configured in the WebLogic domain takes effect.

4. The method according to claim 1, characterized in that: Also includes: Clearing each of the configuration rules in the WLST configuration script to obtain a WLST rollback script; The WLST rollback script is executed on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain.

5. A configuration device for a WebLogic T3 filter, characterized in that: include: An acquisition unit, used for acquiring WebLogic service information corresponding to an AdminServer process when an AdminServer process exists on any server in a WebLogic domain; A determination unit, used to determine each target IP address based on the WebLogic service information, and execute a preset rule generation script to generate a configuration rule corresponding to each target IP address; the target IP address is an IP address of a server in the WebLogic domain that is allowed to be accessed through the T3 protocol; A setting unit, used for setting a filter name in a preset WLST script and adding each of the configuration rules to obtain a WLST configuration script; An execution unit, configured to execute the WLST configuration script on the server where the AdminServer process is located, so as to complete the configuration of the T3 filter in the WebLogic domain; The target IP address includes: a production IP address, a managed IP address, a first IP address, and a second IP address; the rule generation script includes a first rule generation script and a second rule generation script; the configuration rule includes a first configuration rule and a second configuration rule; the managed IP address is an IP address that has different first three fields from the production IP address and has the same last field; Accordingly, the determining unit includes: The third acquisition subunit is used to acquire the IP address of each server in the WebLogic service information, and the IP address of each server is the production IP address; A second determination subunit is used to determine the management IP address corresponding to each of the production IP addresses according to a preset mapping rule; A fourth acquisition subunit, configured to acquire a preset first IP address and a second IP address according to the WebLogic service information; A first generating subunit is used to execute the first rule generating script based on the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address to generate a first configuration rule, wherein the first configuration rule stipulates that the server where the first IP address, each of the production IP addresses, and the managed IP address corresponding to the production IP address are located can access the WebLogic domain through the T3 protocol; The second generating subunit is used to execute the second rule generating script based on the second IP address to generate a second configuration rule, wherein the second configuration rule stipulates that the server where the second IP address is located cannot access the WebLogic domain through the T3 protocol.

6. The device according to claim 5, characterized in that The acquisition unit comprises: A first determining subunit is used to determine the WebLogic domain path corresponding to the AdminServer process; A first acquisition subunit is used to acquire a configuration file corresponding to the WebLogic domain according to the WebLogic domain path; The second acquisition subunit is used to acquire the WebLogic service information corresponding to the AdminServer process based on the configuration file.

7. The device according to claim 6, characterized in that Also includes: The checking unit is used for, if each of the configuration rules exists in the connection filter rule item in the configuration file, then the T3 filter configured in the WebLogic domain takes effect.

8. The device according to claim 5, characterized in that Also includes: A clearing unit, configured to clear each of the configuration rules in the WLST configuration script to obtain a WLST rollback script; The rollback unit is used to execute the WLST rollback script on the server where the AdminServer process is located to cancel the configuration of the T3 filter in the WebLogic domain.