Bastion host processing method adaptive to multiple enterprises, bastion host, product and medium
By receiving and parsing enterprise customized configuration files, hot updates and cache synchronization are realized, and combined with counter and function flag mechanisms, it solves the resource waste and performance problems of bastion machines in multi-enterprise service scenarios, improves flexibility and security, and meets diverse needs. operation and maintenance needs.
Patent Information
- Application Number
- CN202411051744.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing bastion host processing methods have problems such as waste of hardware resources, high management costs, poor performance, and poor scalability in multi-enterprise service scenarios, and cannot meet the diverse operation and maintenance management needs of multiple enterprises.
By receiving and parsing enterprise-customized configuration files, hot updates and cached data synchronization are achieved, counters and microservice processing are used to dynamically adjust the service structure, and the function flag mechanism is combined with the function flag mechanism to dynamically enable or disable services without restarting the service, and build a multi-dimensional Access permission matrix performs refined access control and behavioral auditing.
It avoids waste of resources, realizes real-time updates of configurations, improves the flexibility and availability of bastion machines, meets the needs of enterprises of different sizes, enhances security and response speed, and provides precise security management and active protection mechanisms.
Smart Images

Figure CN118869788A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a bastion host processing method, bastion host, product and medium adapted to multiple enterprises. Background Art
[0002] With the rapid development of information technology, enterprises have an increasing demand for network security and operation and maintenance management. In this context, bastion hosts, as an important security management system, are widely used in enterprise network environments. Bastion hosts mainly provide centralized user identity authentication, permission management, and behavior auditing functions, effectively improving the information security level and operation and maintenance efficiency of enterprises.
[0003] However, currently, bastion host solutions on the market usually provide services to a single enterprise in a one-to-one manner. Developers will design and implement a complete bastion host based on the specific needs of a specific enterprise.
[0004] However, the bastion host processing method in the related art requires the deployment of an independent bastion host for each additional enterprise customer, which leads to a huge waste of hardware resources and a significant increase in management costs. Secondly, when multiple enterprises need to update their configurations at the same time, a new bastion host must be designed. These problems seriously affect the overall performance, scalability and reliability of the bastion host in multi-enterprise service scenarios. In summary, the bastion host processing method in the related art cannot meet the diverse operation and maintenance management needs of multiple enterprises. Summary of the invention
[0005] The present application provides a bastion host processing method, bastion host, product and medium adapted to multiple enterprises, which are used to meet the diverse operation and maintenance management needs of multiple enterprises.
[0006] In the first aspect, the present application provides a bastion host processing method adapted to multiple enterprises, including: upon receiving a customized configuration file sent by an enterprise terminal, extracting the customized configuration file, wherein the customized configuration file is a customized configuration for the enterprise terminal; parsing the customized configuration file to obtain required configuration items; comparing the required configuration items with the current configuration items, identifying the changed configuration items, and generating a configuration change set; performing a hot update operation based on the configuration change set; if the hot update is successful, synchronously updating the cached data; for each service involved in the configuration change set, increasing its corresponding counter by 1; determining whether there is any service whose counter value exceeds the corresponding preset frequency threshold; if there is a service whose counter value exceeds the corresponding preset frequency threshold, microservice processing is performed on the corresponding service.
[0007] By adopting the above technical solution, firstly, the method realizes support for the personalized needs of enterprises by receiving and parsing the enterprise-customized configuration files. It can identify the unique needs of each enterprise in a targeted manner. This method avoids the waste of resources of deploying independent bastion hosts for each enterprise; secondly, through hot update operations and cache data synchronization, real-time updates of configurations are realized, avoiding the problem of restarting services or recompiling applications. Furthermore, through the counter mechanism and microservice processing, the bastion host can dynamically adjust the service structure and optimize resource allocation according to the actual usage of the enterprise. This method not only improves the flexibility and availability of the bastion host, but also provides the best service experience for enterprises of different sizes and needs, and meets the diverse operation and maintenance management needs of multiple enterprises.
[0008] In combination with some embodiments of the first aspect, in some embodiments, after the step of synchronously updating the cached data if the hot update is successful, the method also includes: upon receiving an encryption requirement file sent by the enterprise terminal, parsing the encryption requirement file to obtain the data to be encrypted and the corresponding encryption level; selecting a corresponding encryption algorithm according to the encryption level, encrypting and storing the encryption requirement file; parsing predefined access control rules to construct a multidimensional access permission matrix based on roles, resources and related factors; upon receiving a resource access request sent by a user terminal, determining the authorization scope of the user terminal based on the multidimensional access permission matrix, and the authorization scope is used to allow the user terminal to access resources within the authorization scope; capturing and recording the user behavior of the user terminal in real time to obtain an audit log, and the user behavior includes login events, operation behaviors and resource access activities.
[0009] By adopting the above technical solutions, firstly, by parsing and processing the encryption requirement files, a flexible data encryption mechanism is implemented to improve data security. Secondly, by building a multi-dimensional access permission matrix, refined access control is achieved and the security of the bastion host is enhanced. Furthermore, by capturing and recording user behavior in real time and generating audit logs, comprehensive behavior monitoring and tracing capabilities are provided. The combination of these functions not only improves the overall security of the bastion host, but also provides enterprises with more comprehensive and flexible security management options. At the same time, this method also improves the availability of the bastion host, allowing enterprises to customize security policies according to their own needs and achieve more accurate security management.
[0010] In combination with some embodiments of the first aspect, in some embodiments, the step of performing a hot update operation based on the configuration change set specifically includes: for services marked as disabled in the configuration change set, disabling the services marked as disabled in the current configuration item through a function flag; for services marked as newly added in the configuration change set, determining whether they exist in the current configuration item; if so, enabling the services marked as newly added in the current configuration item through the function flag.
[0011] By adopting the above technical solution, first of all, through the function flag mechanism, the bastion host can dynamically enable or disable specific services without restarting the service, which improves the flexibility of the bastion host. For services marked as disabled, the bastion host can disable them directly in the current configuration item through the function flag, avoiding unnecessary resource consumption. For new services, the bastion host first determines whether they exist, and then enables them through the function flag, ensuring the smooth addition of services. This method not only improves the response speed of the bastion host, but also reduces the impact of service changes on the overall stability of the bastion host. At the same time, it also provides enterprises with more flexible service customization options, allowing the bastion host to better adapt to the dynamic needs of enterprises.
[0012] In combination with some embodiments of the first aspect, in some embodiments, when a resource access request sent by a user terminal is received, the authorization scope of the user terminal is determined based on the multidimensional access permission matrix, and the authorization scope is used to allow the user terminal to access resources within the authorization scope. After the step, the method also includes: enabling the functions within the authorization scope of the user terminal and disabling the functions used for security through the function flag; after the step of capturing and recording the user behavior of the user terminal in real time to obtain an audit log, and the user behavior includes login events, operation behaviors and resource access activities, the method also includes: when it is determined that the user terminal is not safe according to the audit log; disabling the functions within the authorization scope of the user terminal and enabling the functions used for security through the function flag.
[0013] By adopting the above technical solution, firstly, the bastion host can accurately control the enabling and disabling of functions within the user's authorized scope through the function flag mechanism, thereby improving the accuracy of access control. Secondly, by capturing and analyzing user behavior in real time, the bastion host can dynamically determine the security status of the user terminal. When an unsafe situation is detected, the bastion host can immediately prohibit functions within the authorized scope through function flags and enable security-related functions, thereby achieving a rapid response to potential security threats. This method not only improves the security of the bastion host, but also enhances the bastion host's ability to respond to security threats in real time, providing enterprises with a more proactive and intelligent security protection mechanism.
[0014] In combination with some embodiments of the first aspect, in some embodiments, if the hot update is successful, the step of synchronously updating the cache data specifically includes: if the hot update is successful, updating the configuration change set in the old cache data to obtain the new cache data and switching to the new cache data using atomic operations; clearing the old cache data; notifying the service that depends on the cache to refresh its local cache, so that a part of the old cache data is updated to a corresponding part of the new cache data.
[0015] By adopting the above technical solution, firstly, the atomic operation is used to switch to the new cache data, which ensures the atomicity and consistency of the cache update. Secondly, by cleaning up the old cache data, memory leaks and data redundancy are avoided. Furthermore, by notifying the dependent services to refresh the local cache, the consistency of the entire bastion host cache is ensured. This method not only improves the efficiency and reliability of cache updates, but also reduces the bastion host anomalies that may be caused by cache inconsistencies. At the same time, it also optimizes the resource utilization of the bastion host, improves the overall performance and response speed of the bastion host, and provides enterprises with a more stable and efficient service experience.
[0016] In combination with some embodiments of the first aspect, in some embodiments, after the step of performing a hot update operation based on the configuration change set, the method further includes: if the hot update fails, determining the hot update operation as a total failure; in the case of a total failure, restoring to the current configuration item.
[0017] By adopting the above technical solution, the hot update operation is judged as a complete failure, thereby avoiding the bastion host inconsistency problem that may be caused by partial updates.
[0018] In combination with some embodiments of the first aspect, in some embodiments, the step of recovering to the current configuration item in the event of all failures specifically includes: loading the current configuration item in the event of all failures; comparing the current state with the current configuration item, identifying the changed configuration item, and generating a configuration rollback set; rolling back the applied configuration changes one by one according to the configuration rollback set; after all rollbacks, resetting all corresponding service internal states and caches; and generating a recovery operation log.
[0019] By adopting the above technical solutions, this method realizes a more reliable and traceable configuration recovery mechanism. First, by loading the current configuration items and comparing them with the current state, the bastion host can accurately identify the configuration items that need to be rolled back. Secondly, by rolling back the applied configuration changes one by one, the accuracy and integrity of the recovery process are ensured. Furthermore, by resetting the internal state and cache of the service, problems that may be caused by residual data are avoided. Finally, by generating a recovery operation log, a complete audit tracking capability is provided.
[0020] In a second aspect, the present application provides a bastion host that is adaptable to multiple enterprises, and the bastion host that is adaptable to multiple enterprises includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, and the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the bastion host that is adaptable to multiple enterprises to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, the present application provides a computer program product comprising instructions, which, when run on a bastion host adapted to multiple enterprises, enables the bastion host adapted to multiple enterprises to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0022] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on a bastion host adapted to multiple enterprises, enables the bastion host adapted to multiple enterprises to execute the method described in the first aspect and any possible implementation of the first aspect.
[0023] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. First, the method supports the personalized needs of enterprises by receiving and parsing the enterprise-customized configuration files. It can identify the unique needs of each enterprise in a targeted manner. This method avoids the waste of resources of deploying independent bastion hosts for each enterprise; secondly, through hot update operations and cache data synchronization, real-time updates of configurations are achieved, avoiding the problem of restarting services or recompiling applications. Furthermore, through the counter mechanism and microservice processing, the bastion host can dynamically adjust the service structure and optimize resource allocation according to the actual usage of the enterprise. This method not only improves the flexibility and availability of the bastion host, but also provides the best service experience for enterprises of different sizes and needs, and meets the diverse operation and maintenance management needs of multiple enterprises.
[0024] 2. First, through the function flag mechanism, the bastion host can dynamically enable or disable specific services without restarting the service, which improves the flexibility of the bastion host. For services marked as disabled, the bastion host can disable them directly in the current configuration item through the function flag, avoiding unnecessary resource consumption. For new services, the bastion host first determines whether they exist, and then enables them through the function flag, ensuring the smooth addition of services. This method not only improves the response speed of the bastion host, but also reduces the impact of service changes on the overall stability of the bastion host. At the same time, it also provides enterprises with more flexible service customization options, allowing the bastion host to better adapt to the dynamic needs of enterprises.
[0025] 3. First, the bastion host can accurately control the enabling and disabling of functions within the user's authorized scope through the function flag mechanism, thereby improving the accuracy of access control. Secondly, by capturing and analyzing user behavior in real time, the bastion host can dynamically determine the security status of the user's terminal. When an unsafe situation is detected, the bastion host can immediately prohibit functions within the authorized scope through function flags and enable security-related functions, thereby achieving a rapid response to potential security threats. This approach not only improves the security of the bastion host, but also enhances the bastion host's ability to respond to security threats in real time, providing enterprises with a more proactive and intelligent security protection mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flowchart of a bastion host processing method adapted to multiple enterprises in an embodiment of the present application; Figure 2 This is another flowchart of the bastion host processing method adapted to multiple enterprises in an embodiment of the present application; Figure 3 This is another flowchart of the bastion host processing method adapted to multiple enterprises in an embodiment of the present application; Figure 4 It is an exemplary hardware structure diagram of a bastion host adapted to multiple enterprises in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0029] See also Figure 1 , Figure 1 This is a flowchart of a bastion host processing method adapted to multiple enterprises in an embodiment of the present application; S101, when receiving a customized configuration file sent by an enterprise terminal, extracting the customized configuration file, wherein the customized configuration file is a configuration customized for the enterprise terminal; The enterprise terminal refers to the device or interface used by enterprise users to access and manage the bastion host. The customized configuration file represents a set of system settings and parameters set by a specific enterprise, for example, including user role configuration files, access policy requirement files, audit rule files, encryption requirement files, etc.
[0030] S102, parsing the custom configuration file to obtain required configuration items; In some specific embodiments, the bastion host reads and interprets the configuration content in the file item by item according to the predefined parsing rules. In this process, the bastion host converts each setting item in the configuration file into a format that can be recognized and used within the bastion host, forming a structured list of required configuration items. This list contains all the specific system settings and parameters that the enterprise wants to update or modify.
[0031] S103, comparing the required configuration item with the current configuration item, identifying the changed configuration item, and generating a configuration change set; The current configuration item refers to the configuration settings currently being used by the enterprise terminal.
[0032] It should be noted that in actual use, there are two situations. The first is when a new enterprise customer is connected to the bastion host, and the "current configuration item" refers to the default configuration of the bastion host. In this case, the bastion host will compare the customized configuration of the new enterprise with the default configuration to determine the specific changes that need to be made. The second is for enterprise customers who have already connected to the bastion host, when they request a configuration change, the "current configuration item" refers to the existing configuration of the enterprise before the change. The bastion host will compare the new customized configuration with the existing configuration of the enterprise to identify the specific items that need to be updated.
[0033] Through this comparison, the bastion host can identify which configuration items have changed, including newly added configuration items, deleted configuration items, and configuration items with changed values. All these changed configuration items will be collected to form a configuration change set.
[0034] In actual use, in an environment where multiple enterprises share a bastion host, when an enterprise needs to update its configuration, the existing technology requires restarting the entire bastion host, which will cause the services of other enterprises to be interrupted, seriously affecting the availability and stability of the bastion host.
[0035] Therefore, S104, perform a hot update operation based on the configuration change set, and determine whether the hot update is successful; If the hot update is successful, execute step S105; If the hot update is unsuccessful, execute step S110; In some embodiments, the hot update operation based on the configuration change set can be implemented in a variety of ways: Optionally, the bastion host can take the following steps: 1. Traverse each change item in the configuration change set; 2. For each change item, locate the corresponding component or service in the bastion host; 3. Use the reflection mechanism to dynamically modify the configuration properties of the component; 4. Trigger the configuration refresh method of the component; 5. Verify whether the updated component status is normal; 6. If all items are updated successfully, the hot update is determined to be successful, otherwise it is determined to be a failure. Optionally, the bastion host can also adopt the following methods: 1. Create a temporary configuration environment; 2. Apply the configuration change set in the temporary environment; 3. Gradually switch the bastion host components to use the new configuration environment; 4. Monitor the performance and stability of the bastion host during the switching process; 5. If the switching process is successfully completed and the bastion host is stable, the hot update is determined to be successful, otherwise roll back to the original configuration and determine failure. It can be understood that other methods can also be used to implement hot update operations based on configuration change sets, which are not limited here.
[0036] S105: If the hot update is successful, the cache data is updated synchronously; The cached data refers to the data generated during the update process or the cached data of the old bastion host.
[0037] In some embodiments, the bastion machine identifies all cached data affected by the configuration change. The bastion machine then updates the cached data based on the latest configuration information. This process may include modifying existing cache entries, adding new cache entries, or deleting cache entries that are no longer needed. The bastion machine ensures that the update process is atomic, that is, either all relevant caches are successfully updated or all updates are invalid to maintain cache consistency. After the update is complete, the bastion machine verifies the correctness of the cached data to ensure that they fully match the latest configuration of the bastion machine.
[0038] It should be noted that when the bastion host connects to a new enterprise customer for the first time, no intermediate data that needs to be synchronized will be generated because no configuration updates have been made. At the same time, the new customer does not have the cached data of the old bastion host, so step S105 (synchronous update of cached data) may not be applicable in this case. The bastion host will decide whether to execute step S105 based on the specific situation. Possible processing methods include: skipping this step or executing this step but processing empty set data. Regardless of which processing method is used, the bastion host will ensure that the configuration and related data of the new customer remain consistent, laying the foundation for subsequent operations.
[0039] In some specific embodiments, S105 specifically includes: S1051, if the hot update is successful, then update the configuration change set in the old cache data to obtain new cache data; In some embodiments, the bastion host first verifies the success status of the hot update operation to ensure that all expected configuration changes have been applied correctly. Then, the bastion host obtains the current old cache data, which is usually an in-memory data structure containing all configuration items. The bastion host traverses each item in the configuration change set and applies these changes to the corresponding location of the old cache data. This process may involve adding new configuration items, modifying the values of existing configuration items, or deleting configuration items that are no longer needed. During the update process, the bastion host maintains the consistency and integrity of the data and may use a transaction mechanism to ensure the atomicity of the update operation. After the update is completed, the bastion host verifies the newly generated cache data to ensure that all changes have been applied correctly and that the overall configuration structure remains complete and valid.
[0040] S1052, using an atomic operation to switch to the new cache data; Among them, atomic operation means that in a concurrent environment, an operation is either completely executed successfully or not executed at all, and there will be no partial execution state.
[0041] In some embodiments, the bastion host needs to ensure that the switching process from the old cached data to the new cached data is completed instantaneously, and there will be no intermediate state where part of the old data and part of the new data are used. To achieve this, the bastion host usually uses specific concurrency control mechanisms, such as atomic references or compare-and-swap operations. During the switching process, the bastion host suspends all read operations on the cached data and updates the pointer or reference to the cached data from the old data to the new data. After the switch is completed, the bastion host immediately resumes the read operation on the cached data, and all reads will access the new cached data.
[0042] S1053, clearing the old cache data; S1054: Notify the service that depends on the cache to refresh its local cache so that a portion of the old cache data is updated to a corresponding portion of the new cache data.
[0043] In some embodiments, the bastion host first identifies all services that rely on cached data. The bastion host then sends a notification to these services to inform them that the central cache has been updated. This notification may contain a summary of the update, such as a list of changed configuration items or version numbers. The notified service decides how to handle the update based on its own strategy. Typically, the service checks its local cache to determine which parts need to be updated. The service then gets the latest data from the new bastion host cache and updates its local cache. This process may be incremental, updating only the changed parts, or it may be a full update, completely refreshing the entire local cache. During the update process, the service needs to ensure data consistency and may use version control or transaction mechanisms to manage the update process. After the update is complete, the service may report the update status to the bastion host so that the bastion host can track the overall update progress.
[0044] It can be seen that, firstly, switching to the new cache data through atomic operations ensures the atomicity and consistency of cache updates. Secondly, by cleaning up the old cache data, memory leaks and data redundancy are avoided. Furthermore, by notifying dependent services to refresh the local cache, the consistency of the entire bastion host cache is ensured. This method not only improves the efficiency and reliability of cache updates, but also reduces the bastion host anomalies that may be caused by cache inconsistencies. At the same time, it also optimizes the resource utilization of the bastion host, improves the overall performance and response speed of the bastion host, and provides enterprises with a more stable and efficient service experience.
[0045] However, in actual use, some services may need to update their configuration very frequently.
[0046] Therefore, S106, for each service involved in the configuration change set, increase its corresponding counter by 1; A service is an independent functional unit or module in a bastion host, part of a configuration change set, or a corresponding service in a bastion host settings and parameter set, without limitation here.
[0047] S107, determining whether there is any counter value of the service that exceeds the corresponding preset frequency threshold; If the frequency exceeds the corresponding preset frequency threshold, execute step S108; If the frequency does not exceed the corresponding preset frequency threshold, execute step S109; S108: If the counter value of the service exceeds the corresponding preset frequency threshold, the corresponding service is processed as a microservice.
[0048] Among them, microservice processing refers to the process of splitting a large and complex service into multiple independently running and loosely coupled small services.
[0049] In some embodiments, microservice processing of services can be implemented in a variety of ways: for example, the bastion host can adopt the following steps: 1. Analyze the functions and data flows of the target service; 2. Design the microservice architecture, including service boundaries and interface definitions; 3. Refactor the service code to split the functions into multiple independent microservices; 4. Create independent data storage for each new microservice; 5. Implement a communication mechanism between services. It is understandable that other methods can also be used to implement microservice processing of services, which are not limited here.
[0050] It should be noted that after completing step S105, the configuration update has been completed, that is, the bastion machine will microservice the frequently changing services. Microservice makes the update of a single service easier and faster, reducing the impact on other services.
[0051] In some embodiments, for services that have been successfully microserviced, the bastion host marks them as optimized. In subsequent configuration updates, these services will no longer be included in the frequency detection scope. In some embodiments, the bastion host adopts a fault-tolerant design for the microservices process. If a microservices operation fails, the bastion host will not interrupt or roll back the entire optimization process. Instead, it will record the failure information in the log and try to microservice the service again when the next trigger condition is met.
[0052] It can be seen that, firstly, the method supports the personalized needs of enterprises by receiving and parsing the enterprise-customized configuration files. It can identify the unique needs of each enterprise in a targeted manner. This method avoids the waste of resources of deploying an independent bastion host for each enterprise; secondly, through hot update operations and cache data synchronization, real-time updates of configurations are achieved, avoiding the problem of restarting services or recompiling applications. Furthermore, through the counter mechanism and microservice processing, the bastion host can dynamically adjust the service structure and optimize resource allocation according to the actual usage of the enterprise. This method not only improves the flexibility and availability of the bastion host, but also provides the best service experience for enterprises of different sizes and needs, and meets the diverse operation and maintenance management needs of multiple enterprises.
[0053] S109: If there is no counter value of the service that exceeds the corresponding preset frequency threshold, microservice processing is not performed.
[0054] S110: If the hot update fails, the hot update operation is determined to be completely failed.
[0055] In some embodiments, the bastion host first stops all ongoing update operations. The bastion host then records the specific reason for the failure, which may include configuration format errors, insufficient bastion host resources, component response timeouts, etc. The bastion host marks the entire hot update process as failed, which means that all configuration changes attempted to be applied in this update are considered invalid. This decision of total failure ensures that the bastion host will not be in a partially updated, inconsistent state, thereby maintaining the integrity and consistency of the bastion host.
[0056] S111. In the event of all failures, restore to the current configuration item.
[0057] In some embodiments, the bastion host initiates a recovery process with the goal of restoring all affected components and services to the state before the update attempt. This process typically includes rolling back configuration changes that have been applied, resetting the affected bastion host state, and restoring the original cached data. The bastion host checks each configuration item that may have been modified one by one to ensure that they are accurately restored to their previous state. The purpose of this recovery process is to ensure that the bastion host can continue to operate with a known, stable configuration, thereby maintaining the reliability and consistency of the bastion host.
[0058] It can be seen that by judging the hot update operation as a complete failure, the bastion host inconsistency problem that may be caused by partial updates is avoided.
[0059] In some embodiments, step S111 specifically includes: refer to Figure 2 , Figure 2 This is another flowchart of the bastion host processing method adapted to multiple enterprises in an embodiment of the present application; S201. In the case of all failures, load the current configuration item; In some embodiments, the bastion machine first confirms the status of the hot update failure and then starts the recovery process. The bastion machine accesses the backup location where the current configuration is stored, which may be a configuration database, a file bastion machine, or a distributed storage bastion machine. The bastion machine reads the complete current configuration data, including configuration information for all services and components. This data is loaded into the bastion machine's memory in preparation for subsequent comparison and rollback operations. During the loading process, the bastion machine verifies the integrity and consistency of the configuration data to ensure that the last known stable configuration version is loaded.
[0060] S202, comparing the current state with the current configuration item, identifying the changed configuration item, and generating a configuration rollback set; The principle and process of this step have been described in detail in step S103. The relevant implementation process can refer to step S103 and is not limited here. S203, rolling back the applied configuration changes one by one according to the configuration rollback set; Rollback refers to restoring the applied configuration changes to their previous state.
[0061] In some embodiments, the bastion machine processes each configuration item that needs to be rolled back in sequence in the order in the configuration rollback set. For each configuration item, the bastion machine first confirms its current value and then restores it to the original value recorded in the configuration rollback set. This process may involve operations such as modifying the configuration in memory, updating the configuration file, and calling the configuration management API. The bastion machine ensures that each rollback operation is completed successfully and records a detailed operation log in the process. If any errors or exceptions are encountered during the rollback process, the bastion machine records the error information and attempts to continue processing the next configuration item. The rollback process continues until all items in the configuration rollback set have been processed.
[0062] S204: After all rollbacks, reset all corresponding service internal states and caches; In some embodiments, the bastion machine first confirms that all configuration rollback operations have been successfully completed. Then, the bastion machine identifies all affected services and components, which are typically services whose configurations have been modified during the hot update process. For each identified service, the bastion machine performs a series of operations to reset its internal state. This may include clearing temporary data in memory, resetting counters and flags, refreshing internal caches, etc. At the same time, the bastion machine also processes external caches related to these services, such as data in a distributed cache bastion machine. The purpose of the reset process is to ensure that the operating status of all services fully matches the configuration after the rollback, avoiding inconsistencies caused by residual old states or cached data.
[0063] S205: Generate a recovery operation log.
[0064] The recovery operation log is a document that records the entire configuration recovery process in detail.
[0065] It can be seen that this method implements a more reliable and traceable configuration recovery mechanism. First, by loading the current configuration items and comparing them with the current state, the bastion host can accurately identify the configuration items that need to be rolled back. Second, by rolling back the applied configuration changes one by one, the accuracy and integrity of the recovery process are ensured. Furthermore, by resetting the internal state and cache of the service, problems that may be caused by residual data are avoided. Finally, by generating a recovery operation log, a complete audit tracking capability is provided.
[0066] The above embodiments describe in detail how the bastion host handles and optimizes the configuration update process in a multi-enterprise environment. The following embodiments will focus on describing the management mechanism of the bastion host.
[0067] Figure 3 This is another flowchart of the bastion host processing method adapted to multiple enterprises in an embodiment of the present application; In some specific embodiments, step S104 specifically includes: Step S1041: For the services marked as disabled in the configuration change set, disable the services marked as disabled in the current configuration item through a function flag; In some embodiments, the bastion host first traverses all items in the configuration change set and identifies the services marked as disabled. For each service marked as disabled, the bastion host sets it to disabled state in the current configuration item through the feature flag mechanism.
[0068] S1042, for the service marked as newly added in the configuration change set, determine whether it exists in the current configuration item; In some embodiments, the bastion machine traverses the list of services marked as newly added in the configuration change set. For each newly added service, the bastion machine checks whether the definition or record of the service already exists in the current configuration item.
[0069] S1043. If so, enable the service marked as newly added in the current configuration item through the function flag.
[0070] In some embodiments, the bastion host uses a feature flag mechanism to activate the corresponding newly added service in the current configuration item. This process may involve updating the service status in the configuration database, modifying the configuration object in memory, and notifying the relevant bastion host components that the service is available. The bastion host needs to ensure that this enabling operation is atomic, that is, it either succeeds completely or fails completely to avoid inconsistent states caused by partial updates.
[0071] It can be seen that, first of all, through the function flag mechanism, the bastion host can dynamically enable or disable specific services without restarting the service, which improves the flexibility of the bastion host. For services marked as disabled, the bastion host can disable them directly in the current configuration item through the function flag, avoiding unnecessary resource consumption. For new services, the bastion host first determines whether they exist, and then enables them through the function flag, ensuring the smooth addition of services. This method not only improves the response speed of the bastion host, but also reduces the impact of service changes on the overall stability of the bastion host. At the same time, it also provides enterprises with more flexible service customization options, allowing the bastion host to better adapt to the dynamic needs of enterprises.
[0072] After step S105, the following steps are also included: S301, when receiving the encryption requirement file sent by the enterprise terminal, parsing the encryption requirement file to obtain the data to be encrypted and the corresponding encryption level; The encryption requirement file refers to a file containing data information that needs to be encrypted and related encryption requirements.
[0073] In some embodiments, the bastion machine uses a predefined parser or analysis tool to process the file content. During the parsing process, the bastion machine identifies the data segments or fields marked as requiring encryption in the file and extracts the encryption level information corresponding to each data item. This encryption level may be represented by a clear number or code.
[0074] S302, selecting a corresponding encryption algorithm according to the encryption level, encrypting and storing the encryption requirement file; S303, parsing predefined access control rules and constructing a multi-dimensional access rights matrix based on roles, resources and related factors; Predefined access control rules refer to a set of rules set in advance by the bastion host administrator or security policy maker to define the access rights of different users or roles to bastion host resources. Related factors include time, location, device type and other conditions that affect access rights. The multidimensional access rights matrix is a complex data structure used to represent the access rights relationship between roles, resources and other related factors.
[0075] In some embodiments, the system first reads the stored access control rules, which may exist in the form of configuration files or database records in a specific format. The bastion host then uses a specialized parser to process these rules to extract role definitions, resource lists, access permission settings, and other relevant control factors. During the parsing process, the bastion host may need to process complex conditional statements and logical relationships, such as role inheritance, resource grouping, or conditional permissions. After the parsing is completed, the bastion host builds a multidimensional data structure based on the parsing results, usually a multidimensional matrix or similar data structure, which is used to quickly query and determine the access rights of a specific role to a specific resource under specific conditions.
[0076] S304: upon receiving a resource access request sent by a user terminal, determining an authorization scope of the user terminal based on the multi-dimensional access permission matrix, where the authorization scope is used to allow the user terminal to access resources within the authorization scope; The user terminal refers to the device or application that the user uses to access the bastion host resources.
[0077] In some embodiments, the bastion host first verifies the user's identity information and confirms the legitimacy of the request. The bastion host then extracts the user's role information, the resource information requested for access, and other relevant contextual information (such as access time, location, etc.) from the request. The bastion host uses this information as input to query the multi-dimensional access permission matrix constructed previously. Based on the query results, the bastion host generates an authorization scope, which may be a list of resources or a set of operation permissions. The bastion host compares this authorization scope with the user's request to determine whether access to the requested resources is allowed and which specific operations are allowed.
[0078] S305: Enable the functions within the authorization scope of the user terminal through the function flag, and disable the functions used for security.
[0079] In some embodiments, the bastion machine processes each function that the user can access one by one according to the authorization scope determined in the previous step. For functions within the authorization scope, the bastion machine sets them to the enabled state through the function flag mechanism, allowing users to access and use them normally. This process may involve operations such as modifying configuration files, updating database flags, or adjusting control variables in memory. At the same time, the bastion machine identifies those functions that are specifically used for security purposes, such as bastion machine monitoring, audit logging, sensitive operation confirmation, etc., and sets these functions to the disabled state. The purpose of this is to prevent ordinary users from interfering with or bypassing the security mechanism of the bastion machine. The bastion machine may maintain a function status mapping table to reflect the availability status of each function for the current user in real time. During the entire processing process, the bastion machine needs to ensure the consistency of the function status, and may use a transaction mechanism to ensure that all related function flag update operations are either all successful or all failed.
[0080] S306: Capture and record the user behavior of the user terminal in real time to obtain an audit log, where the user behavior includes login events, operation behaviors, and resource access activities.
[0081] In some embodiments, the bastion host sets monitoring points at multiple levels, including but not limited to the network layer, application layer, database layer, etc., to comprehensively capture various user behaviors. For each captured event, the bastion host records detailed information, such as event type, occurrence time, user ID, operation object, operation result, etc. This information will be formatted into a structured log record and written to the audit log bastion host in real time. During the recording process, the bastion host needs to consider the performance impact and may use technologies such as asynchronous writing or batch writing to reduce the impact on the main bastion host. At the same time, the bastion host also needs to ensure the integrity and immutability of the audit log, and may use encryption or blockchain technologies to protect log data. In addition, the bastion host may implement a real-time alarm mechanism to immediately notify relevant personnel when abnormal or sensitive operations are detected.
[0082] S307: When it is determined according to the audit log that the user terminal is not safe, the functions within the authorization scope of the user terminal are prohibited by the function flag, and the functions for safety are enabled.
[0083] In some embodiments, specifically, the bastion host first analyzes the audit logs generated in real time, which may involve complex pattern matching, statistical analysis, or machine learning algorithms. The goal of the analysis is to identify abnormal behavior patterns that may indicate security risks, such as frequent failed login attempts, abnormal resource access patterns, or a sudden increase in sensitive operations. When the bastion host determines that there is a security risk in the user terminal, it will immediately take measures to adjust the user's permissions. This adjustment process will first disable all non-essential functions within the user's authorization scope through a feature flag mechanism, effectively limiting the user's operating capabilities. At the same time, the bastion host will enable a series of features specifically for security purposes, which may include mandatory multi-factor authentication, detailed operation confirmation processes, or stricter logging. This dynamic permission adjustment is designed to minimize potential security threats while retaining the necessary security monitoring capabilities.
[0084] It can be seen that, first of all, by parsing and processing the encryption requirement file, a flexible data encryption mechanism is implemented to improve data security. Secondly, by building a multi-dimensional access permission matrix, refined access control is achieved and the security of the bastion host is enhanced. Furthermore, by capturing and recording user behavior in real time and generating audit logs, comprehensive behavior monitoring and tracing capabilities are provided. The combination of these functions not only improves the overall security of the bastion host, but also provides enterprises with more comprehensive and flexible security management options. At the same time, this method also improves the availability of the bastion host, allowing enterprises to customize security policies according to their own needs and achieve more accurate security management.
[0085] It can be seen that, firstly, the bastion host can accurately control the enabling and disabling of functions within the user's authorized scope through the function flag mechanism, thereby improving the accuracy of access control. Secondly, by capturing and analyzing user behavior in real time, the bastion host can dynamically determine the security status of the user terminal. When an unsafe situation is detected, the bastion host can immediately prohibit functions within the authorized scope through function flags and enable security-related functions, thereby achieving a rapid response to potential security threats. This method not only improves the security of the bastion host, but also enhances the bastion host's ability to respond to security threats in real time, providing enterprises with a more proactive and intelligent security protection mechanism.
[0086] The following introduces an exemplary bastion host 400 provided in an embodiment of the present application. Figure 4 It is a schematic diagram of an exemplary hardware structure of a bastion host 400 adapted to multiple enterprises provided in an embodiment of the present application.
[0087] In some embodiments, the bastion host 400 is a computer device or the bastion host 400 includes a computer device. The computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with other external terminals or servers through a network connection. In some embodiments, the network interface can be a wired network interface, and in some embodiments, the network interface can also be a wireless network interface. When the computer program is executed by the processor, the method in the embodiment of the present application is implemented.
[0088] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0089] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0090] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0091] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0092] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A bastion host processing method adapted to multiple enterprises, characterized in that: include: When receiving a customized configuration file sent by an enterprise terminal, extracting the customized configuration file, wherein the customized configuration file is a configuration customized for the enterprise terminal; Parsing the custom configuration file to obtain required configuration items; Compare the required configuration items with the current configuration items, identify the changed configuration items, and generate a configuration change set; Perform a hot update operation based on the configuration change set; If the hot update is successful, the cache data is updated synchronously; For each service involved in the configuration change set, increase the corresponding counter by 1; Determine whether there is a counter value of any of the services that exceeds a corresponding preset frequency threshold; If the counter value of any of the services exceeds the corresponding preset frequency threshold, the corresponding service will be processed as a microservice.
2. The method according to claim 1, characterized in that After the step of synchronously updating the cache data if the hot update is successful, the method further includes: When receiving the encryption requirement file sent by the enterprise terminal, parsing the encryption requirement file to obtain the data to be encrypted and the corresponding encryption level; Selecting a corresponding encryption algorithm according to the encryption level, encrypting and storing the encryption requirement file; Parse predefined access control rules and build a multi-dimensional access rights matrix based on roles, resources and related factors; Upon receiving a resource access request sent by a user terminal, determining an authorization scope of the user terminal based on the multi-dimensional access permission matrix, wherein the authorization scope is used to allow the user terminal to access resources within the authorization scope; The user behavior of the user terminal is captured and recorded in real time to obtain an audit log, wherein the user behavior includes login events, operation behaviors and resource access activities.
3. The method according to claim 1, characterized in that The step of performing a hot update operation based on the configuration change set specifically includes: For the services marked as disabled in the configuration change set, disabling the services marked as disabled in the current configuration item by using a function flag; For a service marked as newly added in the configuration change set, determining whether it exists in the current configuration item; If so, the service marked as newly added is enabled in the current configuration item through the function flag.
4. The method according to claims 2 and 3, characterized in that After the step of determining, upon receiving a resource access request sent by a user terminal, an authorization scope of the user terminal based on the multi-dimensional access permission matrix, wherein the authorization scope is used to allow the user terminal to access resources within the authorization scope, the method further comprises: Enabling the functions within the authorization scope of the user terminal and disabling the functions used for security by using the function flag; After the step of capturing and recording the user behavior of the user terminal in real time to obtain an audit log, wherein the user behavior includes login events, operation behaviors, and resource access activities, the method further includes: When it is determined according to the audit log that the user terminal is not safe, the functions within the authorized scope of the user terminal are prohibited and the functions for security are enabled through the function flag.
5. The method according to claim 1, characterized in that If the hot update is successful, the step of synchronously updating the cache data specifically includes: If the hot update is successful, the configuration change set in the old cache data is updated to obtain the new cache data. Switching to the new cache data using an atomic operation; Cleaning up the old cache data; The service that depends on the cache is notified to refresh its local cache so that a portion of the old cache data is updated with a corresponding portion of the new cache data.
6. The method according to claim 1, characterized in that After the step of performing a hot update operation based on the configuration change set, the method further includes: If the hot update fails, the hot update operation is determined to be completely failed; In the event of total failure, restore to the current configuration item.
7. The method according to claim 6, characterized in that The step of restoring to the current configuration item in the event of all failures specifically includes: In case of all failures, loading the current configuration item; Compare the current state with the current configuration items, identify the changed configuration items, and generate a configuration rollback set; Roll back the applied configuration changes one by one according to the configuration rollback set; After all rollbacks, reset all corresponding service internal states and caches; Generates a log of recovery operations.
8. A bastion host adapted to multiple enterprises, characterized in that: The bastion host adapted to multiple enterprises includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the bastion host adapted to multiple enterprises to execute the method described in any one of claims 1-7.
9. A computer program product comprising instructions, characterized in that When the computer program product runs on a bastion host adapted to multiple enterprises, the bastion host adapted to multiple enterprises executes the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a bastion host adapted to multiple enterprises, the bastion host adapted to multiple enterprises executes the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data updating method and device, computer program product and storage medium
CN112732735A
Home page application data configuration updating method and device, equipment and medium
CN113703809A
Configuration file hot update method, system and equipment and storage medium
CN117724748A
Method and system for counting hot update of user software in real time
CN118227181A
Device and method for remote access
WO2022227864A1
Cited By
Login control method and device based on operation and maintenance, bastion host, system, storage medium and program product
CN119520146A
