Disclosure of Invention
The invention aims to overcome the defects in the prior art, and provides a virtual machine memory encryption and protection system based on ARM TrustZone and a method thereof, through the cooperation of the TrustZone hardware isolation module and the security monitoring module, the problem that the malicious software side channel attack of other virtual machines on the same physical server is difficult to resist in the prior art is solved.
The invention aims at realizing the following technical scheme:
The virtual machine memory encryption and protection system based on ARM TrustZone comprises a joint control module and further comprises a bidirectional electric connection with the joint control module:
the TrustZone hardware isolation module is used for realizing physical isolation between the safe world and the non-safe world;
the safety monitoring module is used for capturing and processing the memory access request in real time;
the encryption module is used for selecting a corresponding encryption algorithm according to the data sensitivity;
the key management module is used for generating a key by utilizing the hardware random number and realizing safe distribution;
The access control module is used for controlling the fine access of the memory area of the virtual machine;
The integrity detection module is used for periodically checking the integrity of the memory data;
The virtual machine management program interface module and the log and audit module are used for realizing virtual machine creation, starting and log record operation;
The recovery module is used for ensuring that the virtual machine and the system quickly return to a safe and stable state;
the intelligent self-adaptive encryption strategy module dynamically adjusts an encryption algorithm and a key updating period by combining a preset rule through operation state monitoring and data flow analysis, so as to realize self-adaptive encryption according to the operation state of the virtual machine;
The abnormal detection module is driven by machine learning, performs real-time analysis on memory access behaviors by utilizing data acquisition preprocessing and model training, and timely informs the safety monitoring module to take protective measures through the early warning submodule when the abnormal behaviors are detected
The visual security situation sensing module is used for displaying the security running state of the system, monitoring data and security event trend in real time through an intuitive graphical interface, and facilitating the global security situation sensing and decision-making of an administrator;
and the cross-virtual machine security cooperation module is used for realizing security information sharing and cooperative defense among virtual machines and forming a global and linkage type security protection system.
Furthermore, the trust zone hardware isolation module comprises a processor core state management sub-module, a memory space dividing sub-module and an interrupt management sub-module, wherein the processor core state management sub-module, the memory space dividing sub-module and the interrupt management sub-module are all in bidirectional electrical connection with the joint control module.
Further, the security monitoring module comprises an access request interception sub-module, a security policy execution sub-module and an audit data recording sub-module, and the access request interception sub-module, the security policy execution sub-module and the audit data recording sub-module are all in bidirectional electrical connection with the joint control module.
Further, the encryption module comprises an encryption algorithm selection sub-module, an encryption execution sub-module and an encryption key cache sub-module, and the encryption algorithm selection sub-module, the encryption execution sub-module and the encryption key cache sub-module are all in bidirectional electrical connection with the joint control module.
Further, the key management module comprises a key generation sub-module, a key storage sub-module and a key distribution sub-module, wherein the key generation sub-module, the key storage sub-module and the key distribution sub-module are in bidirectional electrical connection with the joint control module.
Further, the access control module comprises a right definition sub-module, a right verification sub-module and a right updating sub-module, wherein the right definition sub-module, the right verification sub-module and the right updating sub-module are all in bidirectional electrical connection with the joint control module.
Further, the integrity detection module comprises a hash Ji Suanzi module, a contrast verification sub-module and a tamper response sub-module, and the Ha Xiji operator module, the contrast verification sub-module and the tamper response sub-module are all in bidirectional electrical connection with the joint control module.
Further, the intelligent self-adaptive encryption strategy module comprises an operation state monitoring sub-module, a data flow analysis sub-module and an intelligent algorithm decision sub-module, wherein the operation state monitoring sub-module, the data flow analysis sub-module and the intelligent algorithm decision sub-module are all in bidirectional electrical connection with the joint control module.
Further, the machine learning driven abnormality detection module comprises a data acquisition preprocessing sub-module, a model training sub-module and an abnormality detection early-warning sub-module, and the data acquisition preprocessing sub-module, the model training sub-module and the abnormality detection early-warning sub-module are all in bidirectional electrical connection with the joint control module.
The invention also provides a method for encrypting and protecting the system of the virtual machine memory based on the ARM TrustZone, which comprises the following steps:
And (a) after the system is powered on, automatically initializing a register and a hardware circuit in an ARM processor, identifying the initial state of the processor by a hardware component, setting the initial state as a safe state by default, marking most areas as unsafe memory by a memory space according to a preset default division rule, reserving only a small part of key areas as safe memory for subsequent loading of safety-related initial codes and data, initializing an interrupt vector table as a unsafe interrupt vector table, and preparing to receive an asynchronous event of common application, wherein the hardware component belongs to the common name of hardware which supports a TrustZone safety mechanism and is self-contained in the ARM processor in the TrustZone hardware isolation module, for example TZASC hardware is used for dividing the safe memory and the unsafe memory, and a scr_eL3 register can identify whether the current cpu is in the safe state or the unsafe state. Arm Fixed Virtual PlatformsFI (FVP) hardware simulation platform 4G memory default preset non-secure memory addresses are 0x80000000-0xfc000000 and 0x880000000-0x900000000, and secure memory is 0xfc000000-0x100000000. The operation of initializing the interrupt vector table is an operation which is executed when the Arm itself starts, and is completed by ATF firmware which is self-contained in the ARM itself.
And b, initializing a security monitoring module, namely starting loading and initializing the security monitoring module in the security world of the TrustZone, configuring a hardware monitoring mechanism, starting a memory access abnormal interrupt function, setting interrupt priority, ensuring that memory access requests from the security world and the non-security world can be captured in time, loading a security policy rule base from a security storage area into a memory to construct an initial security inspection rule set, and setting the security world by the TrustZone hardware isolation module, wherein TrustZone is hardware carried by an ARM processor. Processors can be divided into two worlds, the secure world and the non-secure world.
Step c, initializing other modules, namely loading a plurality of encryption algorithm libraries in a storage area of a secure world by an encryption module, initializing an encryption key buffer area, setting a buffer replacement strategy, establishing communication connection with a virtual machine management program interface module, waiting for receiving a read-write event notification, generating a master key by a hardware random number generator RNG by the key management module, storing the master key in a bottom encryption storage area of the secure world, adopting an encryption storage format, initializing a key distribution channel, establishing a secure communication link with a security monitoring module and the encryption module, configuring a memory area access right register by an access control module according to a system default security strategy, setting a right which can be accessed only by a main body of a processor in a secure state and authorized to be identified for a secure memory area, endowing different general access rights for a non-secure memory area according to an application scene, initializing a hash algorithm in the secure world by an integrity detection module, preparing to perform initial hash calculation on virtual machine memory data, and setting an initial detection period;
And d, creating and starting the virtual machine, wherein the virtual machine management program interface module receives a creation instruction, cooperates with the TrustZone hardware isolation module, allocates safe and unsafe memory areas for the virtual machine, preliminarily estimates the memory requirements according to the use of the virtual machine, divides the memory according to preset proportions, configures initial interrupt processing logic for the virtual machine and associates the initial interrupt processing logic with a unsafe interrupt vector table, and creates and runs the virtual machine by executing a qemu command through a user, wherein the virtual machine management program interface module receives the creation instruction at the moment in a kvm module of an inner core, namely a virtual machine management program.
Step e, memory data read-write and protection flow, when an application program in the virtual machine initiates a memory read-write request, a virtual machine management program interface module captures the request first, judges the type of the request and the security attribute of a target memory area, if the request is a read-write request of an unsafe memory area and accords with the current access authority setting, the request is directly forwarded to a corresponding unsafe memory area for processing, if the request does not accord with the authority, the request is refused, an error prompt is sent to the virtual machine through the virtual machine management program interface module, meanwhile, a security monitoring module records illegal access details, if the request is a read-write request of the safe memory area, whether the request accords with the initial authority or not, the request is forwarded to the security monitoring module, an access request interception submodule of the security monitoring module receives the request, a security policy of the current system is combined, the security monitoring module executes the submodule, if the request is legal, the request is forwarded to an encryption module or directly allows access, the encryption module selects a submodule to determine an encryption algorithm through an encryption algorithm according to the sensitivity degree of data, and cooperates with the key management module to acquire or update the encryption key;
The intelligent self-adaptive encryption strategy module continuously operates, through deep integration with the virtual machine management program interface module, information of the operating state, data flow and application type of the virtual machine is obtained at intervals of set time, based on the information, the intelligent algorithm decision sub-module sends an algorithm switching instruction to the encryption module and a key updating instruction to the key management module according to a preset rule set, the key updating period is shortened, the encryption strategy is ensured to dynamically adapt to the operating condition of the virtual machine, meanwhile, the abnormality detection module receives various data from the internal memory of the virtual machine in real time, the data are input into a trained model after being subjected to cleaning and normalization processing by the data acquisition preprocessing sub-module, the model judges whether abnormal access behaviors exist in real time, if abnormal conditions are detected, the abnormality detection early warning sub-module immediately sends early warning signals to the security monitoring module through a security communication mechanism, and the security monitoring module can take temporary isolation suspicious process measures after receiving the signals;
The integrity detection module triggers a hash calculation submodule to carry out hash calculation on a designated virtual machine memory area according to a preset period or in a key operation, the hash calculation is realized through a computer_hash (memory_range) function, parameters are represented in brackets, a calculation result is compared with a hash value stored before by a comparison verification submodule, if the hash value is found to be different, the data is possibly tampered, at the moment, the tamper response submodule is quickly started, a tamper alarm is sent to a security monitoring module through a security communication mechanism, meanwhile, the security monitoring module cooperates with a log and an audit module to record details of a tamper event, after receiving the alarm, the security monitoring module can determine whether to temporarily isolate a related virtual machine or process according to a system security policy, prevent hazard diffusion and inform an administrator to carry out further investigation;
If the key management module detects the key leakage risk, immediately starting an emergency flow, firstly notifying the encryption module to stop using the key with the current leakage risk through cooperation with the encryption module, then quickly generating a new encryption key by the key generation submodule through a hardware random number generator, storing the new key in a layered encryption storage mode through the key storage submodule, replacing the original key, and redistributing the new key to the encryption module through the key distribution submodule through a safety channel, so as to ensure that the encryption system continues to run safely;
And i, recovering the system, namely starting a recovery module when encountering a serious security event, matching the recovery module with an integrity detection module, if the data is tampered, acquiring original data from a backup storage medium by a data recovery sub-module, recovering the original data into a memory of a virtual machine through a memory address range function, and simultaneously, matching the recovery module with a key management module, resetting a key distribution flow if the key is leaked, ensuring that a newly generated key is correctly distributed and relevant encryption and decryption operations are updated, and coordinating all relevant modules by the recovery module in the whole recovery process, so that the system is ensured to be gradually recovered to a safe and stable state.
Compared with the prior art, the technical scheme of the invention has the following beneficial effects:
1. And the physical isolation is enhanced, the side channel attack is blocked, namely, the TrustZone hardware isolation module is utilized to carry out physical division on the memory, and the safe memory and the non-safe memory are strictly separated, so that the side channel attack from other virtual machines is difficult to penetrate through the isolation layer, and sensitive data is effectively protected.
2. The real-time monitoring and the refined access control are realized by carrying out real-time interception and permission verification on the memory access request through the security monitoring module and the access control module, so that illegal access can be identified and blocked at the first time, potential safety hazards are reduced, and meanwhile, the whole-process recording is realized by matching with the log and the audit module, so that a basis is provided for post analysis.
3. The encryption module combines the intelligent self-adaptive encryption strategy module, dynamically selects an encryption algorithm according to the running state and data sensitivity of the virtual machine, and realizes encryption and decryption operation by utilizing a hardware encryption engine, so that the performance loss caused by excessive encryption is avoided while the confidentiality of data is ensured, and the high-efficiency response of the system is ensured.
4. The key management and emergency response mechanism is perfect, namely the key management module is used for generating, hierarchically storing and safely distributing the keys, and the emergency flow is started in time when the key leakage is detected, so that the safety and reliability of the whole key management flow are ensured, and the system risk caused by the key problem is reduced.
5. The system can quickly start tamper response measures and data recovery programs once data tampering is found, and timely recover the system safety state, thereby effectively preventing loss caused by data tampering.
6. The intelligent anomaly detection and cooperative protection comprises the steps that an anomaly detection module driven by machine learning can identify abnormal memory access behaviors through multidimensional data acquisition and real-time model judgment, quickly trigger early warning, and cooperatively take isolation and defense measures with a safety monitoring module, and meanwhile, safety event information sharing is realized across a virtual machine safety cooperative module, so that the overall protection capability is further enhanced.
In summary, the invention not only adopts advanced technology in all links of hardware isolation, real-time monitoring, dynamic encryption strategy, key management, data integrity guarantee, anomaly detection and the like, but also the close coordination among all modules further improves the overall safety and the operation efficiency of the system, thereby effectively coping with the security threats of channel attack, data tampering and the like at the lower side of the current multi-virtual machine environment, and simultaneously taking into consideration the system performance and the user experience, thereby having remarkable technical advantages and application value.
Detailed Description
The invention is described in further detail below with reference to the drawings and the specific examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Example 1
Referring to fig. 1-9, the virtual machine memory encryption and protection system based on ARM trust zone comprises a joint control module, wherein an output end and an input end of the joint control module are both electrically connected with a trust zone hardware isolation module, an output end and an input end of the joint control module are both electrically connected with a security monitoring module, an output end and an input end of the joint control module are both electrically connected with an encryption module, an output end and an input end of the joint control module are both electrically connected with a key management module, an output end and an input end of the joint control module are both electrically connected with an access control module, an output end and an input end of the joint control module are both electrically connected with an integrity detection module, an output end and an input end of the joint control module are both electrically connected with a virtual machine management program interface module, an output end and an input end of the joint control module are both electrically connected with a log and an audit module, an output end and an input end of the joint control module are both electrically connected with a recovery module, an output end and an input end of the joint control module are both electrically connected with an intelligent self-adaptive encryption strategy module, an output end and an input end of the joint control module are both electrically connected with a machine learning detection module, and an output end of the joint control module are both electrically connected with an abnormal state detection module, and the joint control module are both electrically connected with the virtual machine security module.
The method for encrypting and protecting the system of the virtual machine memory based on the ARM TrustZone comprises the following steps:
A, after a system is powered on, a special register and a hardware circuit in an ARM processor are automatically initialized, a hardware component identifies the initial state of the processor and is set to be an unsafe state by default, at the moment, a memory space marks a large part of areas as unsafe memory according to a preset default division rule, only a small part of key areas are reserved as safe memory for loading safety-related initial codes and data subsequently, an interrupt vector table is also initialized as an unsafe interrupt vector table, and asynchronous events of common application are ready to be received;
B, initializing a security monitoring module, namely starting loading and initializing the security monitoring module in the security world of the TrustZone, configuring a hardware monitoring mechanism, starting a memory access abnormal interrupt function, setting interrupt priority, ensuring that memory access requests from the security world and the non-security world can be captured in time, and simultaneously loading a security policy rule base from a security storage area to a memory to construct an initial security inspection rule set;
Step c, other core modules are initialized, wherein an encryption module loads a plurality of encryption algorithm libraries in a specific storage area of a secure world, initializes an encryption key buffer area, sets a buffer replacement strategy, establishes communication connection with a virtual machine management program interface module, waits for receiving a read-write event notification, generates a master key by utilizing a hardware Random Number Generator (RNG), stores the master key in a bottom encryption storage area of the secure world, adopts a special encryption storage format, initializes a key distribution channel, establishes a secure communication link with a security monitoring module and the encryption module, and an access control module configures a memory area access right register according to a system default security strategy, and sets a right which can be accessed only by a main body of a processor in a secure state and a specific authorized identifier for the secure memory area;
D, virtual machine creation and starting, wherein a virtual machine management program interface module receives a creation instruction, cooperates with a trust zone hardware isolation module, allocates safe and unsafe memory areas for the virtual machine, preliminarily estimates memory requirements according to the use of the virtual machine, divides the memory according to a preset proportion, and simultaneously configures initial interrupt processing logic for the virtual machine and associates the initial interrupt processing logic with a unsafe interrupt vector table;
Step e, memory data read-write and protection flow, when an application program in the virtual machine initiates a memory read-write request, a virtual machine management program interface module captures the request firstly, judges the type of the request and the security attribute of a target memory area, if the request is a read-write request of an unsafe memory area and accords with the current access authority setting, the request is directly forwarded to a corresponding unsafe memory area for processing, if the request does not accord with the authority, the request is refused, an error prompt is sent to the virtual machine through the virtual machine management program interface module, meanwhile, a security monitoring module records illegal access details, if the request is a read-write request of the safe memory area, whether the request accords with the initial authority or not, the request is forwarded to the security monitoring module, an access request interception submodule of the security monitoring module receives the request, a security policy of the current system is combined, the security monitoring module executes the submodule, if the request is legal, the request is forwarded to an encryption module or directly allows access, the encryption module selects a submodule to determine a proper encryption algorithm through the encryption algorithm according to the sensitivity degree of data, and cooperates with the encryption algorithm to acquire or update the encryption key;
the intelligent self-adaptive encryption strategy module continuously operates, through deep integration with the virtual machine management program interface module, information of the operating state, data flow and application type of the virtual machine is obtained at regular intervals, based on the information, the intelligent algorithm decision sub-module immediately sends an algorithm switching instruction to the encryption module and a key updating instruction to the key management module according to a preset rule set and shortens a key updating period, so that the encryption strategy is ensured to dynamically adapt to the operating condition of the virtual machine, meanwhile, the machine learning-driven abnormality detection module receives various data from the internal memory of the virtual machine in real time, the data are cleaned and normalized through the data acquisition preprocessing sub-module, and then the data are input into a trained model, the model judges whether abnormal access behaviors exist in real time, if abnormality such as sudden frequent access to an unauthorized internal memory area is detected, the abnormality detection early warning sub-module immediately sends early warning signals to the security monitoring module through a security communication mechanism, and after the security monitoring module receives signals, temporary suspicious process measures can be taken;
The integrity detection module triggers a hash calculation submodule to carry out hash calculation on a designated virtual machine memory area according to a preset period or in a key operation, the calculation result is compared with a previously stored hash value by a comparison verification submodule, if the hash value is found to be different, the data is possibly tampered, at the moment, the tamper response submodule is quickly started, a tamper alarm is sent to a security monitoring module through a security communication mechanism, meanwhile, the tamper response submodule cooperates with a log and an audit module to record details of a tamper event, after the security monitoring module receives the alarm, whether related virtual machines or processes are temporarily isolated according to a system security policy to prevent hazard diffusion can be determined, and an administrator can be notified to carry out further investigation;
If the key management module detects the key leakage risk, immediately starting an emergency flow, firstly notifying the encryption module to stop using the key with the current leakage risk through cooperation with the encryption module, then quickly generating a new encryption key by the key generation submodule through a hardware random number generator, storing the new key in a layered encryption storage mode through the key storage submodule, replacing the original key, and redistributing the new key to the encryption module through the key distribution submodule through a safety channel, so as to ensure that the encryption system continues to run safely;
And i, recovering the system, namely starting a recovery module when encountering a serious security event, matching the recovery module with an integrity detection module, if the data is tampered, acquiring original data from a backup storage medium by a data recovery sub-module, recovering the original data into a memory of a virtual machine through a memory address range function, and simultaneously, matching the recovery module with a key management module, resetting a key distribution flow if the key is leaked, ensuring that a newly generated key is correctly distributed and relevant encryption and decryption operations are updated, and coordinating all relevant modules by the recovery module in the whole recovery process, so that the system is ensured to be gradually recovered to a safe and stable state.
Example two
Referring to fig. 1 to fig. 9, in a first embodiment, the trust zone hardware isolation module includes a processor core state management sub-module, a memory space dividing sub-module, and an interrupt management sub-module, where the processor core state management sub-module, the memory space dividing sub-module, and the interrupt management sub-module are all electrically connected with the joint control module in two directions;
the security monitoring module comprises an access request interception sub-module, a security policy execution sub-module and an audit data recording sub-module, and the access request interception sub-module, the security policy execution sub-module and the audit data recording sub-module are electrically connected with the joint control module in a bidirectional manner;
The encryption module comprises an encryption algorithm selection sub-module, an encryption execution sub-module and an encryption key cache sub-module, and the encryption algorithm selection sub-module, the encryption execution sub-module and the encryption key cache sub-module are all in bidirectional electrical connection with the joint control module;
the key management module comprises a key generation sub-module, a key storage sub-module and a key distribution sub-module, and the key generation sub-module, the key storage sub-module and the key distribution sub-module are all in bidirectional electrical connection with the joint control module;
the access control module comprises a right definition sub-module, a right verification sub-module and a right updating sub-module, wherein the right definition sub-module, the right verification sub-module and the right updating sub-module are all in bidirectional electrical connection with the joint control module;
The integrity detection module comprises a hash Ji Suanzi module, a comparison verification sub-module and a tamper response sub-module, and the Ha Xiji operator module, the comparison verification sub-module and the tamper response sub-module are all in bidirectional electrical connection with the joint control module;
The intelligent self-adaptive encryption strategy module comprises an operation state monitoring sub-module, a data flow analysis sub-module and an intelligent algorithm decision sub-module, wherein the operation state monitoring sub-module, the data flow analysis sub-module and the intelligent algorithm decision sub-module are electrically connected with the joint control module in a bidirectional manner;
the machine learning driven abnormality detection module comprises a data acquisition preprocessing sub-module, a model training sub-module and an abnormality detection early-warning sub-module, and the data acquisition preprocessing sub-module, the model training sub-module and the abnormality detection early-warning sub-module are in bidirectional electrical connection with the joint control module.
The processor core state management submodule is responsible for monitoring and switching the safety and non-safety states of the processor, ensuring that the processor can correctly operate instructions with corresponding safety levels under different scenes, and the memory space division submodule divides the physical memory into a safety memory area and a non-safety memory area according to a system safety strategy, wherein the safety memory is used for storing an encryption key, a memory management module is used for controlling the safety and non-safety states of the processor, and a memory space division submodule is used for dividing the physical memory into a safety memory area and a non-safety memory area according to the system safety strategy, the system comprises a security management sub-module, an interrupt management sub-module, a non-security memory, a security-world processing program and a non-security-world processing sub-module, wherein the security management sub-module is used for classifying and managing system interrupts, the security interrupt is used for processing emergency events related to security, the security interrupt is required to be timely responded by the security-world processing program and is not interfered by the non-security world, the non-security interrupt is used for processing asynchronous events of the common application, and an access request interception sub-module is used for setting a monitoring point on a necessary path of a memory access request and capturing the emergency events from a virtual machine in real time The security policy execution submodule carries out legal examination on the intercepted memory access request according to a security policy rule base pre-configured by the system when the memory access request is requested by an application program and the like, the audit data record submodule is responsible for recording all security events related to the memory access in detail, including normal access records and illegal access details, the records are used as important basis for subsequent audit analysis, an administrator is helped to know the security operation condition of the system in depth, potential safety hazards are eliminated, and the encryption algorithm selects submodule to select the sensitivity degree of the memory data of the virtual machine according to the security information, The encryption execution submodule dynamically selects the most suitable encryption algorithm according to the application scene and the current system security situation, performs actual encryption operation on memory data to be protected according to the selected encryption algorithm, converts plaintext data into ciphertext before the data is written into a memory to ensure confidentiality of the data during the memory storage period, performs decryption operation when the data is required to be read and used, restores original data for normal operation of a virtual machine, and sets an encryption key buffer zone in the memory of the secure world for improving the efficiency of encryption and decryption operation, and the key generation submodule generates high-quality data by using a hardware random number generator, Meanwhile, to ensure the reliability of the storage medium and avoid the loss of the key caused by hardware faults, the key distribution sub-module distributes the encryption key to the module to be used accurately, the authority definition sub-module defines the access authorities of different areas of the memory of the virtual machine and different areas of the memory of the virtual machine according to the system security requirement, and some combination authorities, and meanwhile, the key distribution sub-module is used for ensuring the security of the key storage medium according to different virtual machines, An application program or a user role formulates a differentiated authority allocation scheme to realize refined access control, when a memory access request occurs, an authority verification submodule verifies the access authority of a request main body, according to a target memory area and an operation type of the request, a predefined authority rule is checked, whether the request is legal or not is judged, if the request is legal, the request is released, otherwise, the request is refused, a corresponding security event recording mechanism is triggered, the authority update submodule timely updates the access authority of the memory area along with the change of a system running environment, the authority setting is always matched with the actual security requirement of the system, security holes are prevented from being caused by authority lag, and the hash calculation submodule initializes memory data of a virtual machine, After the key operation is finished or according to a preset time period, calculating a hash value of a designated memory area, wherein the hash value is used as a sample of data integrity for subsequent comparison and judging whether the data is tampered or not, ensuring the authenticity and the reliability of the memory data, when the integrity detection is required to be carried out, the comparison and verification submodule takes out the previously calculated and stored hash value, compares the previously calculated and stored hash value with the currently recalculated hash value of the same memory area, and if the previously calculated and stored hash value is consistent with the currently calculated hash value, indicates that the data is not tampered, if the currently calculated and stored hash value is inconsistent with the stored hash value, judges that the integrity of the data is damaged, immediately triggers a corresponding safety mechanism, and when the comparison and verification submodule judges that the memory data is tampered, the tampering response submodule is responsible for starting corresponding countermeasures including but not limited to sending an alarm to inform an administrator, Starting a data recovery program to restore data from backup, temporarily isolating related virtual machines or processes to prevent damage diffusion and the like, minimizing loss caused by data tampering, collecting running indexes such as CPU (central processing unit) utilization rate, memory occupancy rate, disk I/O (input/output) frequency and the like of the virtual machines in real time by an operation state monitoring submodule, providing data support for judging the current workload intensity of the virtual machines, deeply analyzing data flow characteristics of network transceiving of the virtual machines by a data flow analysis submodule, including flow size, flow direction, data packet type, burst peak condition of flow and the like, identifying the type of data service being processed by the virtual machines based on the flow information, comprehensively integrating information provided by the operation state monitoring submodule and the data flow analysis submodule by an intelligent algorithm decision submodule according to a preset encryption strategy rule base, making a decision for dynamically adjusting encryption algorithm and key intensity, widely collecting various data related to the memory of the virtual machines by a data acquisition preprocessing submodule from a plurality of data sources, cleaning the acquired original data, The method comprises the following steps of performing preprocessing operations such as denoising and normalization, removing invalid data, correcting an error data format, unifying data of different data sources to a standard format which can be used for machine learning model training, improving data quality, providing a reliable data base for subsequent model training, enabling a model training sub-module to select a proper machine learning algorithm, performing model training by combining mass preprocessed historical data, enabling the model to accurately learn normal memory access modes, data change trends and system call sequence characteristics by continuously adjusting model parameters, further enabling the model to have strong abnormal recognition capability, effectively distinguishing normal memory behaviors from abnormal memory behaviors, enabling an abnormal detection early warning sub-module to deploy the trained machine learning model into a real-time monitoring environment, receiving latest data from a data acquisition preprocessing sub-module in real time, performing abnormal judgment by using the model, immediately sending accurate early warning information once the abnormal memory access behaviors are detected, notifying a safety monitoring module to take corresponding measures, and recording abnormal details so as to facilitate subsequent analysis.
Example three
Emergency treatment of a safety event:
assuming 3 pm, a virtual machine running financial data analysis software suddenly infects malware that attempts to steal customer funds account information with other virtual machines on the server through a side channel attack. At this time, the hardware component of the trust zone hardware isolation module rapidly recognizes abnormal memory access behavior, switches the processor to a secure state in microsecond level, and notifies the security monitoring module by interrupt.
The access request interception submodule of the security monitoring module captures an illegal access request, the security policy execution submodule immediately prevents the access according to the security policy, and the details of the violations are recorded. Meanwhile, the abnormality detection module driven by machine learning also detects abnormal changes of the memory access mode of the virtual machine, and the abnormality detection early warning sub-module immediately sends an early warning signal to the security monitoring module through the SMC.
After the security monitoring module receives the signal, on one hand, temporary suspicious process isolation measures are adopted within 20 seconds, memory resources occupied by the suspicious processes are locked, further read-write operation is prevented, meanwhile, connection with an external network is cut off, malicious software is prevented from being transmitted outwards, on the other hand, an administrator is informed to conduct further investigation, and detailed alarm information including virtual machine numbers, abnormal behavior characteristics, possible affected ranges and the like is sent to the administrator through an instant communication module arranged in the system.
The cross-virtual machine security collaboration module is started rapidly, and threat information sharing sub-module collects and sorts information of feature codes, attack source IP addresses, abnormal behavior modes (such as frequently attempting to break through memory access rights, sending encrypted data packets to specific external IP, and the like) of the malicious software within 3 minutes, and shares the information to adjacent virtual machines through SMC. After receiving the information, the adjacent virtual machine immediately starts a local defense mechanism, updates firewall rules, prevents any connection request from the attack source IP, and simultaneously carries out quick self-checking on a local memory to ensure that no data leakage risk exists.
The security policy coordination submodule establishes a unified security policy adjustment scheme within 5 minutes according to shared information, such as notifying all virtual machines to update virus libraries of antivirus software, acquiring the latest virus feature libraries and pushing the latest virus feature libraries to each virtual machine to update the virus libraries through real-time linkage with a cloud platform of an antivirus software provider, adjusting a network bandwidth allocation policy, preferentially guaranteeing the smoothness of a network of a core financial transaction virtual machine, dynamically adjusting a network traffic route by utilizing a Software Defined Network (SDN) technology, allocating more bandwidth resources for a key service virtual machine, starting an emergency exercise plan, checking a coordination defense effect, simulating a similar attack scene, observing response conditions of each virtual machine and a protection module, recording indexes such as response time, defense success rate and the like, and facilitating subsequent optimization.
If the integrity detection module finds that the memory data of a certain virtual machine is tampered in the follow-up detection, the tamper response sub-module is started rapidly, sends a tamper alarm to the security monitoring module through the SMC, cooperates with the log and the audit module at the same time, records details of a tamper event, and records information such as tampered data area, tamper occurrence time, possible tamper source and the like in detail. After the security monitoring module receives the alarm, the security monitoring module can determine whether to temporarily isolate the related virtual machine or process according to the security policy of the system, so as to prevent hazard diffusion, if the risk is higher, the security monitoring module immediately pauses all external interactions of the virtual machine, only reserves a communication link with the security monitoring module for subsequent investigation, and can also inform an administrator to further investigation, and the administrator can quickly trace back operation logs before and after data tampering by means of a visual audit tool to locate possible vulnerability points. If the key management module detects the key leakage risk, immediately starting an emergency flow, informing the encryption module to stop using the key with the current leakage risk, quickly generating a new encryption key by using the hardware random number generator, storing the new encryption key by using the key storage sub-module in a layered encryption storage mode, replacing the original key, redistributing the new encryption key to the modules needing to be used such as the encryption module by using the SMC through the key distribution sub-module, ensuring the encryption system to continue to run safely, reporting the details of the key leakage event to an administrator, including the leaked key identification, a possible leakage time window, suspected leakage reasons and the like, and assisting the administrator to investigate deeply.
The invention is not limited to the embodiments described above. The above description of specific embodiments is intended to describe and illustrate the technical aspects of the present invention, and is intended to be illustrative only and not limiting. Numerous specific modifications can be made by those skilled in the art without departing from the spirit of the invention and scope of the claims, which are within the scope of the invention.