Operation and Maintenance Processing Method, Device, Computer Equipment and Medium Based on a Bastion Host

By introducing the bastion machine JDBC agent in the bastion machine and loading the JDBC drivers of different databases using the command line startup parameters, the problem that the existing bastion machine cannot be compatible with all databases is solved, and the operation and maintenance operations with different database servers are realized, which reduces development and management costs.

CN116932507BActive Publication Date: 2025-06-13HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310553443.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2025-06-13
Estimated Expiration
2043-05-16

AI Technical Summary

Technical Problem

Most existing bastion machines are developed based on a single database protocol and are unable to be compatible with all databases, resulting in the need to develop agents separately for each type of database server, increasing development and management costs.

Method used

By introducing the bastion machine JDBC agent in the bastion machine, using the command line startup parameters to load the JDBC drivers of different databases, the operation and maintenance operations with different database servers are realized, and the development and management costs are reduced.

Benefits of technology

It realizes that without designing different bastion machine agents for different database servers, it can operate and maintain operations with different database servers, reducing development and management costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932507B_ABST
    Figure CN116932507B_ABST
Patent Text Reader

Abstract

The present application relates to an operation and maintenance processing method, device, computer device, storage medium, and computer program product based on a bastion host. The method includes: when receiving a proxy program startup request, starting a bastion host JDBC proxy program in the bastion host based on command line startup parameters; calling the bastion host JDBC proxy program based on database configuration information to load a database JDBC driver corresponding to an operation and maintenance database server; when a database client calls a proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, establishing a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program; receiving an operation instruction from the database client based on the proxy driver; when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains an operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forwarding the operation result to the database client.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular to an operation and maintenance method, device, computer device, storage medium, and computer program product based on a bastion host. Background Art

[0002] As a network security defense mechanism, a bastion host mainly creates a secure and controllable network environment in the network through means such as network data monitoring, data flow analysis, and intrusion behavior detection. The main working principle is to analyze, filter, and block the passing operation behaviors through the protocol proxy method, so as to ensure that trusted data and operation accesses are passed, and untrusted or dangerous operation behaviors will be intercepted or blocked, ultimately achieving the purpose of protecting network and data security.

[0003] However, most current bastion hosts are based on a single database protocol (such as the Mysql protocol) to proxy a certain type of database server. The bastion host developed based on a single database protocol cannot be compatible with all databases, and a bastion host proxy program needs to be developed separately for each type of database server to meet the operation and maintenance requirements between the database client and the database server based on the database protocol proxy program. It cannot effectively achieve unified proxy and management, resulting in high development costs. Summary of the Invention

[0004] Based on this, it is necessary to provide an operation and maintenance method, device, computer device, computer-readable storage medium, and computer program product based on a bastion host that can reduce development costs for the above technical problems.

[0005] In a first aspect, this application provides an operation and maintenance processing method based on a bastion host, which is applied to a bastion host. The method includes: when receiving a proxy program startup request, starting a bastion host JDBC proxy program in the bastion host based on command-line startup parameters; the command-line startup parameters include database configuration information of the operation and maintenance database server; based on the database configuration information, calling the bastion host JDBC proxy program to load the database JDBC driver corresponding to the operation and maintenance database server; when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, establishing a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program; there is a corresponding relationship between the proxy driver and the bastion host JDBC proxy program; receiving an operation instruction from the database client based on the proxy driver; when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forwarding the operation result to the database client.

[0006] In one embodiment, the bastion host includes an operation and maintenance forwarding program and a monitoring forwarding program; when receiving a proxy program startup request, the bastion host JDBC proxy program in the bastion host is started according to the command line startup parameters, including: receiving the proxy program startup request from the operation and maintenance client based on the operation and maintenance forwarding program; forwarding the proxy program startup request to the monitoring forwarding program based on the operation and maintenance forwarding program; starting the bastion host JDBC proxy program according to the command line startup parameters; the command line startup parameters further include the listening port number assigned by the monitoring forwarding program to the bastion host JDBC proxy program, so that the database client can connect to the bastion host JDBC proxy program based on the listening port number.

[0007] In one embodiment, when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, a communication connection between the database client and the operation and maintenance database server is established based on the bastion host JDBC proxy program, including: when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, forwarding the operation and maintenance connection request to the operation and maintenance database server based on the bastion host JDBC proxy program; the operation and maintenance connection request includes the username and user password of the operation and maintenance database server; when the username and user password are verified correctly by the operation and maintenance database server, obtaining the verification passed response information from the operation and maintenance database server based on the bastion host JDBC proxy program; when sending the verification passed response information to the database client based on the bastion host JDBC proxy program, receiving the parameter configuration connection method from the database client; when forwarding the parameter configuration connection method to the operation and maintenance database server based on the bastion host JDBC proxy program, obtaining the connection success response information of the parameter configuration connection method; when sending the connection success response information to the database client based on the bastion host JDBC proxy program, receiving the metadata method acquisition request from the database client; when forwarding the acquisition success response information corresponding to the metadata method acquisition request from the operation and maintenance database server to the database client based on the bastion host JDBC proxy program, establishing a communication connection between the database client and the operation and maintenance database server.

[0008] In one embodiment, the bastion host includes: an operation and maintenance forwarding program, a monitoring forwarding program, and a log database; when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, before forwarding the operation result to the database client, it further includes: writing the high-risk instruction set configured in the operation and maintenance client to the log database, and reading the high-risk instruction set from the log database based on the operation and maintenance forwarding program; sending the high-risk instruction set to the monitoring forwarding program based on the operation and maintenance forwarding program, so that the monitoring forwarding program stores the high-risk instruction set in the high-risk instruction set rule file; reading the high-risk instruction set from the high-risk instruction set rule file based on the bastion host JDBC proxy program; when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forwarding the operation result to the database client includes: when it is determined based on the high-risk instruction set and the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forwarding the operation result to the database client.

[0009] In one embodiment, the first preset instruction includes a pass type instruction, an alarm type instruction, a blocking instruction, or a session termination instruction; when it is determined based on the high-risk instruction set and the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forwarding the operation result to the database client includes at least one of the following:

[0010] The first item: when it is determined based on the high-risk instruction set and the bastion host JDBC proxy program that the operation instruction is a pass type instruction or an alarm type instruction, forwarding the operation instruction to the operation and maintenance database server based on the bastion host JDBC proxy program; obtaining the operation result from the operation and maintenance database server based on the bastion host JDBC proxy program, and forwarding the operation result to the database client;

[0011] The second item: when it is determined based on the high-risk instruction set and the bastion host JDBC proxy program that the operation instruction is a blocking instruction or a session termination instruction, forwarding the instruction approval request to the operation and maintenance client through the operation and maintenance forwarding program based on the bastion host JDBC proxy program; the instruction approval request includes the operation instruction; when the operation and maintenance client approves the operation instruction based on the instruction approval request, calling the database JDBC driver based on the bastion host JDBC proxy program to forward the operation instruction to the operation and maintenance database server, obtaining the operation result from the operation and maintenance database server, and forwarding the operation result to the database client.

[0012] In one embodiment, the method further includes: when it is determined, according to a high-risk instruction set, that an operation instruction is a second preset instruction based on the bastion host JDBC proxy program, disconnecting the execution process of the operation instruction; the second preset instruction includes a direct blocking type instruction and / or a direct session termination type instruction.

[0013] In one embodiment, the method further includes: when the operation instruction is a direct session termination type instruction, forwarding, based on the bastion host JDBC proxy program, an operation shutdown request from a database client to an operation and maintenance database server, so that the operation and maintenance database server disconnects the communication connection with the database client based on the operation shutdown request.

