A target machine upgrade method and system based on template orchestration

The template-based target machine upgrade method allows users to select or create templates, orchestrate installation packages and scripts, and use OpenStack's Cloud-init command to flexibly upgrade target machines. This solves the problem of users being unable to upgrade on their own in existing technologies, and improves efficiency and scalability.

CN115113888BActive Publication Date: 2025-12-02SAINING WANGAN
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210782558.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-12-02
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

When upgrading or modifying target machines in existing network range products, users lack an entry point, resulting in low scalability, insufficient ability to simulate complex real-world environments, and the need for professional personnel, with cumbersome operation procedures.

Method used

The target machine upgrade method adopts a template-based orchestration approach. By pre-configuring hook script files, users can select or create templates, orchestrate installation packages and scripts, and use OpenStack's Cloud-init boot command to execute the installation, enabling flexible upgrades and modifications to the target machine.

Benefits of technology

It improves the flexibility and efficiency of target machine upgrades, allowing users to modify them themselves without the need for professional personnel, and enhances the scalability of the target machine and its ability to simulate complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115113888B_ABST
    Figure CN115113888B_ABST
Patent Text Reader

Abstract

This invention discloses a target machine upgrade method and system based on template orchestration. First, it queries and displays target machines deployed in a network testing range for user selection. After the user creates or selects a template, an editing area is provided for the user to orchestrate the installation package, script, and installation order. The orchestration is then saved to a template database. After the user issues a boot command, the system retrieves the target machine bound to the selected template, sends the boot command to the target machine, specifies the agreed-upon hook script to run, and passes the template number as a parameter to the hook script. During runtime, the hook script uses the template number as a URL parameter to call an orchestration data query interface to obtain the corresponding orchestration data. It then downloads the installation package and script from a file management system according to the installation order in the orchestration data and executes the installation script. This invention allows users to flexibly modify target machines without requiring professional developers to upgrade or modify them, thus improving work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a target machine upgrade method and system based on template arrangement, belonging to the fields of computer software and network security. Background Technology

[0002] The concept of a cybersecurity test range originates from a military-civilian integration project. The "target" refers to the simulated attack target. Therefore, a cybersecurity test range provides a simulation environment for actual cybersecurity attack and defense operations, experiments, and tests. A target machine is a virtual device within a cybersecurity test range; its startup requires loading an image. Professional security lab personnel pre-install specific software, programs, services, or vulnerabilities into a base system image to simulate a real machine operating environment. Currently, target machines in existing cybersecurity test range products are created based on images produced by professionals. When upgrades or modifications are needed after the test range product is launched, ordinary users lack the access to modify the target machines, resulting in low scalability and limited ability to simulate complex real-world environments. Currently, software upgrades for pre-made target machines involve professional personnel installing the new software version into the image; each modification requires generating a new image, involving numerous steps. Summary of the Invention

[0003] Purpose of the invention: In view of the problems existing in the prior art, the purpose of this invention is to provide a target machine upgrade method and system based on template arrangement, so that users can flexibly modify the target machine without the need for professional manufacturers to participate in the target machine upgrade and modification, thereby improving work efficiency.

[0004] Technical solution: To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0005] A target machine upgrade method based on template orchestration includes the following steps:

[0006] The system queries and displays target machines deployed in the network range for users to select from; each target machine has a pre-installed hook script file.

[0007] After a user selects a target machine, the system queries and displays the templates that the target machine has been bound to; the template includes at least one installation package and installation script data;

[0008] After the user selects an existing template or creates a new one, an editing area is provided for the user to arrange the installation package, installation script and installation order for the target machine upgrade;

[0009] After the user completes the orchestration, the template and orchestration records are saved to the template database and associated with the target machine;

[0010] After the user selects a template and issues a boot command, the system obtains the target machine bound to the selected template, sends a boot command to the target machine, and specifies the hook script to be run at boot. At the same time, it passes the template number as a parameter of the hook script. When the hook script runs, it uses the template number as a URL parameter to call the orchestration data query interface to obtain the corresponding orchestration data, and downloads the installation package and installation script from the file management system according to the installation order in the orchestration data and executes the installation script.

[0011] As a preferred option, when creating a new template for a target machine, one can also choose a pre-arranged template or a template that has been bound to other target machines in the network range scenario.

[0012] As a preferred option, when users are arranging templates, they can select the installation packages and installation scripts that already exist in the file management system, or upload their own installation packages and installation scripts, and save the uploaded files to the file management system; if the target machine needs to be upgraded or modified for a project that does not involve installation packages, then only the script files can be selected or uploaded.

