Operation and maintenance method and system for automatically and uniformly managing nodes of bastion host
By introducing the Central control machine and Master machine into the bastion machine system, combined with tools such as SaltStack, unified management of each node of the bastion machine is achieved, which solves the problems of difficult management and insufficient security of the bastion machine in a massive environment, and achieves high efficiency. , unified operation and maintenance management.
Patent Information
- Application Number
- PCT/CN2023/116980
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-02
- Filing Date
- 2023-09-05
- Publication Date
- 2024-09-06
AI Technical Summary
With a large number of hosts and users, the existing bastion host system has high operation and maintenance management costs, cannot guarantee security, and cannot achieve unified management, making management difficult.
Adopt an operation and maintenance method and system that automatically and uniformly manages each node of the bastion machine. By setting up the Central control machine and the Master machine, unified management of each node is achieved, including user permission control, machine monitoring, and automated task issuance and daily operation and maintenance. Execution, centralized management using tools such as SaltStack.
It achieves unified management of user permissions, machine monitoring and daily operation and maintenance, reduces management costs, improves security and automation, and can efficiently manage dozens or even thousands of nodes without changing management costs.
Smart Images

Figure CN2023116980_06092024_PF_FP
Abstract
Description
An operation and maintenance method and system for automatically and uniformly managing each node of a bastion host Technical Field
[0001] The present invention relates to an operation and maintenance management method, and in particular to an operation and maintenance method and system for automatically and uniformly managing nodes of a bastion host. Background Art
[0002] Shanghai Shangxun Information Technology Co., Ltd. disclosed a method for upgrading an operation and maintenance management system based on a bastion host in 202010956472X, wherein the method comprises: 1) uploading an upgrade file package to the system backend through the system foreground, and sending an upgrade command to the system backend, wherein the upgrade file package includes files to be upgraded and tool files; 2) the system backend obtains statistical information on the number of files to be upgraded as the denominator numerical information of the upgrade progress value information; 3) executing the tool file, copying the files to be upgraded to the corresponding target locations respectively, and recording the status information of each file to be upgraded in real time, 4) each time the tool file is executed, the numerator numerical information of the upgrade progress value information is increased by 1, wherein the numerator numerical information of the upgrade progress value information is initially 1; 5) according to the denominator numerical information and numerator numerical information of the upgrade progress value information, the upgrade progress value information is calculated in real time, and the upgrade progress value information is returned to the system foreground; 6) the upgrade progress value information is displayed in real time through the system foreground. Applying this application to the operation and maintenance management system can not only accurately display the upgrade process and progress, but also provide a tracking basis when an abnormality occurs in the upgrade.
[0003] Chengdu Hi-Tech Vision Digital Technology Co., Ltd. 202111093307.7 A method for operating and maintaining a host account without hosting through a bastion host, comprising: S1. The user logs in to the bastion host, and the bastion host verifies whether the logged-in username and password or key of the user's login credentials are correct. If correct, the user logs in to the bastion host through authentication; S2. After successfully logging into the bastion host, the operation and maintenance selects the host operation and maintenance login that needs to be accessed from the list of hosts that can be queried according to the user's permissions; S3. Determine whether the server password is hosted to the bastion host. If it is not hosted to the bastion host, the operation and maintenance manually enters the account password. If it is hosted to the bastion host, the password stored in the database is filled in to the server for authentication, thereby realizing password-free login. This solution can effectively solve the inconvenience of users operating and maintaining servers through the bastion host, has a higher degree of automation, can reduce the time for user operation and maintenance login, does not host the server login credentials to the bastion host, and reduces the risk of credential leakage.
[0004] Existing bastion host systems suffer from technical deficiencies that prevent unified management. With a large number of hosts and users, the overall bastion host operation and maintenance costs are high and security cannot be guaranteed. For example, a single host involves managing user machine permissions, machine monitoring, and daily operations and maintenance. If managed according to the aforementioned patent proposal, this would be costly, fragmented, and difficult to manage.
[0005] Summary of the Invention
[0006] The present invention provides an operation and maintenance method and system for automatically and uniformly managing each node of a bastion host, so as to solve the problems in the prior art of high cost, independent policies and overall difficulty in management.
[0007] In one aspect, the present invention provides a bastion host operation and maintenance method for automatically and uniformly managing each node, comprising:
[0008] S1: Set up the bastion structure:
[0009] Divide the network into independent areas for each business site, treating each independent network environment in a different region as an independent node. In each node, plan a machine as the node's security entrance login machine and a master machine as the node's operation and maintenance control. The master machine is responsible for managing all business hosts of the node.
[0010] Set up a central master machine, which serves as the login machine for each independent node and the superior master machine of the master machine. The central master machine is deployed with a web system, which has the global system build files and configuration information. The central master machine regularly synchronizes the node-related data with the master machine of each node.
[0011] S2: The Central master control machine issues a task to the Master machine of the target regional node. The task includes issuing one of the following tasks: user authority management, machine monitoring, and daily operation and maintenance for the target machine of the node;
[0012] S3: The Master machine sets up a sentinel program, and when it detects the task, it parses and completes the corresponding task operation.
[0013] Furthermore, issuing a user authority management task to a target machine of the target area node further includes:
[0014] The central control machine generates Local-Login RSA Keypairs for each user who applies and is authorized, and grants a user account on the login machine corresponding to the target regional node. This ensures that each user has their own independent account. The central control machine also records the user's permissions in the central control Redis database. The permissions further include the relevant node information, master machine, permission type, and permission validity period.
[0015] The Central control machine sends the corresponding task to the Login machine or Master machine of the relevant node with the corresponding authority;
[0016] The Master machine receives the task, creates the user's account information, and records the user-machine information including the permission validity period into the Redis database on the Login machine of the target area node corresponding to the permission adaptation node;
[0017] Each target area node periodically starts a rights recovery program to recover user-machine information whose rights have expired on that day and replaces user-machine information whose rights are about to expire with the agreed time;
[0018] When the Central control machine receives an emergency user permission management request, including employee resignation, it deletes the corresponding record in the central control Redis database and sends a user permission management task to the Master machine of the corresponding node to reclaim the user's machine permission.
[0019] Furthermore, it also includes: when a new machine accesses a certain node, executing the Salt-Master access management configured for the node: by running the access machine initialization script of the Master machine of the node, completing the initialization operation of the new machine, giving the new machine a standardized name and installing Salt-Minion, and configuring the Master machine to which it belongs, after execution, it is immediately accessed and managed by the Master machine of the node, and recording the Redis database of the node and the Redis database of the remote Central master control machine.
[0020] Furthermore, when a new machine accesses a node, the Salt-Master configured to perform access management of the node is executed, further including executing a preset publishing machine public key acquisition program to obtain the public key information corresponding to the new machine from the public key extension file in a preset location of the Redis database of the node;
[0021] When the Central master control machine generates Local-Login RSAKey pairs or public key updates for each user who applies and is authorized, it sends the public key update task to the Master machine of the relevant node where the user's authority is adapted.
[0022] The Master machine receives the public key update task and updates the new public key information in the public key extension file at the corresponding location of the node Redis database;
[0023] At the same time, the corresponding machine obtains the updated public key information corresponding to the new machine from the public key extension file in the preset position of the Redis database of the node.
[0024] Furthermore, the execution machine completes daily operation and maintenance tasks including:
[0025] When a new machine is connected to a node, the Salt-Master configured to manage access to the node further includes: obtaining a tool script library located in the Redis database of the node to facilitate synchronization of a series of tool scripts for user use; writing crontab tasks to pre-set locations, including disk cleanup tasks and salt-minion automatic startup tasks; and automatically configuring configuration files at the specified location;
[0026] The central control machine sends update and / or extension tasks including tool script libraries, crontab tasks, and configuration files to the corresponding master machine of the node;
[0027] The master machine of the corresponding node updates the tool script library, crontab tasks, and configuration file related content corresponding to the specified location;
[0028] The master machine takes over the corresponding machine to process the content related to the corresponding location.
[0029] Furthermore, it also includes:
[0030] The Central control machine sets the global system's build files and configuration information, regularly synchronizes and backs up core data to the Master machines of each node, and synchronizes the global system's build files and configuration information to the enterprise git repository;
[0031] When a problem occurs on the Central control machine, the build files and configuration information of the global system are updated to the enterprise git repository;
[0032] When a problem occurs on a Login machine or Master machine, a new Login machine and Master machine are generated using a template from the Central control machine.
[0033] Furthermore, it also includes:
[0034] The Central control machine acts as a dispatching center to manage the Login machines and Master machines of each independent node, thereby indirectly managing the host machines of each node in a unified manner;
[0035] The central control machine will deploy a web system to integrate various daily necessary functions, unify the collected data, and present the IT resource status of all nodes as a data overview, as well as display real-time monitoring related data according to application grouping dimensions.
[0036] Furthermore, it also includes:
[0037] A sentinel program is set up under each Master machine. It is responsible for monitoring and recording events on the node, including business host access and offline, and updating the configuration files used for local monitoring or batch operation and maintenance. The configuration files used for batch operation and maintenance further include configuration files for application group dimensions. An initialization script for connecting new machines is also set up on the Master machine of each node.
[0038] Once a node is connected to a new service host, the master machine of the node triggers a Salt-Minion access event: after the initialization script is executed on the new machine, the initialization steps are completed, including naming the new machine according to the three-part rule of application group-intranet IP-network zone, installing Salt-Minion on the new machine, and configuring the master machine to which it belongs;
[0039] When an application group updates its operation and maintenance management data, the node where the application group is located is determined. Through the Master machine of the corresponding node, the names of all machines in the same application group are obtained according to the application group field, and then the configuration files of the batch operation and maintenance management are written to these machines respectively through Salt-Minion.
[0040] Furthermore, it also includes:
[0041] Automatically generate a prometheus monitoring configuration file on the business host;
[0042] The local Master machine detects an alarm message and synchronizes the alarm message, including the host name where the alarm is located, to the Central Master Machine.
[0043] The central control machine resolves the application group and network area of the host where the alarm information is generated by the host name;
[0044] If the corresponding business host of this network area and / or this application group needs to be processed according to the alarm information, the corresponding execution task is sent to the Master machine of the adapter node.
[0045] Furthermore, it also includes:
[0046] When the Central control machine parses the name of the business host, it finds the Master machine to which it belongs based on the network zone field and executes the corresponding task;
[0047] After the initialization script is executed on the new machine, the new machine is named according to the three-part rule of application group-intranet IP-network area. Each network area has an independently named intranet IP, and the intranet IPs in different network areas can be the same.
[0048] Furthermore, it also includes:
[0049] The Login machine serves as the secure entry machine for the node, exposing the standard sshd port. Users log in to the corresponding Login machine by being assigned login_id_rsa to enter the intranet of the node.
[0050] Furthermore, it also includes: deploying basic components on the master machine of the node, which further includes: deploying Salt-Minion to receive scheduling tasks from the central master control machine; deploying Redis to record relevant data corresponding to user permissions in the node and machines, and deploying Salt-Master to receive and manage the business host with Salt-Minion installed in the node;
[0051] The Master machine serves as the operation and maintenance control machine for its network area. It does not expose any ports to the outside world and trusts the network access of the Central control machine internally.
[0052] After the initial installation of the Login machine and Master machine of each node is completed, the Central control machine synchronizes the basic template management of each of them: #salt-N login state.apply group.login completes the template synchronization of the Login machine, and #salt-N master state.apply group.master completes the template synchronization of the Master machine.
[0053] In a second aspect, the present invention further provides a bastion host operation and maintenance system for automatically and uniformly managing each node, including:
[0054] Bastion structure:
[0055] Divide the network into independent areas for each business site, treating each independent network environment in a different region as an independent node. Then, plan a machine in each node as the node's security entrance login machine and a master machine as the node's operation and maintenance control. The master machine is responsible for managing all business hosts of the node.
[0056] A central master control machine serves as the login machine and the superior master machine of each node. The central master control machine is deployed with a web system and has the global system's build files and configuration information. The central master control machine regularly synchronizes the corresponding node-related data with the master machine of each node. The central master control machine is used to issue a task to the master machine of the target regional node, including issuing one of the following tasks: user permission management, machine monitoring, and daily operation and maintenance for the target machine of the target regional node.
[0057] The Master machine is used to set up the Sentinel program, and when it detects the task, it analyzes and completes the corresponding task operation.
[0058] Furthermore, a Redis database is set up on each of the nodes, and its determined location stores the tool script library, crontab tasks and configuration files respectively. The tool script library is convenient for users to use the synchronization series of tool scripts; the crontab tasks include disk cleaning tasks and salt-minion automatic pull-up tasks;
[0059] The Master machine is also configured to receive updates and / or extension tasks including tool script libraries, crontab tasks, and configuration files sent by the Central master control machine to the Master machine of the corresponding node; and update the corresponding tool script libraries, crontab tasks, and configuration files at the specified location; and then take over the corresponding machine to process the content related to the corresponding location.
[0060] Compared with the existing technology, the present invention can achieve the following beneficial effects: whether it is the allocation of user permissions, the daily deployment of machine monitoring and network monitoring, or the batch management of daily operation and maintenance, this application can be abstracted as the master of a certain regional node dispatching a task to execute by the general control, which naturally achieves unified management; in the future, we can continue to follow this design concept, integrate the management of container clusters, and continuously expand the management objects to make its functionality more powerful and efficient. To some extent, there is no difference between a bastion host managing dozens of network areas and managing one network area; whether it is a few machines or dozens or thousands of machines, the management cost will not change much. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] FIG1 is a schematic diagram illustrating the operation and maintenance management system according to an embodiment of the present invention;
[0062] FIG2 is a schematic diagram showing the operation and maintenance management method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0063] Numerous solutions exist in the industry for the secure and efficient management of massive numbers of hosts. Ansible, Puppet, and SaltStack, among others, all address the issue of efficient and secure management of massive numbers of hosts in enterprises to a certain extent. Based on the timing of these tools' emergence, Puppet (full-featured and complex) came first, followed by Ansible (simple and convenient), and finally SaltStack (efficient and simple). SaltStack strikes a balance between these two approaches and introduces many new ideas. SaltStack is a centralized server infrastructure management tool based on a client / server architecture, with the management side called the Master and the clients called Minions. It offers configuration management, remote execution, and monitoring capabilities. While the open-source version of SaltStack only provides a basic solution, in practice, it still requires extensive maintenance skills, including grouping and monitoring configuration, as well as challenges such as the operation and maintenance of multiple independent network nodes. We aim to achieve unified management and automated monitoring of multiple network environments. We aim to achieve this without relying on cross-node network connectivity. While network connectivity can certainly address some of these issues, considering the need for more efficient real-time collection of monitoring data from massive business hosts within their respective intranets and the future expansion of ultra-large-scale IT systems, we are considering a separate and integrated node-based self-governance solution.
[0064] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that those skilled in the art may make several variations and improvements without departing from the scope of the present invention. These variations and improvements fall within the scope of protection of the present invention.
[0065] Please refer to Figure 1, which is a schematic diagram of a multi-operation and maintenance management system. This application will divide the network into independent zones for each business site, treating each regional independent VPC network (Virtual Private Cloud, hereinafter referred to as VPC network) environment as an independent node. Two machines will be planned within this node: a secure entry login machine (similar in function to the current jump server) and an operation and maintenance control master machine. Relevant basic services will be deployed on the login and master machines, respectively, and the master machine will be responsible for managing all business hosts in the node. This application can also plan a central central control machine as the superior master machine of the login master of each independent node. In this way, the central control machine will act as a scheduling center to manage the login and master machines of each independent node, thereby indirectly unifying the management of all node hosts. In this application, the central control machine will deploy a web system to integrate various daily necessary functions. It will unify the collected data to display the IT resource status of all nodes as a data overview, and display real-time monitoring data by application grouping, so that users can have a clear understanding of all IT resources.
[0066] This embodiment provides a multi-operation and maintenance management system, which further includes:
[0067] Multiple independent nodes 21, 22, and 23: Divided by the independent network areas of their respective business sites, each independent VPC network (Virtual Private Cloud) environment in a different region is considered an independent node. Each node includes at least one machine as the node's secure entry login machine 211 and a master machine 212 as the node's operation and maintenance control. The master machine 212 can manage multiple business hosts 213. Among them:
[0068] A sentinel program is set up under each Master machine 212 to monitor and record events on the node, including business host access and offline events, and to update configuration files used for local monitoring or batch operations and maintenance. Batch operations and maintenance configuration files further include configuration files for application groups. An initialization script for connecting new machines is set up on each node's Master machine 212: once a node connects to a new business host 213, the node's Master machine 212 triggers a Salt-Minion access event.
[0069] The Salt-Minion access event may further include: after executing the initialization script on the new business host 213, completing the initialization steps including naming the new machine according to the three-segment rule of application group-intranet IP-network area, installing Salt-Minion on the machine, and configuring the corresponding Master machine 212.
[0070] A Central master control machine 10 serves as the superior Master machine of the Login machine 211 and Master machine 212 of each independent node; the Central master control machine is deployed with a WEB system, which has the construction files and configuration information of the global system. The Central master control machine 10 regularly synchronizes the node-related data with the Master machine 212 of each node. When an application group updates its operation and maintenance management data, it determines the node where the application group is located. Through the Master machine 212 of the corresponding node, according to the application group field, it obtains the names of all machines in the same application group, and then writes the batch operation and maintenance management configuration files to the machines through Salt-Minion.
[0071] The core of the present invention lies in the separation of powers. Login machine 211 is solely responsible for secure login access; Master machine 212 is solely responsible for executing scheduling tasks; and Central master control machine 10 is solely responsible for dispatching and dispatching tasks. This system is highly secure and reliable. For example, a service issue with Central master control machine 10 will not affect assigned permissions. Furthermore, each node is independent and does not affect one another. Furthermore, Login and Master serve as "managers" in a sense. If an unrecoverable exception occurs on a node's Login or Master machine, the Central master control machine 10 can quickly regenerate a new Login or Master for that node. This is because the Central master control machine possesses the configuration data for each node's Login machine 211 and Master machine 212, as well as the complete historical data on system permission allocations. This allows for rapid generation. Furthermore, data on the Central master control machine 10 is backed up daily, and data related to that node is synchronized to the corresponding node's Master machine 212 daily (daily is just an example, but primarily at a specified period). This ensures that the master control data is highly secure, and the system can expand and manage new nodes based on actual project and enterprise development needs. That is, unify the configuration management of each node host: adopt the master control + distributed bastion host architecture, and the corresponding working mechanism of the supporting architecture to unify the configuration management of each node host and realize multi-node operation and maintenance.
[0072] The following is an explanation through specific embodiments, the core part of which is:
[0073] User machine permissions: In essence, the Central control machine 10 schedules a Master machine 212 to issue a task to a user to create his account under a certain machine.
[0074] Machine monitoring: In essence, the Central control machine 10 dispatches a Master machine 212 to deploy a monitoring agent program to all business machines in the node.
[0075] Daily operation and maintenance is similar: a task is performed on a group of machines or global machines on a Master machine 212.
[0076] Therefore, whether it is the allocation of user permissions, the daily deployment of machine monitoring and network monitoring, or the batch management of daily operation and maintenance, this application can be abstracted as the master of a regional node dispatching a task under the general control scheduling, which naturally achieves unified management. In the future, we can continue to follow this design concept and integrate the management of container clusters, continuously expand the management objects, and make its functionality more powerful and efficient. To some extent, there is no difference between a bastion host managing dozens of network areas and managing one network area. Whether it is a few machines or dozens or thousands of machines, the management cost will not change much.
[0077] The present invention sets the operation of each machine / user in the node as executing a task on a certain machine, a certain group of machines, or a global machine. Permission management, daily operation and maintenance, security management, etc. are uniformly set as task control based on a certain node and a certain machine.
[0078] Furthermore, the master machine 212 in this node serves as the master control for that node. It pre-populates the relevant content, including a tool script library, crontab tasks, and configuration files, in the node's Redis database. When a new machine is connected to a node, it is configured to perform access management for the node's Salt-Master. This process involves running the access machine initialization script on the node's master machine 212, completing the machine's initialization, giving it a standardized name, installing a Salt-Minion, and configuring its associated master machine. After execution, the machine is immediately accessed and managed by the node's master machine, recording both the node's Redis database and the Redis database of the remote central master control machine. The more important aspects of access management are obtaining the tool script library, completing crontab tasks, and automatically configuring configuration files. When this information needs to be customized, updated, or modified, it is also sent to the master machine 212 via the central master control machine 10 in the form of a task. Once the master machine 212 is updated to the corresponding location, it controls the corresponding machine through the takeover program to complete the corresponding task.
[0079] This type of operation and maintenance management achieves unified management and has strong scalability.
[0080] Referring to FIG. 2 , this embodiment provides a bastion host operation and maintenance method for automatically and uniformly managing each node, including:
[0081] S110: Set up the fortress structure:
[0082] Divide the network into independent areas for each business site, treating each independent network environment in a different region as an independent node. In each node, plan a machine as the node's security entrance login machine and a master machine as the node's operation and maintenance control. The master machine is responsible for managing all business hosts in the node.
[0083] Set up a central master machine, which serves as the login machine for each independent node and the superior master machine of the master machine. The central master machine is deployed with a web system, which has the global system build files and configuration information. The central master machine regularly synchronizes the node-related data with the master machine of each node.
[0084] S120: The central master control machine issues a task to the master machine of the target regional node. The task includes issuing one of the following tasks: user authority management, machine monitoring, and daily operation and maintenance for the target machine of the node;
[0085] S130: The Master machine sets up a sentinel program, and when detecting the task, analyzes and completes the corresponding task operation.
[0086] Once a node is connected to a new business host, the master machine of the node triggers a Salt-Minion access event: after the initialization script is executed on the new machine, the initialization steps are completed, including naming the new machine according to the three-part rule of application group-intranet IP-network zone, installing Salt-Minion on the new machine, and configuring the master machine to which it belongs;
[0087] When an application group updates its operation and maintenance management data, the node where the application group is located is determined. Through the Master machine of the corresponding node, based on the application group field, the names of all machines in the same application group are obtained, and then the configuration files of the batch operation and maintenance management are written to these machines separately through Salt-Minion.
[0088] When the Central control machine parses the name of the business host, it finds the Master to which it belongs based on the network area field and executes the corresponding task.
[0089] After the initialization script is executed on the new machine, the new machine is named according to the three-part rule of application group-intranet IP-network area. Each network area has an independent named intranet IP, and the intranet IPs in different network areas can be the same.
[0090] The system default machine naming rule is "application group - intranet IP - network zone". Application group - intranet IP - network zone describes the application group to which the machine belongs, the network zone (i.e., node information) to which the machine belongs, and the intranet IP information of the machine within the network zone. The new machine is located by the network zone (i.e., node information) to which the machine belongs and the intranet IP information of the machine within the network zone. For example: gateway-192.168.104.214-Hangzhou
[0091] This machine name can be resolved in the entire multi-operation and maintenance management system as a gateway machine. Its intranet IP is 192.168.104.214, and this machine is in the Hangzhou network area.
[0092] When the user submits the permission application for the above machine, the Central control machine can find the scheduling master to which it belongs to execute the task based on the network area field, so the local IP address in each network area can be repeated without affecting the global management of the system.
[0093] For the "sentinel" program of each node, when a new machine is connected to the node, it can naturally be segmented by field, such as according to the application group field, to obtain the names of all machines in the same application group, and then write them into the configuration file of batch operation and maintenance management.
[0094] Such as / etc / salt / master.d / nodegroup.conf and / etc / ansible / hosts
[0095] It can also automatically generate a Prometheus monitoring configuration file, for example: ... -targets: -192.168.104.214:9100 labels: group:gateway ip:192.168.104.214 region:Hangzhou instance:gateway-192.168.104.214-Hangzhou ...
[0096] In this way, once an alarm is triggered, the system can clearly see which network area the alarm comes from and what business machine it belongs to. These capabilities are derived from the system's very concise three-part naming structure.
[0097] In addition, this method also needs to explain the benefits of the three-power separation management method, including the Login machine and the Master machine. The Login machine serves as the secure entry machine of the node, exposing the standard sshd port to the outside. Users log in to the corresponding Login machine by being assigned login_id_rsa to enter the intranet of the node. Deploy basic components on the Master machine of the node, which further includes: deploying Salt-Minion to receive scheduling tasks from the Central master control machine; deploying Redis to record relevant data corresponding to user permissions in this node-machine, and deploying Salt-Master to receive and manage the business host with Salt-Minion installed in this node. The Master machine serves as the operation and maintenance control machine in the network area where it is located. It does not expose any ports to the outside and trusts the network access of the Central master control machine internally. After the initial installation of Login and Master of each node is completed, the Central master control machine synchronizes their basic template management:
[0098] #salt-N login state.apply group.login completes template synchronization on the Login machine;
[0099] #salt-N master state.apply group.master Complete template synchronization on the Master machine.
[0100] In fact, for the Central machine, a single command salt'*'state.apply can complete the template synchronization management of two groups of machines on a node, including the synchronization of the basic configurations of the two groups of machines, the distribution of the "sentinel" program on each node, and so on.
[0101] Specifically, the initialization of a new machine means that the new machine is connected and managed by the Salt-Master of the node where it is located. The Master of each node has an access machine initialization script, which is executed immediately after the new machine is initialized. The core function of this script is to standardize the naming of the new machine, install Salt-Minion and configure the Master to which it belongs. After execution, it is immediately connected and managed by the Master machine of the node where it is located, and the access event is triggered at the same time, recording the Redis in this area and the Redis of the remote master control.
[0102] The Central control machine contains the global system build files and configurations, including each node's Login and Master machines. Core data is regularly backed up and synchronized with each node's Master machine. Generally, all files in the global control system are also synchronized to the enterprise Git repository to ensure they are not lost. This setup prevents the loss of core system configuration files. Furthermore, if a Central control machine experiences a problem, the system can download the global system build files from any Master or Git repository and quickly build a new Central control machine. Furthermore, if a Login or Master machine experiences a problem, the Central control machine can also generate a new Login or Master machine using templates and core data.
[0103] For user machine authority management, the Central master control machine schedules the adaptation Master to issue a task to the user to create his account under the corresponding machine; for machine monitoring operation, the Central master control machine schedules the adaptation Master to issue a task to deploy the monitoring agent program to all business machines in the node; for daily operation and maintenance operation, the Central master control machine executes a task on the adaptation group machine or the global machine in the adaptation Master to achieve unified management. Therefore, whether it is the allocation of user permissions, the daily deployment of machine monitoring and network monitoring, or the batch management of daily operation and maintenance, this system can be abstracted as the Central master control machine scheduling the Master of a certain regional node to issue a task to execute a certain task, which naturally achieves unified management; the subsequent invention can also continue to follow this design concept, integrate the management of container clusters, and continuously expand the management objects to make its functionality more powerful and efficient. To some extent, there is no difference between the system managing dozens of network areas and managing one network area; whether it is a few machines or dozens or thousands of machines, the system management cost is similar.
[0104] As described above, the Master machine of the corresponding node obtains the names of all machines in the same application group based on the Application Group field, and then writes the batch operation and maintenance management configuration file to each of these machines through Salt-Minion. This further includes: scheduling the adaptation Master through the Central Master Control Machine to execute the corresponding configuration file on machines that meet the requirements, where meeting the requirements further includes the application group name meeting the requirements. Application groups can be divided into application groups for different machines based on the functions implemented in the management system, or they can be divided into application groups for different machines based on the applications implemented in the management system. This three-part naming method and system management method, in the present invention, can achieve batch management of business machine clusters based on the application group dimension.
[0105] In addition, in this method, when a new business host is connected, a prometheus monitoring configuration file can be automatically generated; the local Master machine detects an alarm message and synchronizes the alarm message including the host name where the alarm is located to the Central master control machine; the Central master control machine resolves the application group and network area where the alarm information host is located through the host name where the alarm message occurs; if the corresponding business host of this network area and / or this application group needs to be processed according to the alarm message, the corresponding execution task is sent to the Master machine of the adapter node.
[0106] The monitoring configuration file for Prometheus that is automatically generated on the business host further includes:
[0107] The core configuration is uniformly distributed from the Central Control to each node Master, specifically to the monitoring object of each node: when a new service host is connected to the node, the configuration is automatically generated on the host;
[0108] Through the cloud service provider's API, Aliyun and AWS cloud monitoring data collection and alarm configuration are configured. The Prometheus network monitoring component blackbox_exporter is also deployed on the master machine as the network monitoring detection service for the node.
[0109] When the business host accesses the node, it obtains the Prometheus monitoring configuration file through the Master machine of this node;
[0110] Set three alarm levels: info / warning / critical: this node collects monitoring data -> this node matches the warning rules -> this node issues local alarm self-management, including telephone alarms. At the same time, it also initiates monitoring detection of the Central master control machine itself and issues early warning notifications in a timely manner. Of course, the Central master control machine itself also initiates relevant service detection of the Master of each node to complete the self-monitoring of the system itself. In this way, no matter whether there is a problem with the basic service of the Central master control machine or the basic service managed by each Master, an alarm will be received and handled in a timely manner.
[0111] In addition, after the new machine executes the access script, it completes the management of the Master in the region. According to the default SaltStack execution template rules set in this application, a series of template actions will be performed on the new machine, mainly including 7 general templates (7 general templates are only examples and are not used to limit the present invention):
[0112] 1. The synchronization series of tool scripts are in the / opt / sys / directory of the new machine, including the init.sh initialization script, the name.sh renaming script, and the src.sh basic software installation script written in this application. These scripts can be continuously expanded according to our daily work. That is to say, after the new machine is taken over, we agree that some of the tool scripts required by default are in the / opt / sys / directory, which is convenient for every technician to use. Moreover, when a script needs to be updated, all scripts in the system can be updated to the same version through the above method.
[0113] 2. Write the default crontab tasks, including disk cleaning tasks and salt-minion automatic pull-up tasks (placed in salt-minion due to various abnormal disconnection problems). Of course, these basic tasks can also be continuously expanded according to the needs of daily work.
[0114] 3. Execute the default basic configuration, such as the default public key information to be entered. This information can be customized and extended in the / srv / pillar / master.sls of each node. For example, once a new machine is connected, the public key of the publishing machine is immediately entered, thus completing the channel problem of the publishing machine public key. At the same time, some basic environment variables can be automatically synchronized, the business operation account that the system needs to create by default, etc., and the machine connection number configuration has been adjusted.
[0115] 4. Install defined basic tools, such as vim, wget, etc.
[0116] 5. Automatically configure a custom secure sshd configuration file. By default, password authentication, full private key authentication, and the node's trusted intranet IP and whitelist users are prohibited.
[0117] 6. Automatically synchronize salt-minion configuration
[0118] 7. Automatically set the network parameters of the new machine
[0119] 8. A custom template, each node can customize related management tasks according to the needs of the node
[0120] Because each Master's template configuration file is sent and synchronized by the master control machine, the extension changes of these template files are also updated by the master control and then synchronized to the Master of each node. The master control will be responsible for updating and synchronizing the above 7 common initialization templates. It can also be agreed that some templates or files are customized by the node, and the master control will not update them. This is to ensure the consistency of some global templates, tools, and files of the entire network and will not be maliciously adjusted or modified. The above 7 common templates and the 8th custom template are only examples, and only some of the common templates can be used. In addition, the 8th custom template is set by each node. Only after the Master machine of this node takes over, it will take over the corresponding machine according to the custom template to complete the corresponding task.
[0121] Corresponding to the above template settings, the following basic components are generally deployed on the Master machine of each node:
[0122] 1. Salt-Master is the Salt control machine, which receives the business Salt-Minion machine in the management node network
[0123] 2. Salt-API / Salt-Minion receives the scheduling tasks of the master control Central machine
[0124] 3.Nginx local network area Salt source, ensure that the business machine in the network area downloads and updates Salt-Minion
[0125] 4. Influxdata time series database, accessing all business host monitoring data managed by the Master
[0126] 5. Ansible is also deployed on the control machine to facilitate management by operation and maintenance personnel familiar with Ansible
[0127] 6. Prometheus is also deployed on the control machine, responsible for monitoring and alerting the node resources; it has peer-monitored the related services of the Central machine.
[0128] 7. Some commonly used management tools are generated by default under / opt / sys. You can read them and use them as needed.
[0129] Similarly, the basic components deployed on the Central control machine can be:
[0130] 1. OpenResty Web Server
[0131] 2. The Redis database records the full amount of user permissions for each node - machine corresponding data
[0132] 3.PostgreSQL records the information of registered users of the system
[0133] 4.Matrix scheduling controller, responsible for scheduling Login and Master to perform related tasks
[0134] 5. Prometheus monitoring system, responsible for monitoring the Login and Master machine related services of each node
[0135] Based on the above settings, issuing user permission control tasks to the target machine of the node further includes:
[0136] The central control machine generates Local-Login RSA Keypairs for each user who applies and is authorized, and grants the user account on the login machine that created the corresponding node, so that each user has their own independent account. The central control Redis database records the user's permissions, which further include the relevant node information, master machine, permission type, and permission validity period.
[0137] The Central master control machine sends the Central corresponding task to the Login or Master machine of the relevant node with the corresponding authority;
[0138] The Master receives the task, creates the user's account information, and records the user-machine information, including the permission validity period, in the Redis database on the corresponding node Login.
[0139] Each node periodically starts the permission recovery program to recover the user-machine information whose permissions have expired that day and pass the user-machine information whose permissions are about to expire at the agreed time;
[0140] When the Central control machine receives an emergency user permission management request, including employee resignation, it deletes the corresponding record in the central control Redis database and sends a user permission management task to the Master machine of the corresponding node to reclaim the user's machine permission.
[0141] In this invention, the system expands and upgrades SaltStack's simple one-level management structure, Master-Minion, to a multi-level management structure, Master-Master-Minion (which is the foundation of distribution). Furthermore, traditional password authentication is discarded for user management. Local-Login RSA key pairs are generated for each user, and a user account for the corresponding node Login is created based on the administrator's authorization, allowing each user to have their own independent account. Furthermore, while simple SaltStack performs stateless task execution, the system adds a database to store related tasks and implements stateful task execution management, allowing us to clearly record which user has which Login or Master permissions, etc. At the same time, a "Sentinel" program has been developed for each Master management machine, which is responsible for monitoring and recording the machine access and offline events of the node, linking to update the configuration files used for local monitoring or batch operation and maintenance, and synchronizing data to the Central master control machine for summary display, such as the total number of regional nodes in the system, the number of applications distributed on each node, the number of machines for each application, etc. The Sentinel program is also responsible for writing the monitoring data collected in real time on the local network in both directions, one copy is written to the local time series database record, and the other copy is written to the remote Central master control cache data as a real-time monitoring data display.
[0142] When a new machine is connected to a node, it is configured to access and manage the Salt-Master of the node: by running the access machine initialization script of the Master machine of the node, the machine initialization operation is completed, the machine is standardized named and Salt-Minion is installed, and the Master machine to which it belongs is configured. After execution, it is immediately accessed and managed by the Master machine of the node, and the Redis database of this node and the Redis database of the remote Central master control machine are recorded.
[0143] When a new machine accesses a node, executing the Salt-Master access management configured for the node further includes executing a preset publishing machine public key acquisition procedure to obtain the public key information corresponding to the machine from the public key extension file in a preset location of the Redis database of the node;
[0144] When the Central master control machine generates Local-Login RSAKey pairs or public key updates for each user who applies and is authorized, it sends the public key update task to the Master machine of the relevant node where the user's authority is adapted.
[0145] The Master machine receives the public key update task and updates the new public key information in the public key extension file at the corresponding location in the Redis database of the node;
[0146] At the same time, the corresponding machine obtains the updated public key information of the machine from the public key extension file in the pre-set location of the Redis database of this node.
[0147] The execution machine completes daily operation and maintenance tasks, including: when a new machine is connected to a node, executing the Salt-Master configured to manage the node, further including: obtaining the tool script library located in the Redis database of this node to facilitate the synchronization of a series of tool scripts for users; writing crontab tasks in pre-set locations, including disk cleaning tasks and salt-minion automatic pull-up tasks; and automatically configuring the configuration files in the specified location;
[0148] The Central control machine sends update and / or expansion tasks, including tool script libraries, crontab tasks, and configuration files, to the Master machine of the corresponding node;
[0149] The Master machine of the corresponding node updates the tool script library, crontab tasks, and configuration files corresponding to the specified location;
[0150] The master machine takes over the corresponding machine to process the content related to the corresponding location.
[0151] The Central control machine sets the global system's build files and configuration information, regularly synchronizes and backs up core data to the Master machine of each node, and synchronizes the global system's build files and configuration information to the enterprise git repository. When a problem occurs on the Central control machine, the global system's build files and configuration information are updated to the enterprise git repository. When a problem occurs on a Login machine or Master machine, a new Login and Master are generated using a template obtained from the Central control machine.
[0152] In another embodiment of the present invention, a bastion host operation and maintenance system for automatically and uniformly managing each node is proposed, further comprising:
[0153] Bastion structure:
[0154] Divide the network into independent areas for each business site, treating each independent network environment in a different region as an independent node. In each node, plan a machine as the node's security entrance login machine and a master machine as the node's operation and maintenance control. The master machine is responsible for managing all business hosts in the node.
[0155] A central master control machine serves as the login machine and the superior master machine of each independent node. This central master control machine is deployed with a web system and contains the global system's build files and configuration information. This central master control machine regularly synchronizes node-related data with the master machine of each node. The central master control machine is used to issue a task to the master machine of the target regional node, including issuing one of the following tasks: user permission management, machine monitoring, and daily operation and maintenance for the target machine of the node.
[0156] The Master machine is used to set up the Sentinel program, and when it detects the task, it analyzes and completes the corresponding task operation.
[0157] Set up a Redis database on each node, and determine its location to store the tool script library, crontab tasks, and configuration files. The tool script library is convenient for users to use the synchronization series of tool scripts; crontab tasks include disk cleanup tasks and salt-minion automatic pull-up tasks;
[0158] The Master machine is also configured to receive updates and / or extension tasks including tool script libraries, crontab tasks, and configuration files sent by the Central master control machine to the Master machine of the corresponding node; and update the corresponding tool script libraries, crontab tasks, and configuration files at the specified location; and then take over the corresponding machine to process the content related to the corresponding location.
Claims
1. A bastion host operation and maintenance method for realizing automatic and unified management of each node, characterized in that: include: S1: Set up the bastion architecture: Divide the network into independent areas according to the business sites, and treat each independent network environment in different regions as an independent node. Then plan a machine in each node as the node's security entrance login machine and a master machine as the node's operation and maintenance control. The master machine is responsible for managing all business hosts of the node. Set up a Central master machine as the Login machine and the superior Master machine of the Master machine of each node; the Central master machine is deployed with a WEB system and has the construction files and configuration information of the global system. The Central master machine regularly synchronizes the corresponding node-related data with the Master machine of each node; S2: The Central master control machine sends a task to the Master machine of the target regional node to execute, and the task includes sending one of the tasks including user authority management, machine monitoring, and daily operation and maintenance to the target machine of the target regional node; S3: The Master machine sets up a sentinel program, and when it detects the task, it parses and completes the corresponding task operation.
2. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 1, characterized in that: Sending a user authority management task to a target machine of the target area node further includes: The Central master control machine generates Local-Login RSA Key pairs for each user who applies and is authorized, and gives the user account on the Login machine corresponding to the target regional node, so that each user has his own independent account, and records the user's authority in the master control Redis database. The authority further includes the relevant node information, Master machine, authority type, and authority validity length that are adapted to the authority; The Central master control machine sends the corresponding task to the Login machine or Master machine of the relevant node with the corresponding authority; The Master machine receives the task, creates the user's account information and records the user-machine information including the permission validity period to the corresponding node of the relevant node that matches the permission. Login to the Redis database on the target region node machine; Each of the target area nodes periodically starts a permission recovery program to recover user-machine information whose permissions have expired on that day and pass user-machine information whose permissions are about to expire at an agreed time; When the Central master control machine receives emergency user authority management including personnel resignation, it deletes the corresponding record in the master control Redis database and sends the Master machine of the corresponding node a user authority management task to reclaim the user's machine authority.
3. The bastion host operation and maintenance method for realizing automatic unified management of each node as described in claim 1 or 2, characterized in that: Also includes: When a new machine accesses a certain node, it executes the Salt-Master access management configured for the node: by running the access machine initialization script of the Master machine of the node, the initialization operation of the new machine is completed, the new machine is standardizedly named and Salt-Minion is installed, and the Master machine to which it belongs is configured. After execution, the new machine is immediately accessed and managed by the Master machine of the node, and the Redis database of the node and the Redis database of the remote Central master control machine are recorded.
4. The bastion host operation and maintenance method for realizing automatic unified management of each node as described in claim 3 is characterized in that: When a new machine accesses a node, the Salt-Master access management configured to perform the node is executed, further including executing a preset publishing machine public key acquisition program to obtain the public key information corresponding to the new machine from the public key extension file at a preset location of the Redis database of the node; When the Central master control machine generates Local-Login RSA Key pairs or public key updates for each user who applies and is authorized, it sends the public key update task to the Master machine where the relevant node that matches the user's authority is located. The Master machine receives the task of updating the public key, and updates the new public key information in the public key extension file at the corresponding position of the Redis database of the node; At the same time, the corresponding machine obtains the updated public key information corresponding to the new machine from the public key extension file at a preset position of the Redis database of the node.
5. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 3, characterized in that: The execution machine completes daily operation and maintenance tasks including: When a new machine accesses a node, the Salt-Master access management configured to perform the node further includes: obtaining a tool script library located in the Redis database of the node to facilitate the synchronization of a series of tool scripts for users; writing a crontab task in a preset location, Including disk cleaning tasks and salt-minion automatic pull-up tasks; automatic configuration of configuration files in specified locations; The Central master control machine sends update and / or extension tasks including tool script libraries, crontab tasks, and configuration files to the corresponding Master machines of the nodes; The corresponding master machine of the node updates the tool script library, crontab tasks, and configuration file related contents corresponding to the specified location; The Master machine takes over the corresponding machine to process the content related to the corresponding location.
6. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 1, characterized in that: Also includes: The Central master control machine sets the build files and configuration information of the global system, regularly synchronizes and backs up the core data to the Master machines of each node, and synchronizes the build files and configuration information of the global system to the enterprise git repository; When a problem occurs on the Central master control machine, the build files and configuration information of the global system are updated to the enterprise git repository; When a problem occurs on a Login machine or Master machine, a new Login machine and Master machine are generated using a template from the Central control machine.
7. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 1, characterized in that: Also includes: The Central master control machine acts as a dispatch center to manage the Login machines and Master machines of each independent node, thereby indirectly managing the host of each node in a unified manner; The Central control machine will deploy a WEB system to integrate various daily necessary functions. - The collected data are used as a data overview to display the IT resource status of each node, and real-time monitoring related data according to the application grouping dimension.
8. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 1, characterized in that: Also includes: A sentinel program is set up under each Master machine. The sentinel program is responsible for monitoring and recording events including business host access and offline of the node, and updating the configuration files used for local monitoring or batch operation and maintenance in a linked manner. The configuration files used for batch operation and maintenance further include configuration files of the application group dimension; and an initialization script for accessing a new machine is set up on the Master machine of each node; Once a node is connected to a new service host, the master machine of the node triggers Salt-Minion access event: After the initialization script is executed on the new machine, the initialization steps are completed, including naming the new machine according to the three-stage rule of application group-intranet IP-network area, installing Salt-Minion on the new machine, and configuring the corresponding Master machine; When an application group updates its operation and maintenance management data, the node where the application group is located is determined, and through the Master machine of the node where the application group is located, all machine names of the same application group are obtained according to the application group field, and then the configuration files of the batch operation and maintenance management are written to the machines respectively through Salt-Minion.
9. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 8, characterized in that: Also includes: Automatically generate a prometheus monitoring configuration file on the business host; The local Master machine detects an alarm message, and the alarm message including the host name where the alarm is located is synchronized to the Central master control machine; The central master control machine resolves the application group and network area of the host where the alarm information is generated by the host name of the alarm information; If the corresponding service host of the network area and / or the application group needs to be processed according to the alarm information, the corresponding execution task is sent to the Master machine of the adapter node.
10. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 8, characterized in that: Also includes: When the Central control machine parses the name of the business host, it finds the Master machine to which it belongs based on the network area field and executes the corresponding task; After the initialization script is executed on the new machine, the new machine is named according to the three-stage rule of application group-intranet IP-network area. Each network area has an independently named intranet IP, and the intranet IPs in different network areas can be the same.
11. The bastion host operation and maintenance method for realizing automatic and unified management of each node as claimed in claim 8, characterized in that: Also includes: The Login machine serves as the secure entry machine of the node, exposing the standard sshd port to the outside. Users log in to the corresponding Login machine by being assigned login_id_rsa to enter the intranet of the node.
12. The bastion host operation and maintenance method for realizing automatic unified management of each node as claimed in claim 8, characterized in that: Also includes: Deploy basic components on the master machine of the node, which further includes: deploying Salt-Minion to receive scheduling tasks from the central master control machine; Deploy Redis to record the relevant data corresponding to the user authority-machine in the node, and deploy Salt-Master to receive and manage the business host with Salt-Minion installed in this node; The Master machine is the operation and maintenance control machine in the network area. It does not expose any ports to the outside world and trusts the network access of the Central master control machine internally. After the initial installation of the Login machine and the Master machine of each node is completed, the Central control machine synchronizes the basic template management of each of them: #salt-N login state.apply group.login completes the template synchronization of the Login machine, and #salt-N master state.apply group.master completes the template synchronization of the Master machine.
13. A bastion host operation and maintenance system that realizes automatic and unified management of each node, characterized in that: include: Bastion structure: Divide the network into independent areas according to the business sites, and treat each independent network environment in different regions as an independent node. Then plan a machine in each node as the node's security entrance login machine and a master machine as the node's operation and maintenance control. The master machine is responsible for managing all business hosts of the node. - A Central master control machine, which serves as the superior master machine of the Login machine and the Master machine of each node; the Central master control machine is deployed with a WEB system, which has the construction files and configuration information of the global system. The Central master control machine regularly synchronizes the corresponding node-related data with the Master machine of each node. The Central master control machine is used to issue a task to the Master machine of the target area node, and the task includes issuing one of the tasks including user authority management and control, machine monitoring, and daily operation and maintenance to the target machine of the target area node; The Master machine is used to set up the Sentinel program, and when the task is detected, it analyzes and completes the corresponding task operation.
14. The bastion host operation and maintenance system for realizing automatic and unified management of each node as claimed in claim 13, characterized in that: A Redis database is set on each of the nodes, and a tool script library, crontab tasks and configuration files are stored in the determined locations. The tool script library is convenient for users to use a series of synchronous tool scripts; crontab tasks include disk cleaning tasks and salt-minion automatic pull-up tasks; The Master machine is also configured to receive updates and / or extension tasks including tool script libraries, crontab tasks, and configuration files sent by the Central master control machine to the corresponding Master machine of the node; and update the corresponding tool script libraries, crontab tasks, and configuration files at the specified location; and then take over the corresponding machine to process the content related to the corresponding location.
Citation Information
Patent Citations
A method for managing unmanaged hosting accounts via bastion host
CN113810415B
Business server authorized secure access method
CN106657011A
Portable operation and maintenance bastion host system
CN108551400A
Guacame-based bastion host application operation and maintenance method and device, equipment and medium
CN112527379A
Method and device for managing bastion host
CN113765871A