[0014] The above-mentioned operation and maintenance processing method based on a bastion host enables the bastion host JDBC proxy program in the bastion host to load a corresponding database JDBC driver according to the database configuration information of the operation and maintenance database server. For different database servers, when obtaining the corresponding database configuration information and loading the corresponding driver based on the same bastion host JDBC proxy program, the same bastion host JDBC proxy program can implement operation and maintenance operations with different database servers. In other words, adopting this method can achieve proxying all databases that provide JDBC drivers based on the bastion host JDBC proxy program, without the need to design different bastion host proxy programs for different database servers, reducing the development cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is an application environment diagram of the operation and maintenance processing method based on a bastion host in one embodiment;

[0016] Figure 2 It is a flowchart of the operation and maintenance processing method based on a bastion host in one embodiment;

[0017] Figure 3 It is a flowchart of starting the bastion host JDBC proxy program in the bastion host according to command line startup parameters when receiving a proxy program startup request in one embodiment;

[0018] Figure 4 It is a flowchart of establishing a communication connection between a database client and an operation and maintenance database server based on the bastion host JDBC proxy program when the database client calls a proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program in one embodiment;

[0019] Figure 5Schematic diagram of the process of forwarding the operation result to the database client when, in an embodiment, it is determined that the operation instruction is the first preset instruction based on the bastion host JDBC proxy program, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver;

[0020] Figure 6 Schematic diagram of the process of forwarding the operation result to the database client when, in another embodiment, it is determined that the operation instruction is the first preset instruction based on the bastion host JDBC proxy program according to the high-risk instruction set, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver;

[0021] Figure 7 Schematic diagram of the process of forwarding the operation result to the database client when, in another embodiment, it is determined that the operation instruction is the first preset instruction based on the bastion host JDBC proxy program according to the high-risk instruction set, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver;

[0022] Figure 8 Schematic diagram of the process of the bastion host approval instruction in another embodiment;

[0023] Figure 9 Schematic diagram of the process of forwarding the operation instruction to the operation and maintenance database server based on the bastion host JDBC proxy program, obtaining the operation result from the operation and maintenance database server, and forwarding the operation result to the database client in an embodiment;

[0024] Figure 10 Block diagram of the operation and maintenance processing device based on the bastion host in an embodiment;

[0025] Figure 11 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0026] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] The operation and maintenance processing method based on the bastion host provided by the embodiments of the present application can be applied to the application environment as Figure 1 shown. Among them, the operation and maintenance processing system 100 includes: a client 102, a bastion host 104, and a database server 106.

[0028] The client 102 includes a database client 1022 and an operation and maintenance client 1024. The database client 1022 is used to receive the input operation instructions, and the operation and maintenance client 1024 is used to start the bastion host. The bastion host 104 includes a log database 1042, an operation and maintenance forwarding program 1044, a monitoring forwarding program 1046, and a bastion host JDBC proxy program 1048. The log database 1042 is used to store the high-risk instruction set configured by the operation and maintenance client 1024. Specifically, in this embodiment, the high-risk instruction set configured in the operation and maintenance client 1024 can be written into the log database 1042. The operation and maintenance forwarding program 1044 is used to forward the proxy program startup request from the operation and maintenance client 1024 to the bastion host JDBC proxy program 1048 through the monitoring forwarding program 1046 to start the bastion host JDBC proxy program 1048. The bastion host JDBC proxy program 1048 is used to receive the connection request or operation instructions from the database client 1022 and forward them to the operation and maintenance database server 1062 in the database server 106; the operation and maintenance database server 1062 is used to return the response information of the connection request or the operation result corresponding to the operation instructions to the database client 1022 through the bastion host JDBC proxy program 1048 according to the connection request or operation instructions.

[0029] It should be noted that the database client and the bastion host JDBC proxy program communicate through a proxy driver, and the bastion host JDBC proxy program and the operation and maintenance database server communicate through a database JDBC driver. In the relevant content described later, it is default that the database client sends instructions, information, or requests to the bastion host JDBC proxy program through the proxy driver. It is default that the bastion host JDBC proxy program sends instructions, information, or requests to the database client through the proxy driver. It is default that the bastion host JDBC proxy program sends instructions, information, or requests to the operation and maintenance database server through the database JDBC driver. It is default that the operation and maintenance database server sends instructions, information, or requests to the bastion host JDBC proxy program through the database JDBC driver.

[0030] In one embodiment, as Figure 2 shown, a method for operation and maintenance processing based on a bastion host is provided. Taking the bastion host 104 in Figure 1 as an example, the method includes the following steps:

[0031] S202, when receiving a proxy program startup request, start the bastion host JDBC proxy program in the bastion host based on the command-line startup parameters.

[0032] Among them, the bastion host includes a bastion host JDBC proxy program. JDBC (Java DataBase Connectivity) is a class library for Java database connection, providing an interface for database operations, enabling developers to more conveniently connect to database operations. Different database vendors will provide their own JDBC driver programs (or called JDBC drivers) when releasing databases, and generally provide JDBC driver programs in the form of jar packages.

[0033] Among them, the command-line startup parameters include the database configuration information of the operation and maintenance database server and the relevant parameters of the database client. The database configuration information of the operation and maintenance database server includes the Internet Protocol (IP) of the operation and maintenance database server, the username and user password of the operation and maintenance database server, the database name of the operation and maintenance database server, etc. The relevant parameters of the database client include the IP of the database client, etc. In this way, the bastion host starts the bastion host JDBC proxy program based on the command-line startup parameters, and the bastion host JDBC proxy program can forward the connection request or operation instruction from the database client to the corresponding operation and maintenance database server.

[0034] S204. Based on the database configuration information, call the bastion host JDBC proxy program to load the database JDBC driver corresponding to the operation and maintenance database server.

[0035] Among them, the database JDBC driver loaded by the bastion host JDBC proxy program is different according to different database configuration information, and there is a corresponding relationship between the database configuration information and the database JDBC driver.

[0036] Combining S202 and S204, it should be noted that when the bastion host receives a proxy program startup request, because the command-line startup parameters include the database configuration information of the operation and maintenance database server, therefore, when the bastion host starts the bastion host JDBC proxy program with the command-line startup parameters, it can pass the database configuration information of the operation and maintenance database server to the bastion host JDBC proxy program, so that the bastion host JDBC proxy program can load the database JDBC driver corresponding to the operation and maintenance database server based on the database configuration information of the operation and maintenance database server.

[0037] Among them, the bastion host JDBC proxy program loads the database JDBC driver and configures basic parameters. The basic parameters include the database JDBC driver class name, the database JDBC driver Uniform Resource Locator (URL), port number, default database, user, user password, etc.

[0038] Among them, the database client creates a connection with the bastion host JDBC proxy program. The bastion host JDBC proxy program loads the database JDBC driver, specifying the database JDBC driver class name: com.jdbcagent.client.jdbc.Driver; URL template: jdbc:agent:{host}[:{port}] / [{database}]; default port: 50000 (this port is the port allocated by the monitoring forwarding process in the bastion host); default database: orcl (that is, the database default-configured by the bastion host JDBC proxy program); default user: test (that is, the username default-configured by the bastion host JDBC proxy program), default user password: 123456 (that is, the user password default-configured by the bastion host JDBC proxy program).

[0039] S206, when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, a communication connection is established between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program.

[0040] Among them, by establishing a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program, in this way, the database client can implement the information interaction process with the operation and maintenance database server through the bastion host JDBC proxy program.

[0041] S208, receive an operation instruction from the database client based on the proxy driver.