[0013] Preferably, the template database includes a target machine template table and a target machine arrangement table; the target machine arrangement table includes fields for arrangement number, installation package download link, installation file download link, and installation order; the target machine template table includes fields for template number, template name, target machine number, and associated arrangement number set.

[0014] As a preferred method, the hook script can be invoked by utilizing OpenStack's Cloud-init boot command runcmd.

[0015] A target machine upgrade system based on template orchestration includes a user interface, a resource management service platform, a file management system, and a virtual machine management platform; the file management system stores the installation packages and installation scripts required for the target machine upgrade; the virtual machine management platform deploys multiple virtual machines as target machines in a network test range, and each target machine has a pre-installed hook script file;

[0016] The user interface is used by users to perform template arrangement and upgrade operations, including:

[0017] The target machine selection unit is used to query and display the target machines deployed in the network range for users to select;

[0018] The template binding unit is used to query and display the templates that have been bound to the target machine after the user selects a target machine; the template includes at least one installation package and installation script data;

[0019] The template arrangement unit provides an editing area for users to arrange the installation package, installation script, and installation order for target machine upgrades after the user selects an existing template or creates a new template;

[0020] The template storage unit is used to save the template and arrangement record to the template database after the user has completed the arrangement, and associate it with the target machine;

[0021] And an instruction issuing unit, used to display the instruction execution result after the user selects a template and issues the power-on instruction;

[0022] The resource management service platform is used to connect to the virtual machine management platform to query target machines and provide an interactive interface for users; connect to the template database to query and store templates; and connect to the file management system to query and store installation packages and installation scripts. After a user issues a boot command, the platform obtains the target machine bound to the selected template, sends a boot command to the target machine through the virtual machine management platform, specifies the agreed-upon hook script to run at boot, and passes the template number as a parameter to the hook script. When the hook script runs, it uses the template number as a URL parameter to call the orchestration data query interface provided by the resource management service platform to obtain the corresponding orchestration data, and downloads the installation package and installation script from the file management system according to the installation order in the orchestration data and executes the installation script.

[0023] A computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the steps of the template-based target machine upgrade method.

[0024] A computer-readable storage medium storing a computer program, characterized in that, when executed by a processor, the computer program implements the steps of the template-based target machine upgrade method.

[0025] Beneficial Effects: Compared with existing technologies, this invention has the following advantages: 1. This invention pre-installs a hook script in the target machine. This script receives the template number and queries the URL interface to obtain the installation package and installation files for upgrading and modifying the target machine. It can transmit files to the target machine and execute the script's entry point, allowing users to flexibly modify the target machine. 2. This invention stores the arrangement and combination as templates, facilitating future use and improving reusability. 3. This invention can bind multiple templates to the target machine and arrange multiple software installation packages within the templates. Installation packages can be selected through permutation and combination, offering great flexibility. 4. This invention allows users to modify the target machine themselves without the need for professional developers, improving work efficiency. Attached Figure Description

[0026] Figure 1 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation

[0027] The technical solution of the present invention will now be clearly and completely described in conjunction with the accompanying drawings and specific embodiments.

[0028] To address the issue of target machine upgrades, this invention discloses a target machine upgrade method based on template orchestration. This method allows users to search for and select target machines, search for and select existing orchestration templates, create orchestration templates, search for and select multiple installation packages and scripts, and upload installation packages and scripts, thereby improving the flexibility of installing / upgrading software on target machines.

[0029] The specific process is as follows: Figure 1 As shown. The main steps include the following:

[0030] Step 1. Select Target Machine. The system queries and displays the target machines deployed in the network testbed for user selection. The resource management service platform calls the cloud host query interface of the virtual machine management platform (OpenStack) to provide the searched target machines for user selection. In this example, all target machines will have a pre-installed script file located at / tmp / hook.sh as a hook. The hook script can call the URL interface provided by the resource management service platform. OpenStack uses the Cloud-init plugin to initialize and configure the cloud host during startup, and uses the Cloud-init startup command (runcmd) to call the hook script.

[0031] Step 2. Template Binding. After the user selects a target machine, the template database is queried and displayed to show the templates bound to that target machine. If a template is selected, the orchestration data is retrieved based on the template's `arrange_ids`, and the installation package and installation script are automatically displayed. The user can select a bound template to edit, or create a new template. When creating a new template, the user can choose a pre-set orchestrated template or a template bound to other target machines in the network range scenario. The user can also choose not to select an existing template and directly create a blank template.

