Anti-misoperation method for bastion fortress and computer program product
By employing the secure countdown buffer mechanism in the bastion host's anti-misoperation method, the shortcomings of existing technologies in preventing misoperation are addressed, enabling real-time control and flexible management of high-risk operations, thereby improving user experience and system security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-31
AI Technical Summary
Existing bastion host methods for preventing accidental operation are ineffective in scenarios with frequent operation, lack buffering and reflection mechanisms, fail to balance user experience and security, lack real-time monitoring and risk intervention capabilities, and have a single mechanism for preventing accidental operation, which cannot take into account the operational flexibility in emergency scenarios.
The input command is assessed for risk level through a secure countdown buffer mechanism, an isolation layer is established, and high-risk operations can be interrupted, delayed, and flexibly controlled. This includes parsing key information and matching it with a dynamic high-risk command library, taking over the execution flow of high-risk commands and creating countdown tasks, and providing users with a cancel window.
Effectively prevents misoperation, enhances real-time control capabilities, ensures that high-risk operations can be interrupted or delayed, improves user experience and the security and controllability of system operations, and strengthens security audit and compliance traceability capabilities.
Smart Images

Figure CN121765719A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, and more specifically, to a method for preventing misoperation of a bastion host, a computer program product, an electronic device, and a storage medium. Background Technology
[0002] In existing technologies, to prevent maintenance personnel from making mistakes when executing remote commands through a bastion host, a command interception and secondary confirmation mechanism is usually used.
[0003] However, the above methods have several technical flaws in their implementation. For example, current secondary confirmations are mostly implemented through pop-up prompts or text confirmations. In scenarios with frequent operations, users often develop a conditioned reflex and habitually click to confirm, making it difficult to truly prevent accidental operations. There is a lack of buffering and reflection mechanisms; commands are executed immediately after user confirmation, without any safety buffer period for users to review their actions. If an operation is incorrect, it will directly cause irreversible damage to the target system. The balance between user experience and security is insufficient; while frequent confirmation prompts improve security, they reduce operational efficiency, and users may try to circumvent security mechanisms, thus weakening the overall protection effect. There is a lack of real-time monitoring and risk intervention capabilities during execution; if a user mistakenly selects a target host or the command parameters are incorrect, the system cannot promptly block or prompt the user. The anti-accidental operation mechanism is simplistic, relying on manual intervention for blocking or approval, failing to consider operational flexibility in emergency scenarios. Real-time intervention capabilities are insufficient; there is a lack of system-level real-time technical means to ensure that commands are under control before execution. Summary of the Invention
[0004] The purpose of this application is to provide a method for preventing misoperation of a bastion host, a computer program product, an electronic device and a storage medium, which can buffer operations through a safe countdown, effectively prevent misoperation, improve the real-time control capability of the execution process, establish an isolation layer between command recognition and execution, ensure that high-risk operations can be interrupted or delayed, and improve the flexible control of operations.
[0005] In a first aspect, embodiments of this application provide a method for preventing misoperation of a bastion host, the method comprising: Get input commands; The input commands are intercepted according to the bastion host session agent; The risk level of the intercepted input command is assessed to obtain the risk level corresponding to the input command. The input command is buffered with a safe countdown based on the risk level, and a countdown task is created. Execute the countdown task and complete the process of issuing the input command.
[0006] In the above implementation process, after recognizing the user's input command, a safe countdown buffer is applied, which can effectively prevent misoperation, improve the real-time control capability of the execution process, establish an isolation layer between command recognition and execution, ensure that high-risk operations can be interrupted or delayed, and improve the flexible control of operations.
[0007] Furthermore, the step of assessing the risk level of the intercepted input command to obtain the risk level corresponding to the input command includes: The input command is parsed to obtain key information; The key information is matched with a pre-built dynamic high-risk instruction library to obtain the risk level corresponding to the key information.
[0008] In the above implementation process, the input commands are parsed and the key information is matched with the dynamic high-risk command library. This can clarify the risk level of the input commands, facilitate timely judgment on the executability of the input commands, and shorten the system response time.
[0009] Furthermore, the step of performing a secure countdown buffering process on the input command based on the risk level and creating a countdown task includes: Determine whether the risk level is a high-risk level; If so, determine that the input command is a high-risk command, perform a safe countdown buffering process on the high-risk command, and create a countdown task; If not, determine that the input command is a low-risk command and perform a release operation on the low-risk command.
[0010] In the above implementation process, the risk level of the input command is distinguished and corresponding operations are performed to ensure that high-risk commands can be buffered in a timely manner with a safe countdown, effectively preventing misoperation, and at the same time making up for the lack of buffering operations in the blocking process.
[0011] Furthermore, the step of performing a secure countdown buffering process on the high-risk command includes: Take over the execution flow of the high-risk commands; The execution flow of the high-risk command is locked in a pre-built security buffer, and the forwarding of the high-risk command is suspended.
[0012] In the above implementation process, the execution flow of high-risk commands is temporarily stored in a security buffer, establishing effective isolation between command identification and execution, improving the real-time control capability of the execution process, and providing a guarantee for the subsequent secure execution of high-risk commands.
[0013] Furthermore, the step of creating the countdown task includes: Obtain the command type, risk level, and user role of the high-risk command; Based on the command type, risk level, and user role, the parameters are dynamically configured to generate the countdown parameters corresponding to the high-risk command. A delay queue is created based on the countdown parameters, and the countdown task is generated.
[0014] In the above implementation process, corresponding countdown parameters are configured according to the command type, risk level and user role of high-risk commands to ensure that the delay of high-risk commands meets user needs and does not cause users to wait for a long time, thereby improving user experience.
[0015] Furthermore, the steps of executing the countdown task and completing the process of issuing the input command include: Obtain the command type of the high-risk command; Create a corresponding task to be confirmed based on the command type; While executing the countdown task, the task to be confirmed is sent to the front end to obtain the user's operation command; The process of issuing the input command is completed according to the operation command.
[0016] In the above implementation process, a task to be confirmed is created according to the command type, and the corresponding operation command of the user is obtained. The user can be provided with a regret window to avoid triggering unnecessary approvals and to safeguard the user's safe operation.
[0017] Further, the step of completing the process of issuing the input command according to the operation command includes: If the operation command is a cancel operation, the input command will be discarded; If the operation command is to confirm execution, the input command is sent to the target server.
[0018] In the above implementation process, the corresponding subsequent processes are executed according to the operation command, reducing the user's waiting time, ensuring that every input command of the user can be executed properly, and reducing the possibility of misoperation.
[0019] Furthermore, after the steps of executing the countdown task and completing the process of issuing the input command, the method further includes: A security audit log is generated based on the input command, session ID, and countdown task.
[0020] The above implementation process can effectively record every step of the operation, enhance security audit and compliance traceability capabilities, provide data support for subsequent operation review, and also provide a secure copy of the user's operation process.
[0021] Secondly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects.
[0022] Thirdly, an electronic device provided in this application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any of the first aspects.
[0023] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.
[0024] Fifthly, embodiments of this application also provide a bastion host anti-misoperation device, the device comprising: The acquisition module is used to acquire input commands; The interception module is used to intercept the input commands based on the bastion host session proxy; The risk level assessment module is used to assess the risk level of the intercepted input command and obtain the risk level corresponding to the input command. The safety countdown buffer module is used to perform safety countdown buffering on the input command according to the risk level and create a countdown task; The execution module is used to execute the countdown task and complete the process of issuing the input command.
[0025] In the above implementation process, after recognizing the user's input command, a safe countdown buffer is applied, which can effectively prevent misoperation, improve the real-time control capability of the execution process, establish an isolation layer between command recognition and execution, ensure that high-risk operations can be interrupted or delayed, and improve the flexible control of operations.
[0026] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0027] It can be implemented in accordance with the contents of the specification. The preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation on the range. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A flowchart illustrating the method for preventing misoperation of a bastion host provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structural composition of the anti-misoperation device for the bastion host provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structural composition of the electronic device provided in the embodiments of this application. Detailed Implementation
[0030] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0031] 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 application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0032] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0033] Example 1 Figure 1 This is a flowchart illustrating the method for preventing misoperation of a bastion host provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes: S1, Get input command; S2, intercepts input commands based on the bastion host session agent; S3, perform a risk level assessment on the intercepted input command to obtain the risk level corresponding to the input command; S4 performs a safe countdown buffer on the input command based on the risk level and creates a countdown task; S5 executes the countdown task and completes the process of issuing input commands.
[0034] In the above implementation process, after recognizing the user's input command, a safe countdown buffer is applied, which can effectively prevent misoperation, improve the real-time control capability of the execution process, establish an isolation layer between command recognition and execution, ensure that high-risk operations can be interrupted or delayed, and improve the flexible control of operations.
[0035] This application provides a method for preventing errors in high-risk operations of a bastion host based on a secure countdown buffer mechanism. The aim is to establish a secure buffer before command execution, thereby enabling delayed confirmation, real-time interruption, and full-process audit control of high-risk operations.
[0036] This application, without altering the existing bastion host architecture and approval system, introduces a secure countdown buffer mechanism to establish a novel secure anti-misoperation execution control model in the command execution chain. This model allows for real-time intervention, delayed release, and interruption / cancellation, effectively reducing the risk of operational errors and improving the security and controllability of system operations.
[0037] Furthermore, S3 includes: The input command is parsed to obtain key information; The key information is matched with a pre-built dynamic high-risk instruction library to obtain the risk level corresponding to the key information.
[0038] In the above implementation process, the input commands are parsed and the key information is matched with the dynamic high-risk command library. This can clarify the risk level of the input commands, facilitate timely judgment on the executability of the input commands, and shorten the system response time.
[0039] This application can intercept and parse the input commands of operation and maintenance personnel in real time. By matching them with a dynamic high-risk command database, it can identify key information corresponding to high-risk operations that may lead to system damage, data loss, or service interruption. The acquisition of key information supports keyword matching, regular expressions, and contextual semantic recognition to ensure the accuracy and real-time nature of the identification.
[0040] Furthermore, S4 includes: Determine whether the risk level is high-risk. If so, determine that the input command is a high-risk command, perform a safe countdown buffering process on the high-risk command, and create a countdown task; If not, determine that the input command is a low-risk command and perform a release operation for low-risk commands.
[0041] In the above implementation process, the risk level of the input command is distinguished and corresponding operations are performed to ensure that high-risk commands can be buffered in a timely manner with a safe countdown, effectively preventing misoperation, and at the same time making up for the lack of buffering operations in the blocking process.
[0042] Furthermore, the steps for providing a secure countdown buffer for high-risk commands include: Take over the execution flow of high-risk commands; Lock the execution flow of high-risk commands into a pre-built security buffer and suspend the forwarding of high-risk commands.
[0043] In the above implementation process, the execution flow of high-risk commands is temporarily stored in a security buffer, establishing effective isolation between command identification and execution, improving the real-time control capability of the execution process, and providing a guarantee for the subsequent secure execution of high-risk commands.
[0044] Once a high-risk command is identified, its execution flow is immediately taken over, locked in a security buffer, and forwarded to the target server is suspended to ensure that no client or script can bypass the buffering process.
[0045] When a high-risk command enters the buffer state, the system activates a safety countdown buffer mechanism, displaying a countdown interface of a preset duration. During the countdown, the command remains frozen, allowing the user to read the risk warning information but not to immediately execute the command, thus providing the user with sufficient cooling-off period to reconfirm their intentions.
[0046] Furthermore, the steps to create a countdown task include: Obtain the command type, risk level, and user role of high-risk commands; The parameters are dynamically configured based on the command type, risk level, and user role to generate countdown parameters corresponding to high-risk commands. Create a delay queue based on the countdown parameters and generate a countdown task.
[0047] In the above implementation process, corresponding countdown parameters are configured according to the command type, risk level and user role of high-risk commands to ensure that the delay of high-risk commands meets user needs and does not cause users to wait for a long time, thereby improving user experience.
[0048] Furthermore, S5 includes: Retrieve command types for high-risk commands; Create corresponding tasks to be confirmed based on the command type; While executing the countdown task, the task to be confirmed is sent to the front end to obtain the user's operation command; Complete the process of issuing input commands according to the operation commands.
[0049] In the above implementation process, a task to be confirmed is created according to the command type, and the corresponding operation command of the user is obtained. The user can be provided with a regret window to avoid triggering unnecessary approvals and to safeguard the user's safe operation.
[0050] Users can see countdown and risk warning information in real time, which enhances risk awareness and operational caution. The countdown parameters can be dynamically configured according to command type, risk level or user role to achieve differentiated protection.
[0051] In the implementation of this application, when the bastion host detects a high-risk command, it no longer immediately blocks or triggers approval, but proactively inserts a system-level security delay process. The command is frozen in the buffer, and the system simultaneously provides the user with risk warnings and remaining countdown information, allowing the user to reassess the risk and choose whether to allow execution before execution. Through this "countdown buffer—reconfirmation—allow" technical process, the system establishes a controllable time isolation layer between command identification and execution.
[0052] Furthermore, the steps for completing the input command issuance process based on the operation command include: If the operation command is to cancel the operation, the entered command will be discarded; If the operation command is to confirm execution, the input command will be sent to the target server.
[0053] In the above implementation process, the corresponding subsequent processes are executed according to the operation command, reducing the user's waiting time, ensuring that every input command of the user can be executed properly, and reducing the possibility of misoperation.
[0054] Furthermore, after executing the countdown task and completing the process of issuing input commands, the process also includes: A security audit log is generated based on the input command, session ID, and countdown task.
[0055] The above implementation process can effectively record every step of the operation, enhance security audit and compliance traceability capabilities, provide data support for subsequent operation review, and also provide a secure copy of the user's operation process.
[0056] The entire process of this application, from inputting commands, session ID, countdown tasks, command recognition, buffering to user confirmation, is automatically recorded by the system, providing a complete basis for security auditing and compliance accountability.
[0057] For example, the system uses Apache Guacamole as the core component for remote protocol access, and sets up a system-level buffer proxy before its input forwarding layer to achieve real-time interception and buffering control of high-risk commands.
[0058] The system adopts a front-end and back-end separation architecture. The buffer proxy is implemented by the back-end Java service and communicates with the Vue-based front-end interface in real time through the WebSocket protocol.
[0059] It receives input commands from user terminals, browsers, or APIs and intercepts them before they enter Guacamole. It determines whether the input is a high-risk command based on a rule base (keywords, regular expressions, context patterns). High-risk commands are frozen at the system level, preventing direct writing to the Guacamole output stream. Simultaneously, a countdown task is created. A Java timer / delay queue is created to execute the countdown on the backend, ensuring that the buffering mechanism is not affected even if the frontend disconnects.
[0060] When an operations and maintenance personnel enters a command, the bastion host session agent intercepts the command, determines its risk level, and allows it to proceed directly if it is low-risk. If it is high-risk, a countdown buffer process is initiated, command forwarding is immediately interrupted, a countdown begins, and a forced dialog box pops up. The "Confirm Execution" button is initially grayed out and waits for the user to make a selection after the countdown ends. If the user clicks "Cancel," the command is permanently discarded; if the user clicks "Confirm Execution," the command continues to be sent to the target server.
[0061] Take the server restart command as an example: The operations and maintenance personnel enter the "reboot" command in the front-end terminal. The command is transmitted to the back-end buffer module through the Guacamole session channel. Based on a predefined rule base (e.g., ^(reboot|shutdown)), it is matched and determined to be a "high-risk reboot command". The command is immediately frozen to prevent it from being written to the guacd process, and a suspended task is created in the back-end, starting a countdown (e.g., 10 seconds) according to the security policy. The countdown information is pushed to the front-end interface in real time via WebSocket. Upon detecting the high-risk command reboot, after 10 seconds, a "confirm execution" or "cancel" option will be executed. If the user clicks "cancel", the system immediately destroys the suspended command; if the user clicks "confirm execution", the system immediately allows the command to proceed. If no action is taken before the countdown ends, the system automatically handles the situation according to the preset policy.
[0062] The system audit module records complete events, including command text, user, session ID, countdown process, and final result.
[0063] For example, suppose a sensitive operation requires approval, such as deleting a database (drop database prod). A traditional bastion host would typically trigger the approval process immediately, without the user being aware that the command has been issued. The method described in this application can execute the following process: When a user inputs a command, it is identified as a high-risk command requiring approval. A system-level security buffer mechanism intervenes instead of immediately initiating the approval process. The backend freezes the command and begins a countdown, for example, 20 seconds. The frontend interface displays a message indicating that the command requires approval (drop database prod). To prevent accidental operations, a 20-second security buffer countdown has been initiated. If this is an accidental operation, it can be canceled immediately; the system will not initiate an approval "confirm execution" or "cancel" request. If the user clicks cancel, the approval process will not be triggered, and the command will be discarded by the system. Only if the user confirms execution will the system officially submit the approval process. If no action is taken after the countdown ends, the system policy can be defined to automatically cancel or automatically submit the approval.
[0064] Example 2 This application provides a computer program product that, when run on a computer, causes the computer to perform any of the methods described in Embodiment 1.
[0065] Example 3 In order to implement the method corresponding to Embodiment 1 above and achieve the corresponding function and technical effect, a bastion host anti-misoperation device is provided below, such as... Figure 2 As shown, the device includes: Module 1 is used to obtain input commands; Interception module 2 is used to intercept input commands based on the bastion host session agent; Risk level assessment module 3 is used to assess the risk level of the intercepted input command and obtain the risk level corresponding to the input command. The safety countdown buffer module 4 is used to perform safety countdown buffering on input commands according to the risk level and create countdown tasks; Execution module 5 is used to execute the countdown task and complete the process of issuing input commands.
[0066] In the above implementation process, after recognizing the user's input command, a safe countdown buffer is applied, which can effectively prevent misoperation, improve the real-time control capability of the execution process, establish an isolation layer between command recognition and execution, ensure that high-risk operations can be interrupted or delayed, and improve the flexible control of operations.
[0067] Furthermore, the risk level assessment module 3 is also used for: The input command is parsed to obtain key information; The key information is matched with a pre-built dynamic high-risk instruction library to obtain the risk level corresponding to the key information.
[0068] In the above implementation process, the input commands are parsed and the key information is matched with the dynamic high-risk command library. This can clarify the risk level of the input commands, facilitate timely judgment on the executability of the input commands, and shorten the system response time.
[0069] Furthermore, the safety countdown buffer module 4 is also used for: Determine whether the risk level is high-risk. If so, determine that the input command is a high-risk command, perform a safe countdown buffering process on the high-risk command, and create a countdown task; If not, determine that the input command is a low-risk command and perform a release operation for low-risk commands.
[0070] In the above implementation process, the risk level of the input command is distinguished and corresponding operations are performed to ensure that high-risk commands can be buffered in a timely manner with a safe countdown, effectively preventing misoperation, and at the same time making up for the lack of buffering operations in the blocking process.
[0071] Furthermore, the safety countdown buffer module 4 is also used for: Take over the execution flow of high-risk commands; Lock the execution flow of high-risk commands into a pre-built security buffer and suspend the forwarding of high-risk commands.
[0072] In the above implementation process, the execution flow of high-risk commands is temporarily stored in a security buffer, establishing effective isolation between command identification and execution, improving the real-time control capability of the execution process, and providing a guarantee for the subsequent secure execution of high-risk commands.
[0073] Furthermore, the safety countdown buffer module 4 is also used for: Obtain the command type, risk level, and user role of high-risk commands; The parameters are dynamically configured based on the command type, risk level, and user role to generate countdown parameters corresponding to high-risk commands. Create a delay queue based on the countdown parameters and generate a countdown task.
[0074] In the above implementation process, corresponding countdown parameters are configured according to the command type, risk level and user role of high-risk commands to ensure that the delay of high-risk commands meets user needs and does not cause users to wait for a long time, thereby improving user experience.
[0075] Furthermore, execution module 5 is also used for: Retrieve command types for high-risk commands; Create corresponding tasks to be confirmed based on the command type; While executing the countdown task, the task to be confirmed is sent to the front end to obtain the user's operation command; Complete the process of issuing input commands according to the operation commands.
[0076] In the above implementation process, a task to be confirmed is created according to the command type, and the corresponding operation command of the user is obtained. The user can be provided with a regret window to avoid triggering unnecessary approvals and to safeguard the user's safe operation.
[0077] Furthermore, execution module 5 is also used for: If the operation command is to cancel the operation, the entered command will be discarded; If the operation command is to confirm execution, the input command will be sent to the target server.
[0078] In the above implementation process, the corresponding subsequent processes are executed according to the operation command, reducing the user's waiting time, ensuring that every input command of the user can be executed properly, and reducing the possibility of misoperation.
[0079] Furthermore, the device also includes a generation module for: A security audit log is generated based on the input command, session ID, and countdown task.
[0080] The above implementation process can effectively record every step of the operation, enhance security audit and compliance traceability capabilities, provide data support for subsequent operation review, and also provide a secure copy of the user's operation process.
[0081] The aforementioned bastion host anti-misoperation device can implement the method of Embodiment 1. The options in Embodiment 1 also apply to this embodiment, and will not be described in detail here.
[0082] The remaining contents of this embodiment can be referred to the contents of Embodiment 1 above, and will not be repeated in this embodiment.
[0083] Example 4 This application provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor runs the computer program to enable the electronic device to perform the bastion host anti-misoperation method of Embodiment 1.
[0084] Alternatively, the aforementioned electronic device may be a server.
[0085] Please see Figure 3 , Figure 3This is a schematic diagram illustrating the structural composition of an electronic device provided in an embodiment of this application. The electronic device may include a processor 31, a communication interface 32, a memory 33, and at least one communication bus 34. The communication bus 34 is used to enable direct communication between these components. In this embodiment, the communication interface 32 is used for signaling or data communication with other node devices. The processor 31 may be an integrated circuit chip with signal processing capabilities.
[0086] The processor 31 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or the processor 31 can be any conventional processor.
[0087] The memory 33 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The memory 33 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 31, the device can perform the aforementioned operations. Figure 1 The various steps involved in the method implementation examples.
[0088] Optionally, the electronic device may also include a storage controller and an input / output unit. The memory 33, storage controller, processor 31, peripheral interface, and input / output unit are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other via a communication bus 34. The processor 31 is used to execute executable modules stored in the memory 33, such as software function modules or computer programs included in the device.
[0089] Input / output units are used to enable users to create tasks and set optional start periods or preset execution times for those tasks, facilitating user-server interaction. Input / output units can be, but are not limited to, a mouse and keyboard.
[0090] Understandable. Figure 3 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown. Figure 3 The components shown can be implemented using hardware, software, or a combination thereof.
[0091] In addition, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the bastion host anti-misoperation method of Embodiment 1.
[0092] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.
[0093] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using dedicated hardware-based apparatus that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0094] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0095] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, external hard drives, ROM, RAM, magnetic disks, or optical disks.
[0096] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. 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.
[0097] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.
[0098] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for preventing misoperation of a bastion host, characterized in that, The method includes: Get input commands; The input commands are intercepted according to the bastion host session agent; The risk level of the intercepted input command is assessed to obtain the risk level corresponding to the input command. The input command is buffered with a safe countdown based on the risk level, and a countdown task is created. Execute the countdown task and complete the process of issuing the input command.
2. The method for preventing misoperation of a bastion host according to claim 1, characterized in that, The step of assessing the risk level of the intercepted input command to obtain the risk level corresponding to the input command includes: The input command is parsed to obtain key information; The key information is matched with a pre-built dynamic high-risk instruction library to obtain the risk level corresponding to the key information.
3. The method for preventing misoperation of a bastion host according to claim 1, characterized in that, The step of performing a safe countdown buffering process on the input command according to the risk level and creating a countdown task includes: Determine whether the risk level is a high-risk level; If so, determine that the input command is a high-risk command, perform a safe countdown buffering process on the high-risk command, and create a countdown task; If not, determine that the input command is a low-risk command and perform a release operation on the low-risk command.
4. The method for preventing misoperation of a bastion host according to claim 3, characterized in that, The step of performing a secure countdown buffering process on the high-risk commands includes: Take over the execution flow of the high-risk commands; The execution flow of the high-risk command is locked in a pre-built security buffer, and the forwarding of the high-risk command is suspended.
5. The method for preventing misoperation of a bastion host according to claim 3, characterized in that, The steps for creating a countdown task include: Obtain the command type, risk level, and user role of the high-risk command; Based on the command type, risk level, and user role, the parameters are dynamically configured to generate the countdown parameters corresponding to the high-risk command. A delay queue is created based on the countdown parameters, and the countdown task is generated.
6. The method for preventing misoperation of a bastion host according to claim 3, characterized in that, The steps of executing the countdown task and completing the process of issuing the input command include: Obtain the command type of the high-risk command; Create a corresponding task to be confirmed based on the command type; While executing the countdown task, the task to be confirmed is sent to the front end to obtain the user's operation command; The process of issuing the input command is completed according to the operation command.
7. The method for preventing misoperation of a bastion host according to claim 6, characterized in that, The step of completing the process of issuing the input command according to the operation command includes: If the operation command is a cancel operation, the input command will be discarded; If the operation command is to confirm execution, the input command is sent to the target server.
8. The method for preventing misoperation of a bastion host according to claim 1, characterized in that, After the steps of executing the countdown task and completing the process of issuing the input command, the method further includes: A security audit log is generated based on the input command, session ID, and countdown task.
9. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 8.
10. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the bastion host anti-misoperation method according to any one of claims 1 to 8.
11. A storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the bastion host anti-misoperation method as described in any one of claims 1 to 8.