[0042] Among them, the proxy driver has a corresponding relationship with the bastion host JDBC proxy program. Therefore, the database client can send operation instructions to the corresponding bastion host JDBC proxy program by calling different proxy drivers. Among them, the operation instruction can refer to an SQL instruction.

[0043] S210, when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forward the operation result to the database client.

[0044] Among them, the first preset instruction can include warning instructions, passing instructions, blocking instructions, or session termination instructions, etc.; in some embodiments, the type of the operation instruction can be determined according to the instruction information in the operation instruction; for example, if the instruction information in the operation instruction includes "insert", it is determined that the operation instruction is a warning instruction.

[0045] In some embodiments, the operation instruction may refer to an SQL instruction, and the operation result refers to the corresponding information queried from the operation and maintenance database by the operation and maintenance database server based on the SQL instruction.

[0046] In summary, in Figure 2 the illustrated embodiment, by starting the bastion host JDBC proxy program in the bastion host, the bastion host JDBC proxy program can load the corresponding database JDBC driver according to the database configuration information of the operation and maintenance database server. For different database servers, when obtaining the corresponding database configuration information and loading the corresponding driver based on the same bastion host JDBC proxy program, the same bastion host JDBC proxy program can implement the operation and maintenance operations with different database servers. In other words, adopting this method can achieve proxying all databases providing JDBC drivers based on the bastion host JDBC proxy program, without designing different bastion host proxy programs for different database servers, reducing the development cost.

[0047] Furthermore, it can be known that since database vendors all provide JDBC interface drivers, therefore, through the method of this application, the dilemma that some database vendors do not disclose their communication protocols and thus it is impossible to develop proxy programs using specific database protocols can be solved; moreover, based on the consistency of the JDBC communication interface specifications, through the method provided in this application, various databases can achieve database proxy based on the same bastion host JDBC proxy program, facilitating unified operation, management, and maintenance.

[0048] In one embodiment, the bastion host includes: an operation and maintenance forwarding program and a monitoring forwarding program; specifically, as Figure 3 shown, a schematic flowchart of starting the bastion host JDBC proxy program in the bastion host according to the command line startup parameters when receiving a proxy program startup request is provided. Taking the bastion host 104 in Figure 1 as an example for illustration, it includes the following steps:

[0049] S302, receiving a proxy program startup request from an operation and maintenance client based on the operation and maintenance forwarding program.

[0050] S304, forwarding the proxy program startup request to the monitoring forwarding program based on the operation and maintenance forwarding program.

[0051] S306, starting the bastion host JDBC proxy program according to the command line startup parameters.

[0052] Among them, the command-line startup parameter also includes the listening port number assigned by the monitoring forwarding program to the bastion host JDBC proxy program. The database client can establish a connection with the bastion host JDBC proxy program based on the listening port number. In this embodiment, the listening port number assigned by the monitoring forwarding program to the bastion host JDBC proxy program starts from 50000.

[0053] Specifically, the format of the command-line startup parameter is as follows:

[0054] "java -jar jdbc-agent.jar -proxy mysql -port 1234 -ip 10.200.102.189 -client_ip 10.200.102.130 -accuser root -password 123456 -user testhyw -session_id 1E971CB109 -time_out 60 -database None -databaseport 3306".

[0055] Among them, "-proxy" represents the operation and maintenance database server. For example, the operation and maintenance database server may include, but is not limited to: mysql, oralce, DM6, DM7, DM8, kingbase7, kingbase8, sqlserver, sqlserver2000; "-port" represents the listening port number assigned by the monitoring forwarding program to the bastion host JDBC proxy program; "-ip" represents the IP of the operation and maintenance database server; "-client_ip" represents the IP of the database client; "-accuser" represents the user name of the operation and maintenance database server; "-password" represents the user password of the operation and maintenance database server; "-user" represents the operation and maintenance user name; "-session_id" represents the current session id of the python side; "-time_out" represents the high-risk instruction approval timeout; "-database" represents the database name of the operation and maintenance database server. When the database name of the operation and maintenance database server does not need to be set, the database name is None; "-databaseport" represents the port number of the operation and maintenance database server.

[0056] In summary, based on Figure 3In the method shown, when there is an operation and maintenance requirement, when the operation and maintenance forwarding program forwards the proxy program startup request from the operation and maintenance client to the monitoring forwarding program, the monitoring forwarding program can start the bastion host JDBC proxy program according to the command line startup parameters; furthermore, the bastion host JDBC proxy program can load the corresponding database JDBC driver according to the database configuration information of the operation and maintenance database server, so as to realize the operation and maintenance requirements between the operation and maintenance database server and the database client based on this driver. For different database servers, when obtaining the corresponding database configuration information and loading the corresponding driver based on the same bastion host JDBC proxy program, the same bastion host JDBC proxy program can realize the operation and maintenance operations with the database server, without designing different bastion host proxy programs for different database servers, reducing the development cost.

[0057] In one embodiment, as Figure 4 shown, a schematic flowchart of establishing a communication connection between a database client and an operation and maintenance database server based on a bastion host JDBC proxy program when the database client calls a proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program is provided. Taking the bastion host 104 in Figure 1 as an example, the method includes the following steps:

[0058] S402, when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, forward the operation and maintenance connection request to the operation and maintenance database server based on the bastion host JDBC proxy program; the operation and maintenance connection request includes the username and user password of the operation and maintenance database server.

[0059] Specifically, S402 includes S4021 and S4022; where S4021 is the process of the database client calling the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program; S4022 is the process of the bastion host JDBC proxy program sending an operation and maintenance connection request to the operation and maintenance database server based on the database JDBC driver.

[0060] Among them, by carrying the username and user password of the operation and maintenance database server in the operation and maintenance connection request, the operation and maintenance database server can determine whether to establish a communication connection with the database client based on the username and user password; in other words, the operation and maintenance database server needs to perform authentication to determine whether to establish a communication connection with the database client.

[0061] S404, when the operation and maintenance database server verifies that the username and user password are correct, obtain the verification passed response information from the operation and maintenance database server based on the bastion host JDBC proxy program.

[0062] Specifically, if the operation and maintenance database server determines that the preset username and user password are consistent with the username and user password carried in the operation and maintenance connection request, the operation and maintenance database server sends a verification passed response message to the database client based on the bastion host JDBC proxy program, so that the database client can perform subsequent corresponding processes based on the verification passed response message.

[0063] S406. When sending the verification passed response message to the database client based on the bastion host JDBC proxy program, receive the parameter configuration connection method from the database client.

[0064] Specifically, S406 includes S4061 and S4062. Among them, S4061 is the process in which the bastion host JDBC proxy program sends a verification passed response message to the database client. Among them, S4062 is the process in which the database client sends a parameter configuration connection method to the bastion host JDBC proxy program when receiving the verification passed response message.

[0065] Among them, the parameter configuration connection method includes multiple first contents, and the multiple first contents are specifically: methods such as setting auto-commit, obtaining auto-commit, obtaining the directory name of the current object, obtaining the schema name of the current object, and committing the setting.

[0066] S408. When forwarding the parameter configuration connection method to the operation and maintenance database server based on the bastion host JDBC proxy program, obtain the connection success response message of the parameter configuration connection method.

[0067] Specifically, S408 includes S4081 and S4082. Among them, S4081 is the process in which the bastion host JDBC proxy program sends the parameter configuration connection method to the operation and maintenance database server. S4082 is the process in which the operation and maintenance database server sends a connection success response message to the bastion host JDBC proxy program based on the parameter configuration connection method.