[0032] Step 3. Template Arrangement. After the user selects an existing template or creates a new one, an editing area is provided for the user to arrange the installation packages, installation scripts, and installation order for the target machine upgrade. The user can select or upload installation packages and scripts. The resource management service platform calls the FDFS (Distributed File System) query interface (FileSearch) to search by name in the historical uploaded files, selecting the installation packages and scripts. If no matching files are found in the previous files, the FDFS upload interface (FileUpload) can be called to upload the file and obtain its download link.

[0033] Users can sort the installation packages and scripts to generate an orchestration record. Since target machines can be selected arbitrarily, and installation packages can be selected arbitrarily in multiples, a one-to-many correspondence is formed. Furthermore, multiple program installations often have interdependent relationships, so a medium is needed to record the correspondence and installation order. This example uses a template database, which contains a target machine template table and a target machine orchestration table. The target machine orchestration table (target_arrange) has the resource_id field as the primary key, file_link and script_link as the download addresses of the installation packages and their installation scripts, and order as the installation order. Sample data is shown in Table 1.

[0034] Table 1 Target Drill Arrangement Table

[0035]

[0036] The target template table (target_template) has a primary key field `template_id`, where `target_id` is the target device ID, and `arrange_ids` records the orchestration data for this `target_template`. This orchestration data is associated with the `resource_id` in the target device orchestration table, as shown in Table 2.

[0037] Table 2 Target Drill Template Table

[0038]

[0039] Step 4. Store the template. After the user completes the arrangement, save the template and arrangement record to the template database. If no template is selected, a new template is created; if a template is selected, the template is updated.

[0040] Step 5. Power-on Upgrade. The user selects a template and issues a power-on command. After the user selects a template and issues a power-on command, the resource management service platform receives the template_id and queries the target_template table to obtain the target_id. Based on the target_id, it locates the host in OpenStack and updates the runcmd field in the host's Cloud-init configuration to: sh / tmp / hook.sh{template_id}. (Example: sh / tmp / hook.sh 95ca6ced82efea33c4ee41cb9c5f07cb).

[0041] Booting is performed via OpenStack. The boot process runs the `runcmd` command to invoke a hook script. The hook script reads the parameter `template_id` and uses it as a URL parameter to call the orchestration data query interface of the resource management service platform. It sorts the data in the query results in ascending order based on the `order` parameter and downloads the corresponding installation packages and installation scripts in sequence according to `file_link` and `script_link`, and then executes the installation scripts.

[0042] Based on the same inventive concept, this invention discloses a target machine upgrade system based on template orchestration, including a user interface, a resource management service platform, a file management system, and a virtual machine management platform; the file management system stores the installation packages and installation scripts required for target machine upgrades; the virtual machine management platform deploys multiple virtual machines as target machines in a network test range, and each target machine has a pre-installed hook script file; the user interface is used for users to perform template orchestration and upgrade operations, including:

[0043] The system includes: a target machine selection unit for querying and displaying target machines deployed in the network range for user selection; a template binding unit for querying and displaying templates bound to a target machine after the user selects one, wherein each template includes at least one installation package and installation script data; a template arrangement unit for providing an editing area for the user to arrange the installation package, installation script, and installation order for target machine upgrades after the user selects an existing template or creates a new template; a template storage unit for saving the template and arrangement records to a template database and associating them with the target machine after the user completes the arrangement; and an instruction issuance unit for issuing a power-on instruction after the user selects a template and displaying the instruction execution result.

[0044] The resource management service platform is used to connect to the virtual machine management platform to query target machines and provide an interactive interface for users; connect to the template database to query and store templates; and connect to the file management system to query and store installation packages and installation scripts. After a user issues a boot command, the platform obtains the target machine bound to the selected template, sends a boot command to the target machine through the virtual machine management platform, specifies the agreed-upon hook script to run at boot, and passes the template number as a parameter to the hook script. When the hook script runs, it uses the template number as a URL parameter to call the orchestration data query interface provided by the resource management service platform to obtain the corresponding orchestration data, and downloads the installation package and installation script from the file management system according to the installation order in the orchestration data and executes the installation script.

[0045] Based on the same inventive concept, an embodiment of the present invention discloses a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the steps of the template-based target machine upgrade method.

[0046] Based on the same inventive concept, embodiments of the present invention disclose a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements the steps of the template-based target machine upgrade method.

Claims

