Method, device and equipment for automatically managing cloud platform users into a bastion host and medium
By acquiring and comparing cloud platform host information, and automatically creating and verifying user information, the problem of low efficiency in cloud platform host information management is solved, and efficient and automated management of the bastion host is achieved.
Patent Information
- Application Number
- CN202311403441.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-10-26
AI Technical Summary
Existing technologies for managing host information on cloud platforms are inefficient and prone to errors, especially when used in conjunction with bastion hosts, and cannot meet the needs of large-scale and complex environments.
By acquiring host information from the cloud platform and cloud management platform, comparing and verifying it, users are automatically created and imported into the bastion host. Existing APIs are used to achieve automated management, avoiding manual operation.
It enables automated management of cloud platform users to the bastion host, improving efficiency, reducing errors, adapting to changes in the cloud platform, and enabling real-time access to the bastion host.
Smart Images

Figure CN117499239B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and more specifically, to a method, apparatus, equipment, and medium for automatically managing cloud platform users to a bastion host. Background Technology
[0002] In modern cloud computing environments, managing host information within cloud platforms has become a critical task. The number and configuration of hosts on a cloud platform can change frequently, making the management of this host information—including adding, modifying, and deleting hosts—particularly important. However, existing technologies present some challenges when these hosts need to work with bastion hosts. Current technology primarily relies on manual methods to manage this host information; however, manual addition, modification, and deletion of host information is not only inefficient but also prone to errors. Another approach is to rely on basic automation tools, which, while achieving a degree of automation, still cannot meet the needs of large-scale and complex cloud platform environments.
[0003] Based on the shortcomings of the existing technologies, there is an urgent need for a method to automatically manage cloud platform users to a bastion host. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, device, and medium for automatically managing cloud platform users to a bastion host, thereby improving the aforementioned problems. To achieve the above objective, the technical solution adopted by this invention is as follows:
[0005] Firstly, this application provides a method for automatically managing cloud platform users to a bastion host, including:
[0006] Obtain first information and second information. The first information includes information on at least one cloud platform host to be added to the bastion host. The second information includes cloud management platform database information, which includes information on at least one cloud platform host that has been successfully added to the bastion host.
[0007] Based on the first information and the second information, host information is compared one by one to obtain a first host list. The first host list includes host information that has not been added to the bastion host and host information that failed to be managed.
[0008] Based on the first host list, after calling the cloud platform interface and executing the script, a corresponding user is created for each host that has not been added, and the user creation result is obtained;
[0009] Based on the user information in the user creation result, the user verification result is obtained by simulating login to the corresponding cloud platform host and performing verification processing.
[0010] Based on the user information that has been successfully verified in the user verification result, the format conversion process is performed, and the converted user information is imported into the bastion host by calling the bastion host import interface to obtain the import result;
[0011] Update the corresponding host records in the cloud management platform database based on the import results, and set the host information that has been connected to the bastion host to the connected status.
[0012] Secondly, this application also provides a device for automatically managing cloud platform users to a bastion host, including:
[0013] The acquisition module is used to acquire first information and second information. The first information includes information on at least one cloud platform host to be added to the bastion host, and the second information includes cloud management platform database information, which includes information on at least one cloud platform host that has been successfully added to the bastion host.
[0014] The comparison module is used to perform host information comparison processing one by one based on the first information and the second information to obtain a first host list. The first host list includes host information that has not been added to the bastion host and host information that failed to be managed.
[0015] The creation module is used to create a corresponding user for each host that has not been added, based on the first host list, by calling the cloud platform interface and executing the script, and to obtain the user creation result;
[0016] The verification module is used to perform verification processing on the corresponding cloud platform host by simulating login to the user information in the user creation result, and obtain the user verification result.
[0017] The import module is used to perform format conversion processing on the user information that has been successfully verified in the user verification result, and then import the converted user information into the bastion host by calling the bastion host import interface to obtain the import result.
[0018] The update module is used to update the corresponding host records in the cloud management platform database information according to the import results, and set the host information that has been connected to the bastion host to the connected status.
[0019] Thirdly, this application also provides a device for automatically managing cloud platform users to a bastion host, comprising:
[0020] Memory, used to store computer programs;
[0021] A processor, used to execute the computer program, implements the steps of a method for automatically managing cloud platform users to a bastion host.
[0022] Fourthly, this application also provides a medium on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method for automatically managing cloud platform users to a bastion host.
[0023] The beneficial effects of this invention are as follows:
[0024] This invention automates the creation of users connected to the bastion host according to relevant specifications and connects them to the bastion host. Based on existing tools and functions, it does not require modification of the cloud platform or the bastion host. It can automatically manage cloud platform users simply by calling existing APIs, solving the problems of low efficiency and error-proneness of manual operation. Moreover, it can connect to the bastion host in real time according to changes in the cloud platform.
[0025] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of the method for automatically managing cloud platform users to the bastion host as described in an embodiment of the present invention;
[0028] Figure 2 This is a schematic diagram of the device structure for automatically managing cloud platform users to the bastion host as described in an embodiment of the present invention;
[0029] Figure 3 This is a schematic diagram of the device structure for automatically managing cloud platform users to the bastion host, as described in an embodiment of the present invention.
[0030] The diagram is labeled as follows: 1. Acquisition module; 2. Comparison module; 21. First comparison unit; 22. First filtering unit; 23. First identification unit; 24. First merging unit; 3. Creation module; 31. First classification unit; 32. First creation unit; 33. Second creation unit; 34. Second merging unit; 4. Verification module; 41. First simulation unit; 42. First analysis unit; 43. First matching unit; 44. First verification unit; 5. Import module; 51. First completion unit; 52. First sorting unit; 53. First conversion unit; 54. First import unit; 6. Update module; 61. First extraction unit; 62. First search unit; 63. First update unit; 64. Second update unit; 800. Device for automatically managing cloud platform users to the bastion host; 801. Processor; 802. Memory; 803. Multimedia component; 804. I / O interface; 805. Communication component. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0032] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0033] Example 1:
[0034] This embodiment provides a method for automatically managing cloud platform users to a bastion host.
[0035] See Figure 1 The figure shows that the method includes steps S100, S200, S300, S400, S500 and S600.
[0036] Step S100: Obtain first information and second information. The first information includes information on at least one cloud platform host to be added to the bastion host, and the second information includes cloud management platform database information, which includes information on at least one cloud platform host that has been successfully added to the bastion host.
[0037] Understandably, in this step, the cloud management platform calls the cloud platform API to obtain cloud platform host information. The cloud platform information processing module calls the API provided by the cloud platform to obtain relevant information about all cloud platform hosts, including IP address, hostname, operating system, etc. This information is then passed to the main processing module.
[0038] When the cloud management platform detects that the host information has been deleted from the cloud platform, the cloud management platform's processing flow is as follows:
[0039] Step S110: The cloud management platform calls the cloud platform API to obtain information on deleted cloud platform hosts. The cloud platform information processing module, by calling the API provided by the cloud platform, can obtain relevant information about all cloud platform hosts, including IP address, hostname, operating system, etc. Based on the messages transmitted from the CMDB, it identifies the information of deleted hosts and transmits this information to the main processing module.
[0040] Step S120: Delete bastion host information. The main processing module transmits information such as host address, host name, host login protocol, and host user to the bastion host information processing module. The bastion host information processing module deletes the corresponding bastion host record by calling the bastion host's delete user API.
[0041] Step S130: Delete data information from the cloud management platform. The main processing module uses information such as host address, hostname, host login protocol, and host user as keys to delete relevant host records in the cloud management platform database.
[0042] Step S200: Compare the host information one by one according to the first information and the second information to obtain the first host list. The first host list includes the host information that has not been added to the bastion host and the host information that failed to be managed.
[0043] Understandably, the purpose of this step is to filter hosts that are not joined to the bastion host. It should be noted that step S200 includes steps S210, S220, S230, and S240.
[0044] Step S210: Based on the first information and the second information, the comparison result is obtained after information comparison processing.
[0045] Step S220: Based on the comparison results, after filtering, the first information that is not in the second information is obtained, and the host information that has not been added is obtained.
[0046] Step S230: Based on the information of hosts that have not been added, the information of hosts that have failed to be added is obtained after the identification and processing of hosts that have failed to be added.
[0047] Step S240: Based on the information of hosts that have not been added and the information of hosts that failed to be managed, merge them to obtain the first host list.
[0048] Understandably, the cloud platform retrieves all host and user information that has been successfully added to the bastion host from the database, and compares the host and user information from the cloud platform's information processing module with the information in the database one by one. Hosts and users that already exist in the database and have been added to the bastion host do not require processing; hosts that are not in the database can be identified as hosts that have not been added to the bastion host or hosts that have failed to be managed.
[0049] Step S300: Based on the first host list, by calling the cloud platform interface and executing the script, create a corresponding user for each host that has not been added, and obtain the user creation result.
[0050] It is understandable that the purpose of this step is to automatically create users. It should be noted that step S300 includes steps S310, S320, S330 and S340.
[0051] Step S310: Classify the hosts according to the first host list, distinguish between hosts that have not been added to the bastion host and hosts that failed to be managed, and obtain a specific list. The specific list includes the list of hosts that have not been added to the bastion host and the list of hosts that failed to be managed.
[0052] Step S320: Make cloud platform interface calls based on the list of hosts not added to the bastion host, send a request to create a user to each host, and obtain the preliminary request sending results.
[0053] Step S330: Based on the list of failed hosts to be managed, make a cloud platform interface call to resend the request to create a user to each host and obtain the result of resending the request.
[0054] Step S340: Merge and analyze the results of the initial request and the re-request to obtain the final user creation result.
[0055] Understandably, the cloud management platform transmits hosts not joined to the bastion host and hosts whose management failed to be added to the cloud platform's information processing module. The information processing module then calls the cloud platform's interface to create corresponding users for these hosts, including high-privilege and low-privilege users. During user creation, the module promptly obtains the creation results and issues alerts if any anomalies occur.
[0056] Step S400: Based on the user information in the user creation result, the user is verified by simulating login to the corresponding cloud platform host to obtain the user verification result.
[0057] It is understandable that the purpose of this step is to achieve automatic user verification. It should be noted that step S400 includes steps S410, S420, S430 and S440.
[0058] Step S410: Based on the user creation results, simulate login for all users to obtain the first simulated login result. The first simulated login result includes information on users who successfully logged in and information on users who failed to log in.
[0059] Step S420: Based on the first simulated login result, perform error analysis on the user records of failed logins to obtain the error type of each failed user.
[0060] Step S430: Match the error type with the preset error handling strategy, determine the corresponding handling method for each error type, and obtain the processing plan to be executed.
[0061] Step S440: Perform the corresponding operation according to the processing plan to be executed, and obtain the final user verification result.
[0062] Understandably, the cloud platform's information processing module simulates login to the corresponding cloud platform host using specified port, protocol, IP address, and user information. It determines successful login based on pre-defined return characters, ensuring the user is correctly created and the password is correct. After verification, the result is written to the database, marking whether the user's verification was successful or not. For failed users, an alarm message is issued.
[0063] Step S500: Perform format conversion processing on the user information that has been successfully verified in the user verification result, and import the converted user information into the bastion host by calling the bastion host import interface to obtain the import result.
[0064] Understandably, the purpose of this step is to generate the bastion host import file according to the format required by the bastion host. It should be noted that step S500 includes steps S510, S520, S530, and S540.
[0065] Step S510: Perform additional information completion processing based on the successfully verified user information and the preset information completion rules to obtain complete user information.
[0066] Step S520: Organize the data based on the complete user information, and extract the key fields to obtain the organized user information.
[0067] Step S530: Convert the format of the organized user information to the import file format required by the bastion host to obtain the bastion host import file.
[0068] Step S540: Import the obtained bastion host import file into the bastion host by calling the interface to obtain the import result.
[0069] Understandably, this step involves supplementing relevant information according to pre-defined rules, including management IP address, username, password, management port, management protocol, activation protocol, connection port, operating system type, and authorized user groups, etc., to form a bastion host import file in the required format. This import file is then sent to the bastion host information processing module. The bastion host information processing module calls the bastion host import interface to import the generated import file into the bastion host.
[0070] Step S600: Update the corresponding host records in the cloud management platform database information according to the import results, and set the host information that has been connected to the bastion host to the connected status.
[0071] Understandably, the purpose of this step is to achieve real-time updates of the cloud management platform database. It should be noted that step S600 includes steps S610, S620, S630, and S640.
[0072] Step S610: Analyze and extract the import results to obtain key information about the successful import into the host.
[0073] Step S620: Based on the key information, find the corresponding host record in the cloud management platform database to obtain the host record to be updated.
[0074] Step S630: Perform an update operation based on the host record to be updated, change the status of the current record to "connected", and obtain the updated host record.
[0075] Step S640: Based on the updated host records, perform an update operation on the cloud management platform database to obtain the final updated database information.
[0076] Understandably, in the above steps, the host records in the cloud management platform database are updated based on the imported file results, and the hosts that have been connected to the bastion host are set to the connected state.
[0077] Step S700: Perform error elimination processing on the failed users of the bastion host according to the preset processing flow.
[0078] For various reasons, users joining the bastion host through the above steps may fail, such as: password complexity not meeting operating system requirements; cloud platform host being destroyed and inability to log in, etc., requiring rejoining the bastion host. The bastion host periodically performs simulated logins for all users, and if a simulated login fails, the failure information is recorded. The bastion host information processing module periodically obtains bastion host login failure information, and the following processing flow applies to these failure messages:
[0079] Step S710: The cloud management platform bastion host information processing module queries the bastion host login failure records and obtains the specific error message for the login failure.
[0080] Step S720: The bastion host information processing module determines the reason for the login failure based on the login failure record and determines the handling method based on the specific reason.
[0081] Step S721: If the login failure reason contains the keyword "connection timeout", it indicates a connection failure. At the same time, it is determined whether the host on the cloud platform has been destroyed.
[0082] Step S7211: The cloud platform information processing module queries the cloud platform host information. If the host information is not found, it indicates that the host has been destroyed. In this case, the bastion host information processing module deletes all records of this host in the bastion host and deletes the corresponding record in the database. Otherwise, it indicates another problem, requiring the sending of an alarm message and waiting for manual handling.
[0083] Step S7211: If the bastion host successfully connects to the host, but the password is incorrect or the password complexity does not meet the operating system requirements, the bastion host information processing module determines whether there is a password error keyword in the failure return information.
[0084] Step S72111: If there are incorrect password keywords, the bastion host information processing module will delete the corresponding host record through the bastion host interface, delete the corresponding record in the cloud management platform database, and issue an alarm message through the alarm notification module.
[0085] Since the corresponding host and user information has been deleted from the database and the information in the bastion host has also been deleted, the host and user can be processed again as if they were newly added when the scheduled job runs next time, without the need for separate manual intervention.
[0086] Step S72112: If no password error keyword exists, the bastion host information processing module deletes the record of the corresponding host through the bastion host interface, sets the corresponding record in the cloud management platform database to pending manual processing, and notifies the administrator by issuing an alarm message to wait for manual adjustment of the password policy to meet the operating system requirements.
[0087] By performing the above operations and combining them with the main processing flow of the cloud management platform, bastion host errors can be automatically eliminated.
[0088] Example 2:
[0089] like Figure 2 As shown, this embodiment provides a device for automatically managing cloud platform users to a bastion host. The device includes:
[0090] The acquisition module 1 is used to acquire first information and second information. The first information includes information on at least one cloud platform host to be added to the bastion host, and the second information includes cloud management platform database information. The cloud management platform database information includes information on at least one cloud platform host that has been successfully added to the bastion host.
[0091] The comparison module is used to compare host information one by one based on the first information and the second information to obtain a first host list. The first host list includes host information that has not been added to the bastion host and host information that failed to be managed.
[0092] Module 3 is used to create a corresponding user for each host that has not been added, based on the first host list, by calling the cloud platform interface and executing the script, and to obtain the user creation result;
[0093] Verification module 4 is used to verify the user information in the user creation result by simulating login to the corresponding cloud platform host and obtaining the user verification result.
[0094] Import module 5 is used to perform format conversion processing on the user information that has been successfully verified in the user verification results, and import the converted user information into the bastion host by calling the bastion host import interface to obtain the import result;
[0095] Update module 6 is used to update the corresponding host records in the cloud management platform database information based on the import results, and set the host information that has been connected to the bastion host to the connected status.
[0096] In one specific embodiment of this disclosure, the comparison module 2 includes:
[0097] The first comparison unit 21 is used to obtain the comparison result by performing information comparison processing based on the first information and the second information;
[0098] The first filtering unit 22 is used to obtain the first information that is not in the second information by filtering according to the comparison results, and to obtain the host information that has not been added.
[0099] The first identification unit 23 is used to obtain the information of the failed host to be managed based on the information of the host that has not been added and the identification process of the failed host to be managed.
[0100] The first merging unit 24 is used to merge the host information that has not been added and the host information that failed to be managed to obtain the first host list.
[0101] In one specific embodiment of this disclosure, the creation module 3 includes:
[0102] The first classification unit 31 is used to classify the hosts according to the first host list, distinguish the hosts that have not been added to the bastion host and the hosts that have failed to be managed, and obtain a specific list. The specific list includes the list of hosts that have not been added to the bastion host and the list of hosts that have failed to be managed.
[0103] The first creation unit 32 is used to make cloud platform interface calls based on the list of hosts not added to the bastion host, send a request to create a user to each host, and obtain the initial request sending result;
[0104] The second creation unit 33 is used to make cloud platform interface calls based on the list of failed hosts to be managed, resend the request to create a user to each host, and obtain the resend request result.
[0105] The second merging unit 34 is used to merge and analyze the results of the initial request and the re-request to obtain the final user creation result.
[0106] In one specific embodiment of this disclosure, the inspection module 4 includes:
[0107] The first simulation unit 41 is used to simulate login for all users based on the user creation result to obtain the first simulated login result, which includes user information of successful login and user information of failed login.
[0108] The first analysis unit 42 finally performs error analysis processing on the user records of failed logins based on the first simulated login results, and obtains the error type of each failed user;
[0109] The first matching unit 43 is used to perform matching processing according to the error type and the preset error handling strategy, determine the corresponding processing method for each error type, and obtain the processing plan to be executed.
[0110] The first verification unit 44 is used to perform the corresponding operation according to the processing plan to be executed, and obtain the final user verification result.
[0111] In one specific embodiment of this disclosure, the import module 5 includes:
[0112] The first completion unit 51 is used to perform additional information completion processing based on the successfully verified user information and the preset information completion rules to obtain complete user information.
[0113] The first sorting unit 52 is used to sort data based on complete user information, sort out key fields and obtain sorted user information.
[0114] The first conversion unit 53 is used to convert the format of the organized user information and obtain the bastion host import file by converting it into the import file format required by the bastion host.
[0115] The first import unit 54 is used to import the obtained bastion host import file into the bastion host by calling the interface and obtain the import result.
[0116] In one specific embodiment of this disclosure, the updating module 6 includes:
[0117] The first extraction unit 61 is used to analyze and extract the import results to obtain key information about the successful import into the host.
[0118] The first search unit 62 is used to search for the corresponding host record in the cloud management platform database based on key information, and obtain the host record to be updated.
[0119] The first update unit 63 is used to perform an update operation based on the host record to be updated, change the status of the current record to "connected", and obtain the updated host record.
[0120] The second update unit 64 is used to perform an update operation on the cloud management platform database based on the updated host records to obtain the final updated database information.
[0121] Example 3:
[0122] Figure 3 This is a block diagram illustrating a device 800 for automatically managing cloud platform users to a bastion host, according to an exemplary embodiment. Figure 3 As shown, the device 800 for automatically managing cloud platform users to the bastion host may include: a processor 801 and a memory 802. The device 800 for automatically managing cloud platform users to the bastion host may also include one or more of the following: a multimedia component 803, an I / O interface 804, and a communication component 805.
[0123] The processor 801 controls the overall operation of the device 800 for automatically managing cloud platform users to the bastion host, thereby completing all or part of the steps in the aforementioned method for automatically managing cloud platform users to the bastion host. The memory 802 stores various types of data to support the operation of the device 800 for automatically managing cloud platform users to the bastion host. This data may include, for example, instructions for any application or method operating on the device 800 for automatically managing cloud platform users to the bastion host, as well as application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 802 can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 802 or transmitted via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 805 is used for wired or wireless communication between the cloud platform's user-managed bastion host device 800 and other devices. Wireless communication includes Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 805 may include a Wi-Fi module, a Bluetooth module, and an NFC module.
[0124] In an exemplary embodiment, the device 800 for automatically managing cloud platform users to the bastion host may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method for automatically managing cloud platform users to the bastion host.
[0125] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the method for automatically managing cloud platform users to a bastion host as described above. For example, the computer-readable storage medium may be the memory 802 including program instructions, which may be executed by the processor 801 of the device 800 for automatically managing cloud platform users to a bastion host to complete the method for automatically managing cloud platform users to a bastion host as described above.
[0126] Example 4:
[0127] Corresponding to the above method embodiments, this embodiment also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the method for automatically managing cloud platform users to the bastion host described above.
[0128] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the above method embodiment for automatically managing cloud platform users to a bastion host.
[0129] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.
[0130] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0131] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for automatically managing cloud platform users to a bastion host, characterized in that, include: Obtain first information and second information. The first information includes information on at least one cloud platform host to be added to the bastion host. The second information includes cloud management platform database information, which includes information on at least one cloud platform host that has been successfully added to the bastion host. Based on the first information and the second information, host information is compared one by one to obtain a first host list. The first host list includes host information that has not been added to the bastion host and host information that failed to be managed. Based on the first host list, after calling the cloud platform interface and executing the script, a corresponding user is created for each host that has not been added, and the user creation result is obtained; Based on the user information in the user creation result, the user verification result is obtained by simulating login to the corresponding cloud platform host and performing verification processing. Based on the user information that has been successfully verified in the user verification result, the format conversion process is performed, and the converted user information is imported into the bastion host by calling the bastion host import interface to obtain the import result; Update the corresponding host record in the cloud management platform database information according to the import result, and set the host information that has been connected to the bastion host to the connected status; The step of comparing host information one by one based on the first information and the second information to obtain a first host list includes: Based on the first information and the second information, the comparison result is obtained after information comparison processing; Based on the comparison results, after filtering, the first information that is not in the second information is obtained, and the host information that has not been added is obtained. Based on the information of the unadded hosts, the information of the hosts that failed to be added to the management system is obtained through the identification and processing of the hosts that failed to be added to the management system. Based on the information of hosts not added and the information of hosts that failed to be managed, a first host list is obtained by merging them. The step of verifying the user information based on the user creation result by simulating login to the corresponding cloud platform host to obtain the user verification result includes: Based on the user creation results, simulated login is performed on all users to obtain a first simulated login result, which includes information on users who successfully logged in and information on users who failed to log in. Based on the first simulated login result, error analysis and processing are performed on the user records of failed logins to obtain the error type of each failed user. The error type and the preset error handling strategy are matched and processed to determine the corresponding processing method for each error type, so as to obtain the processing plan to be executed. The corresponding operation is performed according to the processing scheme to be executed, and the final user verification result is obtained.
2. The method for automatically managing cloud platform users to a bastion host according to claim 1, characterized in that, Based on the first host list, after calling the cloud platform interface and executing scripts, a corresponding user is created for each host that has not been added, resulting in the user creation results, including: The host list is classified according to the first host list to distinguish between hosts that have not been added to the bastion host and hosts that have failed to be managed, and a specific list is obtained. The specific list includes the list of hosts that have not been added to the bastion host and the list of hosts that have failed to be managed. Based on the list of hosts not added to the bastion host, cloud platform API calls are made, and a request to create a user is sent to each host to obtain the initial request sending results; Based on the list of hosts that failed to be managed, the cloud platform interface is called to resend the request to create a user to each host, and the result of the resending request is obtained. The final user creation result is obtained by merging and analyzing the results of the initial request and the re-request.
3. The method for automatically managing cloud platform users to a bastion host according to claim 1, characterized in that, The user information that has been successfully verified in the user verification results is processed for format conversion, and the converted user information is imported into the bastion host by calling the bastion host import interface to obtain the import result, including: Based on the successfully verified user information and the preset information completion rules, additional information completion processing is performed to obtain complete user information; Based on the complete user information, the data is organized, and key fields are extracted to obtain the organized user information. The organized user information is converted into a format that is then transformed into the import file format required by the bastion host to obtain the bastion host import file; Based on the obtained bastion host import file, the file is imported into the bastion host by calling the interface, and the import result is obtained.
4. The method for automatically managing cloud platform users to a bastion host according to claim 1, characterized in that, Update the corresponding host records in the cloud management platform database based on the import results, and set the host information that has been connected to the bastion host to the connected state, including: The import results are analyzed and extracted to obtain key information about the successfully imported host. Based on the key information, the corresponding host record in the cloud management platform database is searched to obtain the host record to be updated. Based on the host record to be updated, perform an update operation to change the status of the current record to "connected" to obtain the updated host record; Based on the updated host records, an update operation is performed on the cloud management platform database to obtain the final updated database information.
5. A device for automatically managing cloud platform users to a bastion host, characterized in that, include: The acquisition module is used to acquire first information and second information. The first information includes information on at least one cloud platform host to be added to the bastion host, and the second information includes cloud management platform database information, which includes information on at least one cloud platform host that has been successfully added to the bastion host. The comparison module is used to perform host information comparison processing one by one based on the first information and the second information to obtain a first host list. The first host list includes host information that has not been added to the bastion host and host information that failed to be managed. The creation module is used to create a corresponding user for each host that has not been added, based on the first host list, by calling the cloud platform interface and executing the script, and to obtain the user creation result; The verification module is used to perform verification processing on the corresponding cloud platform host by simulating login to the user information in the user creation result, and obtain the user verification result. The import module is used to perform format conversion processing on the user information that has been successfully verified in the user verification result, and then import the converted user information into the bastion host by calling the bastion host import interface to obtain the import result. The update module is used to update the corresponding host records in the cloud management platform database information according to the import results, and set the host information that has been connected to the bastion host to the connected state. The comparison module includes: The first comparison unit is used to obtain a comparison result by performing information comparison processing based on the first information and the second information; The first filtering unit is used to obtain the first information that is not in the second information by filtering the comparison results, and thus obtain the host information that has not been added. The first identification unit is used to obtain the information of the failed host to be managed based on the information of the unadded host and the identification processing of the failed host to be managed. The first merging unit is used to merge the information of the unadded hosts and the information of the hosts that failed to be managed to obtain a first host list. The inspection module includes: The first simulation unit is used to simulate login for all users based on the user creation result to obtain a first simulated login result, which includes user information of successful login and user information of failed login. The first analysis unit is used to perform error analysis processing on the user records of failed logins based on the first simulated login result, and to obtain the error type of each failed user. The first matching unit is used to perform matching processing according to the error type and the preset error handling strategy, determine the corresponding processing method for each error type, and obtain the processing plan to be executed. The first verification unit is used to perform corresponding operations according to the processing scheme to be executed, and obtain the final user verification result.
6. The device for automatically managing cloud platform users to the bastion host according to claim 5, characterized in that, The creation module includes: The first classification unit is used to classify the hosts according to the first host list, distinguish the hosts that have not been added to the bastion host and the hosts that have failed to be managed, and obtain a specific list, wherein the specific list includes the list of hosts that have not been added to the bastion host and the list of hosts that have failed to be managed. The first creation unit is used to make cloud platform interface calls based on the list of hosts not added to the bastion host, send a request to create a user to each host, and obtain the initial request sending results; The second creation unit is used to make cloud platform interface calls based on the list of failed hosts to be managed, resend the request to create a user to each host, and obtain the resend request result. The second merging unit is used to merge and analyze the results of the initial request and the re-request to obtain the final user creation result.
7. The device for automatically managing cloud platform users to the bastion host according to claim 5, characterized in that, The import module includes: The first completion unit is used to perform additional information completion processing based on the successfully verified user information and preset information completion rules to obtain complete user information; The first sorting unit is used to sort the data based on the complete user information and sort out the key fields to obtain the sorted user information. The first conversion unit is used to convert the format of the sorted user information and obtain the bastion host import file by converting it into the import file format required by the bastion host. The first import unit imports the obtained bastion host import file into the bastion host by calling the interface, and obtains the import result.
8. The device for automatically managing cloud platform users to the bastion host according to claim 5, characterized in that, The update module includes: The first extraction unit is used to analyze and extract the import results to obtain key information about the successful import into the host. The first search unit is used to search for the corresponding host record in the cloud management platform database based on the key information, and obtain the host record to be updated. The first update unit is used to perform an update operation based on the host record to be updated, change the status of the current record to "connected", and obtain the updated host record. The second update unit is used to perform an update operation on the cloud management platform database based on the updated host records to obtain the final updated database information.
9. A device for automatically managing cloud platform users to a bastion host, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for automatically managing cloud platform users to a bastion host as described in any one of claims 1 to 4.
10. A medium, characterized in that: The medium stores a computer program, which, when executed by a processor, implements the steps of the method for automatically managing cloud platform users to a bastion host as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Cloud platform and bastion host user docking method and system
CN114253717A
Method for realizing cloud host permission linkage for cloud host and cloud bastion host
CN114747180A