[0068] In some embodiments, when the bastion host JDBC proxy program receives the parameter configuration connection method from the database client, the bastion host JDBC proxy program respectively encapsulates and invokes the corresponding database parameter configuration connection method in the java.sql package according to the multiple first contents in the parameter configuration connection method and sends it to the operation and maintenance database server.

[0069] Among them, the parameter configuration connection method includes multiple first contents. When the response messages corresponding to the multiple first contents are all connection successes, the operation and maintenance database server sends a connection success response message to the bastion host JDBC proxy program. If the response message corresponding to at least one of the multiple first contents is a connection failure, repeat the execution of S402 - S408 until the response messages corresponding to the multiple first contents in the parameter configuration connection method are all connection successes.

[0070] S410. When the bastion host JDBC proxy program sends the connection success response information to the database client, receive the metadata method acquisition request from the database client.

[0071] Specifically, S410 includes S4101 and S4102. Among them, S4101 is the process in which the bastion host JDBC proxy program sends the connection success response information to the database client; S4102 is the process in which the database client sends the metadata method acquisition request to the bastion host JDBC proxy program when receiving the connection success response information.

[0072] Among them, the metadata method acquisition request includes multiple second contents, and the multiple second contents include but are not limited to: methods such as obtaining the database major version, obtaining the database minor version, obtaining the identifier reference string, obtaining the SQL status type, supporting relevant subqueries, supporting mixed case identifiers, supporting mixed case reference identifiers, storing uppercase identifiers, storing uppercase reference identifiers, storing lowercase reference identifiers, obtaining the search string escape, obtaining the directory separator, supporting command data operations, supporting table definition directories, supporting procedure call directories, supporting index definition directories, supporting privilege definition directories, etc.

[0073] S412. When the bastion host JDBC proxy program forwards the acquisition success response information corresponding to the metadata method acquisition request from the operation and maintenance database server to the database client, establish a communication connection between the database client and the operation and maintenance database server.

[0074] Specifically, S412 includes S4121, S4122, and S4123. Among them, S4121 is the process in which the bastion host JDBC proxy program sends the metadata method acquisition request to the operation and maintenance database server; S4122 is the process in which the operation and maintenance database server sends the acquisition success response information to the bastion host JDBC proxy program based on the metadata acquisition request; S4123 is the process in which the bastion host JDBC proxy program sends the acquisition success response information to the database client. Through the above three processes, a communication connection between the database client and the operation and maintenance database server can be established.

[0075] In some embodiments, when the bastion host JDBC proxy program receives the metadata method acquisition request from the database client, the bastion host JDBC proxy program respectively calls the corresponding metadata method for obtaining the database connection in the java.sql package according to the multiple second contents in the metadata method acquisition request, and sends this method to the operation and maintenance database server.

[0076] In some embodiments, the metadata method acquisition request includes multiple second contents. When the response information corresponding to the multiple second contents is all acquisition successful, the operation and maintenance database server sends an acquisition successful response information to the bastion host JDBC proxy program. If the response information corresponding to at least one of the multiple second contents is acquisition failed, then S402 - S410 is repeatedly executed until the response information corresponding to the multiple second contents in the metadata method acquisition request is all acquisition successful.

[0077] In one embodiment, when the bastion host JDBC proxy program detects that the communication connection between the database client and the operation and maintenance database server is successful, it sends an operation and maintenance start log message to the operation and maintenance forwarding program; wherein, the format of the operation and maintenance start log message sent by the bastion host JDBC proxy program to the operation and maintenance forwarding program is as follows: {"url":" / rpc","method":"proxy_begin","param":{"sid":"F9508DACB0"}}.

[0078] In summary, based on Figure 4 the method shown above, by establishing a communication connection between the database client and the operation and maintenance database server through the bastion host JDBC proxy program, in this way, for different database servers, when obtaining the corresponding database configuration information, when loading the corresponding driver based on the same bastion host JDBC proxy program, the same bastion host JDBC proxy program can implement the operation and maintenance operations with different database servers, without designing different bastion host proxy programs for different database servers, reducing the development cost.

[0079] In one embodiment, the bastion host includes: an operation and maintenance forwarding program, a monitoring forwarding program, and a log database; specifically, as Figure 5 shown, a flowchart of forwarding the operation result to the database client when it is determined based on the bastion host JDBC proxy program that the operation instruction is the first preset instruction and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver is provided. Taking the bastion host 104 in Figure 1 as an example for illustration, it includes the following steps:

[0080] S502, write the high-risk instruction set configured in the operation and maintenance client to the log database, and read the high-risk instruction set from the log database based on the operation and maintenance forwarding program.

[0081] Specifically, S502 includes S5021, S5022, and S5023; wherein, S5021 is the process of configuring the high-risk instruction set in the operation and maintenance client; S5022 is the process of writing the high-risk instruction set to the log database; S5023 is the process of the operation and maintenance forwarding program reading the high-risk instruction set from the log database.

[0082] Among them, the instruction types in the high-risk instruction set include but are not limited to: alarm instructions (i.e., insert), approval instructions (i.e., delete, blocking instructions after timeout or rejection), approval instructions (i.e., update, disconnecting the session instructions after timeout or rejection), blocking instructions (i.e., truncate), session disconnection instructions (i.e., drop); instructions outside the high-risk instruction set are passing instructions.

[0083] S504, based on the operation and maintenance forwarding program, sends the high-risk instruction set to the monitoring forwarding program, so as to store the high-risk instruction set into the high-risk instruction set rule file based on the monitoring forwarding program.

[0084] Specifically, S504 includes S5041 and S5042; among them, S5041 is the process of the operation and maintenance forwarding program sending the high-risk instruction set to the monitoring forwarding program; S5042 is the process of the monitoring forwarding program storing the high-risk instruction set into the high-risk instruction set rule file.

[0085] Among them, the operation and maintenance forwarding program sends the high-risk instruction set to the monitoring forwarding program, and the sending format is as follows:

[0086] {"method":"highrisk_set","session_id":"1E971CB109","data":{"time_out":60,"risk_list":{"insert":1,"update":3,"delete":2,"drop":5,"truncate":4}}};"risk_list" refers to the instruction types in the high-risk instruction set.

[0087] Among them, the content format of the high-risk instruction rule file is as follows:

[0088] “

[0089] {

[0090] "name":"alarmList",

[0091] "instruct_name":"insert",

[0092] },

[0093] {

[0094] "name":"approvalBlockList",

[0095] "instruct_name":"create,update",

[0096] },

[0097] {

[0098] "name":"approvalBreakList",

[0099] "instruct_name":"alter",

[0100] },

[0101] {

[0102] "name":"directBlockList",

[0103] "instruct_name":"delete",

[0104] },

[0105] {

[0106] "name":"directBreakList",

[0107] "instruct_name":"drop",

[0108] },

[0109] ”.

[0110] S506, Read the high-risk instruction set from the high-risk instruction set rule file based on the bastion host JDBC proxy program.

[0111] S508, When it is determined based on the high-risk instruction set that the operation instruction is the first preset instruction based on the bastion host JDBC proxy program, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forward the operation result to the database client.

[0112] In some embodiments, the instruction information in the operation instruction can be compared with the instruction types in the high-risk instruction set to determine whether the operation instruction is the first preset instruction. For example, if the instruction information in the operation instruction includes "insert", which is the same as the "insert" corresponding to the warning type instruction in the high-risk instruction set, then the operation instruction is a warning type instruction; therefore, the operation and maintenance database server can forward the operation result of the operation instruction to the database client through the bastion host JDBC proxy program.