1. A target machine upgrade method based on template orchestration, characterized in that, Includes the following steps: The cloud host query interface of the virtual machine management platform is called to query and display the target machines deployed in the network range for users to select; the target machines have pre-installed hook script files. After a user selects a target machine, the system queries and displays the templates that the target machine has been bound to; the template includes at least one installation package and installation script data; After the user selects an existing template or creates a new one, an editing area is provided for the user to arrange the installation package, installation script and installation order for the target machine upgrade; After the user completes the orchestration, the template and orchestration records are saved to the template database and associated with the target machine; After the user selects a template and issues a boot command, the system obtains the target machine bound to the selected template, sends a boot command to the target machine, and specifies the hook script to be run at boot. At the same time, it passes the template number as a parameter of the hook script. When the hook script runs, it uses the template number as a URL parameter to call the orchestration data query interface to obtain the corresponding orchestration data, and downloads the installation package and installation script from the file management system according to the installation order in the orchestration data and executes the installation script.

2. The target machine upgrade method based on template orchestration according to claim 1, characterized in that, When creating a new template for a target machine, you can also choose a pre-arranged template or a template that has been bound to other target machines in the network range scenario.

3. The target machine upgrade method based on template orchestration according to claim 1, characterized in that, When users are arranging templates, they can select the installation packages and installation scripts that already exist in the file management system, or upload their own installation packages and installation scripts, and the uploaded files are saved to the file management system; If the target machine upgrade or modification project does not involve an installation package, then only select or upload the script file.

4. The target machine upgrade method based on template orchestration according to claim 1, characterized in that, The template database contains a target machine template table and a target machine arrangement table; the target machine arrangement table contains fields for arrangement number, installation package download link, installation file download link, and installation order; the target machine template table contains fields for template number, template name, target machine number, and associated arrangement number set.

5. The target machine upgrade method based on template arrangement according to claim 1, characterized in that, The hook script is invoked by utilizing OpenStack's Cloud-init boot command runcmd.

6. A target machine upgrade system based on template orchestration, characterized in that, It includes a user interface, a resource management service platform, a file management system, and a virtual machine management platform; the file management system stores the installation packages and installation scripts required for upgrading the target machine. The virtual machine management platform deploys multiple virtual machines as target machines in the network test range, and each target machine has a pre-installed hook script file. The user interface is used by users to perform template arrangement and upgrade operations, including: The target machine selection unit is used to call the cloud host query interface of the virtual machine management platform to query and display the target machines deployed in the network range for users to select. The template binding unit is used to query and display the templates that have been bound to the target machine after the user selects a target machine; the template includes at least one installation package and installation script data; The template arrangement unit provides an editing area for users to arrange the installation package, installation script, and installation order for target machine upgrades after the user selects an existing template or creates a new template; The template storage unit is used to save the template and arrangement record to the template database after the user has completed the arrangement, and associate it with the target machine; And an instruction issuing unit, used to display the instruction execution result after the user selects a template and issues the power-on instruction; The resource management service platform is used to connect to the virtual machine management platform to query target machines and provide an interactive interface for users; connect to the template database to query and store templates; and connect to the file management system to query and store installation packages and installation scripts. After a user issues a boot command, the platform obtains the target machine bound to the selected template, sends a boot command to the target machine through the virtual machine management platform, specifies the agreed-upon hook script to run at boot, and passes the template number as a parameter to the hook script. When the hook script runs, it uses the template number as a URL parameter to call the orchestration data query interface provided by the resource management service platform to obtain the corresponding orchestration data, and downloads the installation package and installation script from the file management system according to the installation order in the orchestration data and executes the installation script.

7. The target machine upgrade system based on template orchestration according to claim 6, characterized in that, When users are arranging templates, they can select the installation packages and installation scripts that already exist in the file management system, or upload their own installation packages and installation scripts, and the uploaded files are saved to the file management system; If the target machine upgrade or modification project does not involve an installation package, then only select or upload the script file.

8. The target machine upgrade system based on template orchestration according to claim 6, characterized in that, The template database contains a target machine template table and a target machine arrangement table; the target machine arrangement table contains fields for arrangement number, installation package download link, installation file download link, and installation order; the target machine template table contains fields for template number, template name, target machine number, and associated arrangement number set.

9. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the steps of the target machine upgrade method based on template orchestration according to any one of claims 1-5.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the target machine upgrade method based on template orchestration according to any one of claims 1-5.

Citation Information

Patent Citations

  • Linked data-based multiplexing method of business process execution language (BPEL) templates and services and system thereof

    CN102426519A

  • Network attack and defense experiment system building method, system and device and storage medium

    CN110351271A