[0113] In summary, based on Figure 5The method shown can, by obtaining the high-risk instruction set configured in the operation and maintenance client, enable the bastion host JDBC proxy program to forward the operation result obtained from the operation and maintenance database server to the database client when it determines that the operation instruction is the first preset instruction according to the high-risk instruction set, thus realizing real-time interactive processing at the operation instruction level among the database client, the bastion host, and the operation and maintenance database server.

[0114] In one embodiment, the first preset instruction includes a pass-through instruction or an alarm instruction; specifically, as Figure 6 shown, a schematic flowchart of a process for forwarding an operation result to a database client when, according to a high-risk instruction set, it is determined that the operation instruction is the first preset instruction based on the bastion host JDBC proxy program, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver is provided. Taking the bastion host 104 in Figure 1 as an example for illustration, the following steps are included:

[0115] S602, when it is determined that the operation instruction is a pass-through instruction or an alarm instruction based on the bastion host JDBC proxy program according to the high-risk instruction set, call the database JDBC driver based on the bastion host JDBC proxy program and forward the operation instruction to the operation and maintenance database server.

[0116] S604, obtain the operation result from the operation and maintenance database server based on the bastion host JDBC proxy program and forward the operation result to the database client.

[0117] Specifically, S604 includes S6041 and S6042; where S6041 is the process in which the operation and maintenance database server obtains the operation result from the operation and maintenance database based on the operation instruction and sends the operation result to the bastion host JDBC proxy program through the database JDBC driver; S6042 is the process in which the bastion host JDBC proxy program sends the operation result to the database client through the proxy driver.

[0118] Among them, the operation and maintenance database server receives the operation instruction from the bastion host JDBC proxy program, and the operation and maintenance database server executes the corresponding process from the operation and maintenance database based on the operation instruction to obtain the operation result. For example, if the operation instruction is an SQL instruction, the operation result is the query result of the SQL instruction in the operation and maintenance database.

[0119] In some embodiments, when the bastion host JDBC proxy program forwards the operation result to the database client, a log message can be constructed and sent to the operation and maintenance forwarding program at the same time; the operation and maintenance forwarding program writes the received log message into the log database for the operation and maintenance client to view. Among them, the format of the log message can be shown as follows:

[0120] "{"url":" / rpc / log","sid":"1E971CB109","actid":1,"cmd":"001","approvers":"Approver","dip":"127.0.0.1","sip":"10.200.102.130","user":"tester"}".

[0121] In some embodiments, after the bastion host JDBC proxy detects the end of database client operation and maintenance (such as detecting that the database client obtains the operation result) or disconnection, etc., it sends the end log information to the operation and maintenance forwarding program and ends the bastion host JDBC proxy program; among them, the format of the bastion host JDBC proxy program sending the operation and maintenance end log information to the operation and maintenance forwarding program is as follows:

[0122] "{"url":" / rpc","method":"proxy_end","param":{"code":9999,"sid":"1E971CB109"}}", where "code" represents the session status, and "9999" represents the successful end of the session.

[0123] In summary, based on Figure 6 the method shown above, when the bastion host JDBC proxy determines that the operation instruction is a pass type instruction or an alarm type instruction, by forwarding the operation instruction to the operation and maintenance database server, the real-time interactive processing of the operation instruction level audit among the database client, the bastion host, and the operation and maintenance database server is realized.

[0124] In one embodiment, the first preset instruction includes a blocking instruction or a session termination instruction. Specifically, as Figure 7 shown, a process schematic diagram of forwarding the operation result to the database client when, according to a high-risk instruction set, the bastion host JDBC proxy determines that the operation instruction is a first preset instruction and the bastion host JDBC proxy obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver is provided. Taking the bastion host 104 in Figure 1 as an example for illustration, it includes the following steps:

[0125] S702, when, according to a high-risk instruction set, the bastion host JDBC proxy determines that the operation instruction is a blocking instruction or a session termination instruction, the instruction approval request is forwarded to the operation and maintenance client through the operation and maintenance forwarding program based on the bastion host JDBC proxy; the instruction approval request includes the operation instruction.

[0126] Specifically, S702 includes S7021 and S7022; among them, S7021 is the process in which the bastion host JDBC proxy program sends an instruction approval request to the operation and maintenance forwarding program when it determines that the operation instruction is a blocking instruction or a session termination instruction according to the high-risk instruction set; S7022 is the process in which the operation and maintenance forwarding program sends the instruction approval request to the operation and maintenance client.

[0127] Among them, when the bastion host JDBC proxy program sends an instruction approval request to the operation and maintenance forwarding program, the instruction approval request command is in JSON format and can be expressed as follows:

[0128] "{"url":" / rpc / riskcmd","accuser":"root","cmd":"ls","dip":"10.200.101.243","sid":"CD02F514DF","user":"opzyj"}}".

[0129] S704, when the operation and maintenance client approves the operation instruction based on the instruction approval request, the operation instruction is forwarded to the operation and maintenance database server based on the bastion host JDBC proxy program, the operation result is obtained from the operation and maintenance database server, and the operation result is forwarded to the database client.

[0130] Specifically, S704 includes S7041, S7042, S7043, S7044 and S7045; among them, S7041 is the process in which the operation and maintenance client sends the instruction approval passed information to the operation and maintenance forwarding program when it approves the operation instruction based on the instruction approval request; S7042 is the process in which the operation and maintenance forwarding program sends the instruction approval passed information to the bastion host JDBC proxy program; S7043 is the process in which the bastion host JDBC proxy program sends the operation instruction to the operation and maintenance database server based on the database JDBC driver; S7044 is the process in which the operation and maintenance database server sends the operation result to the bastion host JDBC proxy program based on the database JDBC driver when it obtains the corresponding operation result based on the operation instruction; S7045 is the process in which the bastion host JDBC proxy program sends the operation result to the database client based on the proxy driver.

[0131] In some embodiments, an inquiry period is set, and the bastion host JDBC proxy program sends a request to query the approval result to the operation and maintenance forwarding program based on the inquiry period, so that the bastion host JDBC proxy program can timely know whether the operation instruction is approved, improving the operation and maintenance efficiency.

[0132] Among them, the inquiry period can be 1 second or other values; for example, the bastion host JDBC proxy program sends a request to query the approval result to the operation and maintenance forwarding program every 1 second; the request command format for the bastion host JDBC proxy program to obtain the approval result from the operation and maintenance forwarding program can be expressed as follows: {"url":" / rpc / getriskcmd","sid":"1E971CB109"}}.

[0133] In some embodiments, if the operation and maintenance client disapproves the operation instruction based on the instruction approval request or the approval times out, the entire session connection is disconnected, that is, the communication connection between the database client and the operation and maintenance database server is disconnected.

[0134] In some embodiments, regardless of whether the operation and maintenance client approves the operation instruction, the bastion host JDBC proxy program can send approval class indication information to the database client to inform the database client that the input operation instruction is a blocking class instruction or a session disconnection class instruction.

[0135] In some embodiments, when the bastion host JDBC proxy program forwards the operation result to the database client, it can simultaneously construct a log message and send it to the operation and maintenance forwarding program for viewing by the operation and maintenance client.

[0136] In some embodiments, when the bastion host JDBC proxy program detects that the operation and maintenance client disapproves the approval instruction (that is, the operation instruction input by the database client is a high-risk instruction) and causes operations such as session disconnection, it can send an end log message to the operation and maintenance forwarding program and end the bastion host proxy process; among them, the format of the bastion host JDBC proxy program sending the operation and maintenance end log message to the operation and maintenance forwarding program can be expressed as follows:

[0137] “{"url":" / rpc","method":"proxy_end","param":{"code":9999,"sid":"1E971CB109"}}”, where “code” represents the session status, and “9999” represents that the session ends successfully.

[0138] In summary, based on Figure 7 the method shown above, when the bastion host JDBC proxy program determines that the operation instruction is a blocking instruction or a session disconnection instruction, by auditing the instruction based on the operation and maintenance client and, when the audit passes, forwarding the operation instruction to the operation and maintenance database client, the real-time interactive processing of instruction-level auditing among the database client, the bastion host, and the operation and maintenance database server is realized.

[0139] Combined with Figure 6 and Figure 7As shown in the figure, in one embodiment, the method further includes: when, according to a high-risk instruction set, it is determined that the operation instruction is a second preset instruction based on the bastion host JDBC proxy program, disconnecting the execution process of the operation instruction; the second preset instruction includes a direct blocking instruction and / or a direct session termination instruction.

[0140] In some embodiments, when the bastion host JDBC proxy program determines that the operation instruction is a direct blocking instruction and / or a direct session termination instruction, it may construct pseudo-response information for the execution of the operation instruction and send it to the database client; when the database client receives the pseudo-response information, it may display as empty.

[0141] In some embodiments, when the bastion host JDBC proxy program determines that the operation instruction is a direct blocking instruction or a direct session termination instruction, it may construct a direct blocking instruction prompt message or a direct session termination instruction prompt message and send it to the database client to inform the database client that the input operation instruction is a direct blocking instruction or a direct session termination instruction.

[0142] In some embodiments, when the bastion host JDBC proxy program determines that the operation instruction is a direct blocking instruction or a direct session termination instruction, it may construct a log message and send it to the operation and maintenance forwarding program, and the operation and maintenance forwarding program writes the log message into the log database for easy viewing through the operation and maintenance client.

[0143] In one embodiment, when the operation instruction is a direct session termination instruction, based on the bastion host JDBC proxy program, forward the operation and maintenance shutdown request from the database client to the operation and maintenance database server, so that the operation and maintenance database server disconnects the communication connection with the database client based on the operation and maintenance shutdown request.

[0144] Wherein, the operation and maintenance shutdown request is used to represent a request for a communication shutdown method. Specifically, when the bastion host JDBC proxy program receives a request for a communication shutdown method from the database client, it calls the corresponding communication shutdown method in the java.sql package and sends it to the operation and maintenance database server. When the operation and maintenance database server receives the request for the communication shutdown method, it performs the communication shutdown operation and returns a response message, so that the operation and maintenance database server disconnects the communication connection with the database client.

[0145] Combined with the above content, in one embodiment, as Figure 8 shown, a flowchart of the approval instruction of the bastion host is provided. Taking the method applied to the Figure 1 bastion host JDBC proxy program 1048 therein as an example for illustration, it specifically includes the following steps:

[0146] S8021, receive an operation instruction from the database client.

[0147] S8022, determine the type of the operation instruction according to the high-risk instruction set.

[0148] S804, if the operation instruction is an alarm instruction, forward the operation instruction to the operation and maintenance database server; forward the response result of the operation and maintenance database server to the database client; construct an alarm instruction prompt message for the database client; construct a log message and send it to the operation and maintenance forwarding program.

[0149] S806, if the operation instruction is a blocking instruction in the approval category, send an instruction approval request to the operation and maintenance forwarding program; construct a query approval result request to the operation and maintenance forwarding program to query the approval result; if the approval is passed, forward the operation instruction to the operation and maintenance database server, and construct an approval instruction prompt message and send it to the database client; if the approval is not passed or times out, block the operation instruction, and construct a blocking message and send it to the database client; construct a log message and send it to the operation and maintenance forwarding program.

[0150] S808, if the operation instruction is a pass instruction, forward the operation instruction to the operation and maintenance database server; forward the response result of the operation and maintenance database server to the database client; construct a log message and send it to the operation and maintenance forwarding program.

[0151] S810, if the operation instruction is a session interruption instruction in the approval category, send an instruction approval request to the operation and maintenance forwarding program; construct a query approval result request to the operation and maintenance forwarding program to query the approval result; if the approval is passed, forward the operation instruction to the operation and maintenance database server; if the approval is not passed or times out, disconnect the session; construct a log message and send it to the operation and maintenance forwarding program; construct an approval instruction prompt message for the database client and disconnect the session connection.

[0152] S812, if the operation instruction is a direct blocking instruction, construct an instruction pseudo-response message and send it to the database client; construct a direct blocking instruction prompt message and send it to the database client; construct a log message and send it to the operation and maintenance forwarding program.

[0153] S814, if the operation instruction is a direct session interruption instruction, construct an instruction pseudo-response message and send it to the database client; construct a session interruption instruction prompt for the database client; construct a log message and send it to the operation and maintenance forwarding program; close the connection and disconnect the session.

[0154] In summary, through Figure 8As shown in the figure, the bastion host JDBC proxy program receives operation instructions, performs high-risk instruction detection, and performs corresponding forwarding, approval, and interception operations according to different instruction types (alarm type, approval type, direct blocking type, direct session termination type), and forwards the operation instruction response return result (i.e., the operation result), and writes relevant log information to the operation and maintenance forwarding program at the same time; so that during the process of performing database operation and maintenance operations, the bastion host JDBC proxy program intercepts and forwards the operation command requests of the database client according to the high-risk instruction rules in the previous configuration file. If it is an approval type instruction, the bastion host JDBC proxy program will establish connections and interact with the operation and maintenance client and the operation and maintenance forwarding program in real time to review the command. The operation and maintenance client can review the operation instructions of the database client in real time to approve or block. The bastion host JDBC proxy program forwards or blocks the operation instructions according to the instruction approval result of the operation and maintenance client, so as to realize the real-time interactive processing of operation instruction level review and blocking between the client, the bastion host and the database server, and improve the operation and maintenance security.

[0155] Based on Figure 6 and Figure 7 the content shown above, in one embodiment, as shown in Figure 9 a schematic flowchart of a process for obtaining an operation result from an operation and maintenance database server by a bastion host JDBC proxy program and forwarding the operation result to a database client is provided. Taking the bastion host 104 in Figure 1 as an example, the method includes the following steps:

[0156] S902, when, based on the bastion host JDBC proxy program, forwarding a status object creation request from a database client to an operation and maintenance database server and obtaining a status object creation success response message corresponding to the status object creation request from the operation and maintenance database server, receiving a parameter metadata method setting request from the database client.

[0157] Specifically, S902 includes S9021, S9022, S9023, S9024, and S9025; among them, S9021 is the process of the database client sending a status (Statement) object creation request to the bastion host JDBC proxy program; S9022 is the process of the bastion host JDBC proxy program sending a status object creation request to the operation and maintenance database server; S9023 is the process of the operation and maintenance database server sending a status object creation success response message to the bastion host JDBC proxy program based on the status object creation request; S9024 is the process of the bastion host JDBC proxy program sending a status object creation success response message to the database client; S9025 is the process of the database client sending a parameter metadata method setting request to the bastion host JDBC proxy program when receiving the status object creation success response message.

[0158] Among them, when the bastion host JDBC proxy program receives a status object creation request from the database client, it calls the creation method of the status object in the java.sql package and sends it to the operation and maintenance database server; among them, the parameter metadata method setting request is used to set the output format of the operation result, and the parameter metadata method setting request can include setting the maximum number of rows, etc., and "setting the maximum number of rows" can be expressed as setMaxRows().

[0159] S904. When, based on the bastion host JDBC proxy program, the parameter metadata method setting request is forwarded to the operation and maintenance database server and the setting success response information corresponding to the parameter metadata method setting request is obtained from the operation and maintenance database server, a result set metadata acquisition request from the database client is received.

[0160] Specifically, S904 includes S9041, S9042, S9043, and S9044; among them, S9041 is the process in which the bastion host JDBC proxy program sends a parameter metadata method setting request to the operation and maintenance database server; S9042 is the process in which the operation and maintenance database server sends a setting success response information to the bastion host JDBC proxy program based on the parameter metadata method setting request; S9043 is the process in which the bastion host JDBC proxy program sends a setting success response information to the database client; S9044 is the process in which the database client sends a result set metadata acquisition request to the bastion host when receiving the setting success response information; the result set metadata acquisition request includes obtaining the catalog, obtaining the schema, etc.

[0161] S906. When, based on the bastion host JDBC proxy program, the result set metadata acquisition request is forwarded to the operation and maintenance database server and the result set acquisition success response information corresponding to the result set metadata acquisition request is obtained from the operation and maintenance database server, a specific result set extraction request from the database client is received.

[0162] Specifically, S906 includes S9061, S9062, S9063, and S9064; among them, S9061 is the process in which the bastion host JDBC proxy program sends a result set metadata acquisition request to the operation and maintenance database server; S9062 is the process in which the operation and maintenance database server sends a result set acquisition success response information to the bastion host JDBC proxy program based on the result set metadata acquisition request; S9063 is the process in which the bastion host JDBC proxy program sends a result set acquisition success response information to the database client; S9064 is the process in which the database client sends a specific result set extraction request to the bastion host when receiving the result set acquisition success response information.

[0163] S908. When forwarding a specific result set extraction request to the operation and maintenance database server based on the bastion host JDBC proxy program and obtaining a successful response message for the specific result set extraction corresponding to the specific result set extraction request from the operation and maintenance database server, send a successful response message for result set extraction to the database client, so that the database client can obtain the operation result from the successful response message for specific result set extraction.

[0164] Specifically, S908 includes S9081, S9082, S9083, and S9084. Among them, S9081 is the process in which the bastion host JDBC proxy program sends a specific result set extraction request to the operation and maintenance database server; S9082 is the process in which the operation and maintenance database server sends a successful response message for specific result set extraction to the bastion host JDBC proxy program based on the specific result set extraction request; S9083 is the process in which the bastion host JDBC proxy program sends a successful response message for specific result set extraction to the database client, so that the database client can obtain the operation result from the successful response message for specific result set extraction.

[0165] It should be understood that although each step in the flowcharts involved in the above-described embodiments is shown in sequence according to the indication of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0166] Based on the same inventive concept, an embodiment of the present application also provides a bastion host-based operation and maintenance processing device for implementing the above-mentioned bastion host-based operation and maintenance processing method. The implementation solution provided by this device to solve the problem is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following bastion host-based operation and maintenance processing device can refer to the limitations on the bastion host-based operation and maintenance processing method in the above text, and will not be repeated here.

[0167] In one embodiment, as Figure 10 shown, a bastion host-based operation and maintenance processing device is provided, including: a startup module 1002, a loading module 1004, a communication establishment module 1006, an instruction acquisition module 1008, and a result acquisition module 1010, where:

[0168] The startup module 1002 is used to start the bastion host JDBC proxy program in the bastion host based on the command-line startup parameters when receiving a proxy program startup request; the command-line startup parameters include the database configuration information of the operation and maintenance database server; the loading module 1004 is used to call the bastion host JDBC proxy program based on the database configuration information to load the database JDBC driver corresponding to the operation and maintenance database server; the communication establishment module 1006 is used to establish a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program when the database client calls the proxy driver to send an operation connection request to the bastion host JDBC proxy program; the instruction acquisition module 1008 is used to receive an operation instruction from the database client based on the proxy driver; the result acquisition module 1010 is used to forward the operation result to the database client when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver.

[0169] In one embodiment, the bastion host includes: an operation and maintenance forwarding program and a monitoring forwarding program; when receiving a proxy program startup request, starting the bastion host JDBC proxy program in the bastion host according to the command-line startup parameters includes:

[0170] Based on the operation and maintenance forwarding program receiving a proxy program startup request from the operation and maintenance client;

[0171] Based on the operation and maintenance forwarding program forwarding the proxy program startup request to the monitoring forwarding program;

[0172] According to the command-line startup parameters, starting the bastion host JDBC proxy program; the command-line startup parameters further include the listening port number assigned by the monitoring forwarding program to the bastion host JDBC proxy program, so that the database client connects to the bastion host JDBC proxy program based on the listening port number.

[0173] In one embodiment, the communication establishment module is further configured to: when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, forward the operation and maintenance connection request to the operation and maintenance database server based on the bastion host JDBC proxy program; the operation and maintenance connection request includes the username and user password of the operation and maintenance database server; when the username and user password are verified correctly by the operation and maintenance database server, obtain a verification passed response message from the operation and maintenance database server based on the bastion host JDBC proxy program; when sending the verification passed response message to the database client based on the bastion host JDBC proxy program, receive a parameter configuration connection method from the database client; when forwarding the parameter configuration connection method to the operation and maintenance database server based on the bastion host JDBC proxy program, obtain a connection success response message for the parameter configuration connection method; when sending the connection success response message to the database client based on the bastion host JDBC proxy program, receive a metadata method acquisition request from the database client; when forwarding the acquisition success response message corresponding to the metadata method acquisition request from the operation and maintenance database server to the database client based on the bastion host JDBC proxy program, establish a communication connection between the database client and the operation and maintenance database server.

[0174] In one embodiment, the bastion host includes: an operation and maintenance forwarding program, a monitoring forwarding program, and a log database; the result acquisition module is further configured to: write the high-risk instruction set configured in the operation and maintenance client into the log database, and read the high-risk instruction set from the log database based on the operation and maintenance forwarding program; send the high-risk instruction set to the monitoring forwarding program based on the operation and maintenance forwarding program, so that the monitoring forwarding program stores the high-risk instruction set into the high-risk instruction set rule file; read the high-risk instruction set from the high-risk instruction set rule file based on the bastion host JDBC proxy program; when, according to the high-risk instruction set, it is determined that the operation instruction is a first preset instruction based on the bastion host JDBC proxy program, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forward the operation result to the database client.

[0175] In one embodiment, the first preset instruction includes a pass instruction, an alarm instruction, a blocking instruction, or a session termination instruction; the result acquisition module is further configured to perform at least one of the following:

[0176] First item: when, according to the high-risk instruction set, it is determined that the operation instruction is a pass instruction or an alarm instruction based on the bastion host JDBC proxy program, call the database JDBC driver based on the bastion host JDBC proxy program, and forward the operation instruction to the operation and maintenance database server; obtain the operation result from the operation and maintenance database server based on the bastion host JDBC proxy program, and forward the operation result to the database client;

[0177] Second item: When, according to the high-risk instruction set, it is determined based on the bastion host JDBC proxy program that the operation instruction is a blocking instruction or a session termination instruction, the instruction approval request is forwarded to the operation and maintenance client through the operation and maintenance forwarding program based on the bastion host JDBC proxy program; the instruction approval request includes the operation instruction; when the operation and maintenance client approves the operation instruction based on the instruction approval request, the operation instruction is forwarded to the operation and maintenance database server by calling the database JDBC driver based on the bastion host JDBC proxy program, the operation result is obtained from the operation and maintenance database server, and the operation result is forwarded to the database client.

[0178] In one embodiment, the result acquisition module is further configured to: when, according to the high-risk instruction set, the bastion host JDBC proxy program is a second preset instruction, disconnect the execution process of the operation instruction; the second preset instruction includes a direct blocking instruction and / or a direct session termination instruction.

[0179] In one embodiment, the result acquisition module is further configured to: when the operation instruction is a direct session termination instruction, forward the operation and maintenance shutdown request from the database client to the operation and maintenance database server based on the bastion host JDBC proxy program, so that the operation and maintenance database server disconnects the communication connection with the database client based on the operation and maintenance shutdown request.

[0180] Each module in the above operation and maintenance processing device based on the bastion host can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or independent of the processor, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0181] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 11 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the bastion host JDBC proxy program, the operation and maintenance forwarding program, the monitoring forwarding program, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an operation and maintenance processing method based on the bastion host.

[0182] Those skilled in the art can understand, Figure 11The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0183] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0184] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0185] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0186] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties.

[0187] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., and are not limited thereto.

[0188] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0189] The above-described embodiments merely represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. An operation and maintenance processing method based on a bastion host, characterized in that, applied to a bastion host, the method includes: When receiving a proxy program startup request, start the bastion host JDBC proxy program in the bastion host based on the command line startup parameters; the command line startup parameters include the database configuration information of the operation and maintenance database server; Based on the database configuration information, call the bastion host JDBC proxy program to load the database JDBC driver corresponding to the operation and maintenance database server; When the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, establish a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program; the proxy driver has a corresponding relationship with the bastion host JDBC proxy program; Receive an operation instruction from the database client based on the proxy driver; When it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forward the operation result to the database client.

2. The method according to claim 1, characterized in that, the bastion host includes: an operation and maintenance forwarding program and a monitoring forwarding program; When receiving a proxy program startup request, starting the bastion host JDBC proxy program in the bastion host according to the command line startup parameters includes: Receiving a proxy program startup request from an operation and maintenance client based on the operation and maintenance forwarding program; Forwarding the proxy program startup request to the monitoring forwarding program based on the operation and maintenance forwarding program; Start the bastion host JDBC proxy program according to the command line startup parameters; the command line startup parameters further include the listening port number assigned by the monitoring forwarding program to the bastion host JDBC proxy program, so that the database client connects to the bastion host JDBC proxy program based on the listening port number.

3. The method according to claim 1, characterized in that, When the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program, establishing a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program includes: When the database client calls the proxy driver to send the operation and maintenance connection request to the bastion host JDBC proxy program, forward the operation and maintenance connection request to the operation and maintenance database server based on the bastion host JDBC proxy program; the operation and maintenance connection request includes the username and user password of the operation and maintenance database server; When the username and user password are verified correctly by the operation and maintenance database server, obtain a verification passed response message from the operation and maintenance database server based on the bastion host JDBC proxy program; When sending the authentication - passed response information to the database client based on the bastion host JDBC proxy program, receive a parameter - configuration connection method from the database client; When forwarding the parameter - configuration connection method to the operation and maintenance database server based on the bastion host JDBC proxy program, obtain a connection - successful response information of the parameter - configuration connection method; When sending the connection - successful response information to the database client based on the bastion host JDBC proxy program, receive a metadata - method acquisition request from the database client; When forwarding the acquisition - successful response information corresponding to the metadata - method acquisition request from the operation and maintenance database server to the database client based on the bastion host JDBC proxy program, establish a communication connection between the database client and the operation and maintenance database server.

4. The method according to claim 1, wherein, the bastion host includes: an operation and maintenance forwarding program, a monitoring forwarding program, and a log database; Before forwarding the operation result to the database client when, based on the bastion host JDBC proxy program, it is determined that the operation instruction is a first preset instruction and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, further includes: Write the high - risk instruction set configured in the operation and maintenance client into the log database, and read the high - risk instruction set from the log database based on the operation and maintenance forwarding program; Send the high - risk instruction set to the monitoring forwarding program based on the operation and maintenance forwarding program, so that the monitoring forwarding program stores the high - risk instruction set into a high - risk instruction set rule file; Read the high - risk instruction set from the high - risk instruction set rule file based on the bastion host JDBC proxy program; When, based on the bastion host JDBC proxy program, it is determined that the operation instruction is a first preset instruction and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, and forwards the operation result to the database client, includes: When, based on the high - risk instruction set, it is determined that the operation instruction is a first preset instruction based on the bastion host JDBC proxy program and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forward the operation result to the database client.

5. The method according to claim 4, wherein, the first preset instruction includes a pass - through class instruction, an alarm - class instruction, a blocking instruction, or a session - termination instruction; When, according to the high-risk instruction set, it is determined based on the bastion host JDBC agent program that the operation instruction is a first preset instruction, and the bastion host JDBC agent program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver, forwarding the operation result to the database client includes at least one of the following: The first item: When, according to the high-risk instruction set, it is determined based on the bastion host JDBC agent program that the operation instruction is a pass class instruction or an alarm class instruction, calling the database JDBC driver based on the bastion host JDBC agent program and forwarding the operation instruction to the operation and maintenance database server; Obtaining the operation result from the operation and maintenance database server based on the bastion host JDBC agent program and forwarding the operation result to the database client; The second item: When, according to the high-risk instruction set, it is determined based on the bastion host JDBC agent program that the operation instruction is a blocking instruction or a session termination instruction, forwarding an instruction approval request through the operation and maintenance forwarding program to the operation and maintenance client based on the bastion host JDBC agent program; the instruction approval request includes the operation instruction; When the operation instruction is approved by the operation and maintenance client based on the instruction approval request, calling the database JDBC driver based on the bastion host JDBC agent program to forward the operation instruction to the operation and maintenance database server, obtaining the operation result from the operation and maintenance database server, and forwarding the operation result to the database client.

6. The method according to claim 5, wherein, the method further includes: When, according to the high-risk instruction set, it is determined based on the bastion host JDBC agent program that the operation instruction is a second preset instruction, disconnecting the execution process of the operation instruction; the second preset instruction includes a direct blocking class instruction and / or a direct session termination class instruction.

7. The method according to claim 6, wherein, the method further includes: When the operation instruction is a direct session termination class instruction, forwarding an operation and maintenance shutdown request from the database client to the operation and maintenance database server based on the bastion host JDBC agent program, so that the operation and maintenance database server disconnects the communication connection with the database client based on the operation and maintenance shutdown request.

8. An operation and maintenance processing device based on a bastion host, wherein, the device includes: A startup module, configured to start the bastion host JDBC agent program in the bastion host based on command line startup parameters when receiving a proxy program startup request; the command line startup parameters include database configuration information of the operation and maintenance database server; A loading module, configured to call the bastion host JDBC agent program based on the database configuration information and load the database JDBC driver corresponding to the operation and maintenance database server; A communication establishment module, configured to establish a communication connection between the database client and the operation and maintenance database server based on the bastion host JDBC proxy program when the database client calls the proxy driver to send an operation and maintenance connection request to the bastion host JDBC proxy program; the proxy driver has a corresponding relationship with the bastion host JDBC proxy program; An instruction acquisition module, configured to acquire an operation instruction from the database client based on the proxy driver; A result acquisition module, configured to forward the operation result to the database client when it is determined based on the bastion host JDBC proxy program that the operation instruction is a first preset instruction, and the bastion host JDBC proxy program obtains the operation result of the operation instruction from the operation and maintenance database server based on the database JDBC driver.

9. A computer device, including a memory and a processor, the memory stores a computer program, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • UKEY proxy implementation method of bastion host

    CN111224969A

  • Database high-risk instruction auditing method and system for bastion host

    CN115242473A