System account tamper-proof protection system, method, electronic device and storage medium

By automatically generating and monitoring the verification mechanism of trigger code, the problem of code tampering in cloud database system account protection is solved, and automatic recovery and multiple anti-tampering mechanisms are realized, thereby improving database security.

CN116244744BActive Publication Date: 2026-07-03CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2023-02-01
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing cloud database system account protection technologies lack automatic repair capabilities, especially when trigger code is tampered with, resulting in a high risk of data leakage.

Method used

The trigger code generator module automatically generates trigger codes and calculates checksums. Combined with the metadata management module and the verification module, it monitors code tampering. The trigger code recovery module automatically restores the tampered code, and the account recovery module restores the tampered system account and its permissions.

Benefits of technology

It enables automatic monitoring and recovery of trigger code, timely interception and recovery of system account tampering behavior, and improves the security and reliability of cloud-native databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116244744B_ABST
    Figure CN116244744B_ABST
Patent Text Reader

Abstract

The application provides a cloud database built-in system account anti-tampering protection system, an anti-tampering protection method, an electronic device and a storage medium, and relates to the technical field of database information, and comprises a trigger code generator module for automatically generating trigger code and calculating a first check code; a metadata management module for managing system account information and storing the first check code; a trigger code check module for calculating a second check code and comparing the second check code with the first check code; a trigger code recovery module for regenerating trigger code and covering the tampered trigger code; and an account recovery module for recovering the tampered system account and the corresponding permissions. The application prevents the trigger code from being tampered by using the trigger check code, and has the functions of trigger code automatic recovery, system account tampering behavior interception, system account automatic recovery and the like, so that the multiple anti-tampering and automatic recovery mechanisms of the built-in account of the cloud native database are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database information technology, and in particular to a cloud database built-in system account anti-tampering protection system, a cloud database built-in system account anti-tampering protection method, an electronic device, and a computer-readable storage medium. Background Technology

[0002] Cloud-native databases have become a cutting-edge technology and methodology for using and managing databases. Database instances are jointly managed by users and cloud-native database governance (mostly database governance platforms). Therefore, effectively protecting the system accounts of the governance platform, ensuring that these accounts are not accidentally manipulated or tampered with by users, and restoring accounts upon detection of tampering are crucial to the reliability of cloud-native database services.

[0003] Existing database anti-tampering methods are relatively simplistic, primarily focusing on detecting tampering behavior for system accounts and lacking the ability to automatically repair system accounts. Furthermore, current database system account protection technologies mainly rely on trigger code to detect data tampering; however, most triggers are hard-coded and require pre-setting the system account information to be protected, which has significant limitations. In particular, they lack the ability to monitor whether the trigger code itself has been tampered with. If the trigger code is tampered with, existing database system account protection technologies become completely ineffective, leading to data theft and leakage, and posing a significant threat to the security of cloud-native databases. Summary of the Invention

[0004] In view of the above problems, the present invention is proposed to provide a cloud database built-in system account anti-tampering protection system, a cloud database built-in system account anti-tampering protection method, an electronic device, and a computer-readable storage medium to overcome or at least partially solve the above problems.

[0005] Firstly, a cloud database built-in system account anti-tampering protection system is provided, the cloud database built-in system account anti-tampering protection system comprising:

[0006] The trigger code generator module is used to read the system account information recorded in the metadata, automatically generate trigger code based on the system account information, calculate the first check code of the trigger code, initialize the trigger code into the database instance, and send the first check code to the metadata management module for storage.

[0007] The metadata management module is used to manage the system account information and store the first verification code;

[0008] The trigger code verification module is used to read the trigger code in the database instance, calculate the second check code of the trigger code, and read and compare the first check code and the second check code to determine whether the trigger code has been tampered with.

[0009] The trigger code recovery module is used to regenerate the trigger code using the system account information and overwrite the tampered trigger code in the database instance if it is determined that the trigger code has been tampered with.

[0010] The account recovery module is used to recover the tampered system account and its corresponding permissions by using the system account information recorded in the metadata if it is determined that the system account has been tampered with.

[0011] Optionally, the cloud database's built-in system account anti-tampering protection system uses the trigger code to intercept all attempts to tamper with the system account and logs each tampering attempt.

[0012] Optionally, the cloud database's built-in system account anti-tampering protection system further includes: database management, used to initiate system account checks according to preset rules to check whether the system account has been tampered with, and, if it is determined that the system account has been tampered with, to restore the tampered system account and its corresponding permissions through the account recovery module.

[0013] Optionally, the preset rules include: a first timed task and a second timed task;

[0014] The database control is used to periodically read and record logs according to the time in the first scheduled task. The record logs are obtained by recording each tampering behavior that modifies the system account, which is generated by the trigger code.

[0015] If a readable log record exists, the database management system initiates a system account check.

[0016] If no readable log record exists, the database management will not initiate the system account check.

[0017] The database management is used to periodically initiate system account checks according to the time specified in the second scheduled task.

[0018] Optionally, after the trigger logs each tampering behavior of the system account, it is also used to delete the log if the account recovery module restores the tampered system account and its corresponding permissions.

[0019] Optionally, the specific method for the trigger to intercept all attempts to tamper with the system account and to log each tampering attempt includes:

[0020] The trigger receives and parses the information about the tampering behavior to obtain the specific tampering behavior;

[0021] The trigger determines the specific trigger that triggers the specific tampering behavior based on the trigger code and the specific tampering behavior.

[0022] The specific trigger determines whether the tampering behavior is initiated against the system account, and then determines whether to intercept the tampering behavior and log the tampering behavior.

[0023] Optionally, the tampering behavior includes: deleting a system account or modifying system account permissions;

[0024] The trigger, based on the trigger code and the specific tampering behavior, determines the specific trigger that triggers the corresponding specific tampering behavior, including:

[0025] The trigger, based on the trigger code and the action of deleting the system account, determines which specific trigger to trigger; or

[0026] The trigger determines the grant trigger among the specific triggers based on the trigger code and the behavior of modifying system account permissions.

[0027] Optionally, the tampering behavior carries the target account; the specific trigger determines whether the tampering behavior is initiated against the system account, and then determines whether to intercept the tampering behavior, and logs the tampering behavior, including:

[0028] If the delete account trigger determines that the target account carried by the deleted system account is not the system account, then it performs the deletion operation and deletes the target account.

[0029] If the account deletion trigger determines that the target account carried by the deleted system account is the system account, it will intercept the tampering behavior, send an error message prohibiting the deletion of the system account, and log the tampering behavior of deleting the system account.

[0030] If the grant trigger determines that the target account carried by the modification of system account permissions is not the system account, then the grant operation is performed to modify the permissions of the target account.

[0031] If the granting trigger determines that the target account carried by the modification of system account permissions is the system account, it will intercept the tampering behavior, send an error message prohibiting the modification of system account permissions, and log the tampering behavior of modifying system account permissions.

[0032] Optionally, the cloud database's built-in system account anti-tampering protection system also includes: database management;

[0033] Before the trigger receives and parses the information about the tampering behavior, the database control is also used to receive the tampering behavior initiated by any account, connect to the database instance, and send the information about the tampering behavior to the trigger.

[0034] Secondly, a method for preventing tampering with accounts in a cloud database's built-in system is provided. This method is applied to a cloud database built-in system account prevention and protection system, which includes: a trigger code generator module, a metadata management module, a trigger code verification module, a trigger code recovery module, and an account recovery module. The method for preventing tampering with accounts in a cloud database's built-in system includes:

[0035] The trigger code generator module reads the system account information recorded in the metadata;

[0036] The trigger code generator module automatically generates trigger code based on the system account information;

[0037] The trigger code generator module calculates the first checksum of the trigger code, initializes the trigger code into the database instance, and sends the first checksum to the metadata management module for storage.

[0038] The metadata management module obtains and manages the system account information from the metadata, and simultaneously receives and stores the first verification code;

[0039] The trigger code verification module reads the trigger code from the database instance and calculates the second checksum of the trigger code;

[0040] The trigger code verification module reads the first verification code from the metadata management module;

[0041] The trigger code verification module compares the first verification code and the second verification code to determine whether the trigger code has been tampered with, and if it is determined that the trigger code has been tampered with, it sends recovery information to the trigger code recovery module.

[0042] The trigger code recovery module reads the system account information based on the recovery information;

[0043] The trigger code recovery module automatically regenerates the trigger code based on the system account information and overwrites the tampered trigger code in the database instance.

[0044] The account recovery module receives a recovery instruction from the database management system and restores the tampered system account and its corresponding permissions based on the system account information recorded in the metadata. The recovery instruction is issued by the database management system when it determines that the system account has been tampered with.

[0045] Optionally, after the trigger code generator module calculates the first checksum of the trigger code and initializes the trigger code into the database instance, the cloud database built-in system account anti-tampering protection method further includes:

[0046] The trigger code is used to intercept all attempts to tamper with the system account, and each attempt to tamper with the system account is logged.

[0047] The specific method for the trigger to intercept all attempts to tamper with the system account and to log each tampering attempt includes:

[0048] The trigger receives and parses the information about the tampering behavior to obtain the specific tampering behavior;

[0049] The trigger determines the specific trigger that triggers the specific tampering behavior based on the trigger code and the specific tampering behavior.

[0050] The specific trigger determines whether the account initiating the tampering behavior is the system account, determines whether to intercept the tampering behavior, and records the tampering behavior in the log;

[0051] The tampering behavior includes deleting a system account or modifying system account permissions. The trigger, based on the trigger code and the specific tampering behavior, determines the specific trigger that triggers the corresponding tampering behavior, including:

[0052] The trigger, based on the trigger code and the action of deleting the system account, determines which specific trigger to trigger; or

[0053] The trigger determines the grant trigger among the specific triggers based on the trigger code and the behavior of modifying system account permissions;

[0054] Specifically, the trigger determines whether the account initiating the tampering behavior is a system account, decides whether to intercept the tampering behavior, and logs the tampering behavior, including:

[0055] If the account deletion trigger determines that the account that initiated the tampering behavior is the system account, then it performs the deletion operation and deletes the system account.

[0056] If the account deletion trigger determines that the account initiating the tampering behavior is not the system account, it will block the tampering behavior, send an error message prohibiting the deletion of the system account, and log the tampering behavior of deleting the system account.

[0057] If the grant trigger determines that the account initiating the tampering behavior is the system account, then it performs the grant operation to modify the system account permissions.

[0058] If the granting trigger determines that the account initiating the tampering behavior is not the system account, it will intercept the tampering behavior, send an error message prohibiting modification of system account permissions, and log the tampering behavior that modifies system account permissions.

[0059] Optionally, the method for determining whether the system account has been tampered with by the database control includes:

[0060] The database management system initiates a system account check according to preset rules to check whether the system account has been tampered with.

[0061] If the database control determines that the system account has been tampered with, it sends the recovery command to the account recovery module.

[0062] The preset rules include: a first scheduled task and a second scheduled task. The database management initiates system account checks according to the preset rules, including:

[0063] The database management system periodically reads and records logs according to the time specified in the first scheduled task. The logs are generated by triggers formed by the trigger code, and each tampering behavior that modifies the system account is recorded in the logs.

[0064] If a readable log record exists, the database management system initiates a system account check.

[0065] If no readable log record exists, the database management will not initiate the system account check.

[0066] The database management system periodically initiates system account checks according to the time specified in the second scheduled task.

[0067] Optionally, after restoring the tampered system account and its corresponding permissions, the cloud database built-in system account anti-tampering protection method further includes:

[0068] The account recovery module sends a recovery message to the trigger.

[0069] The trigger receives the recovered information and deletes the recorded log.

[0070] Thirdly, an electronic device is provided, comprising:

[0071] One or more processors; and

[0072] One or more machine-readable media storing instructions thereon, when executed by the one or more processors, cause the electronic device to perform the cloud database built-in system account anti-tampering protection method as described in any of the first aspects.

[0073] Fourthly, a computer-readable storage medium is provided, characterized in that the computer program stored therein causes a processor to execute the cloud database built-in system account anti-tampering protection method as described in any of the first aspects.

[0074] This application has the following advantages:

[0075] In this invention, the cloud database built-in system account anti-tampering protection system includes: a trigger code generator module, which is used to read the system account information recorded in the metadata and automatically generate trigger code based on the system account information. That is, unlike the current triggers that use hard coding, this invention automatically generates trigger code based on system account information without hard coding and without presetting the system account information to be protected.

[0076] After automatically generating the trigger code, the first checksum of the trigger code is calculated, and the trigger code is initialized into the database instance. Simultaneously, the first checksum is sent to the metadata management module for storage. The metadata management module is used to manage system account information and store the first checksum.

[0077] The trigger code verification module is used to read the trigger code in the database instance, calculate the second checksum of the trigger code, and read and compare the first and second checksums to determine whether the trigger code has been tampered with. In other words, this novel method monitors whether the trigger code itself has been modified.

[0078] The trigger code recovery module is used to regenerate the trigger code using system account information if it is determined that the trigger code has been tampered with, and then overwrite the tampered trigger code in the database instance. In other words, by utilizing the trigger code verification module, the code recovery module, and metadata, it can not only automatically detect whether the trigger code itself has been tampered with, but also automatically recover the tampered trigger code after detection, greatly improving the security of system account protection technology.

[0079] The account recovery module is used to restore a system account and its corresponding permissions if it is determined that a system account has been tampered with, based on the system account information recorded in the metadata. That is, it uses triggers to promptly intercept attempts to tamper with system accounts and permissions, and can also automatically restore system accounts and permissions based on metadata after tampering is detected.

[0080] The cloud database built-in system account anti-tampering protection system proposed in this invention prevents the trigger code itself from being tampered with through trigger verification codes. It also has functions such as automatic trigger code recovery, interception of system account tampering behavior, and automatic system account recovery. The modules work together to realize a multi-layered anti-tampering and automatic recovery mechanism for cloud-native database built-in accounts, which has high practicality. Attached Figure Description

[0081] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0082] Figure 1 This is a modular schematic diagram of the cloud database built-in system account anti-tampering protection system according to an embodiment of the present invention;

[0083] Figure 2 This is a flowchart illustrating the anti-tampering interception process in an embodiment of the present invention;

[0084] Figure 3 This is a flowchart illustrating the process of checking whether a system account has been tampered with in an embodiment of the present invention.

[0085] Figure 4 This is a flowchart illustrating how the modules in this embodiment of the invention work together to prevent tampering. Detailed Implementation

[0086] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention, and are only some, not all, embodiments of the present invention, and are not intended to limit the present invention.

[0087] The cloud database built-in system account anti-tampering protection system proposed in this invention differs from existing cloud database protection systems. It features a newly designed system with five modules that work collaboratively to significantly enhance the system account anti-tampering protection capabilities. (See reference...) Figure 1 The schematic diagram shown below illustrates the modular design of the cloud database built-in system account anti-tampering protection system proposed in this invention, which includes:

[0088] The trigger code generator module is used to read the system account information recorded in the metadata, automatically generate trigger code based on the system account information, calculate the first checksum of the trigger code, initialize the trigger code into the database instance, and send the first checksum to the metadata management module for storage.

[0089] Generally, at the initial startup of the entire system, database management needs to initiate the initialization of the database instance. System accounts are pre-defined in the metadata and typically include: custom accounts and default accounts. The default account is automatically generated when the cloud database is created and is a mandatory account; while the custom account is created by database management and has permissions to operate the cloud database.

[0090] Regardless of the system account used, during the initialization of the database instance, the trigger code generator module needs to read the system account information recorded in the metadata, and then automatically generate trigger code based on the system account information, rather than generating trigger code through hard coding. Furthermore, because it is automatically generated based on the system account information, there is no need to preset the system account information to be protected.

[0091] After automatically generating the trigger code, the first checksum of the trigger code is calculated, and the trigger code is initialized into the database instance, thus completing the database instance initialization. Simultaneously, to verify whether the trigger code itself has been tampered with, the first checksum also needs to be sent to the metadata management module for storage.

[0092] The metadata management module is used to manage system account information and store the initial verification code. As its name suggests, its primary function is to manage metadata, and naturally, it can also manage system account information. It can also store the initial verification code from the trigger code generator module.

[0093] The trigger code verification module is used to read the trigger code in the database instance, calculate the second checksum of the trigger code, and read and compare the first checksum and the second checksum to determine whether the trigger code has been tampered with.

[0094] The aforementioned trigger code has been initialized in the database instance. During the subsequent operation of the cloud database's built-in system account anti-tampering protection system, the trigger code verification module reads the trigger code from the database instance and calculates the second checksum of the trigger code. Then, it reads the stored first checksum from the metadata management module, and finally compares the first and second checksums to determine whether the trigger code has been tampered with.

[0095] Understandably, if the first and second check codes are exactly the same, the trigger code is considered normal and has not been tampered with; if the first and second check codes are not exactly the same, the trigger code is considered to have been tampered with.

[0096] The trigger code recovery module is used to regenerate the trigger code using system account information and overwrite the tampered trigger code in the database instance if it is determined that the trigger code has been tampered with.

[0097] After the trigger code verification module performs its verification, if it determines that the trigger code has been tampered with, the trigger code recovery module reads the system account information from the metadata, regenerates the trigger code using this information, and then overwrites the tampered trigger code in the database instance. Through the coordinated work of these four modules, not only can the system automatically detect whether the trigger code itself has been tampered with, but it can also automatically recover the tampered trigger code after detection, greatly improving the security of the system account protection technology.

[0098] The account recovery module is used to restore the tampered system account and its corresponding permissions by using the system account information recorded in the metadata if it is determined that the system account has been tampered with.

[0099] The cloud database has a built-in system account anti-tampering protection system. Through triggers, it can promptly intercept attempts to tamper with system accounts and permissions. If a system account is confirmed to have been tampered with, it uses the system account information recorded in the metadata to restore the tampered account and its corresponding permissions, ensuring system account security. Through the coordinated operation of these five modules, it can detect whether the trigger code itself has been tampered with and automatically restore it if so. It can also intercept system account tampering attempts and automatically restore the system account after tampering, thus implementing a multi-layered anti-tampering and automatic recovery mechanism for built-in accounts in the cloud-native database.

[0100] In one possible embodiment, the cloud database's built-in system account anti-tampering protection system uses trigger codes to intercept all attempts to tamper with system accounts and logs each tampering attempt.

[0101] The specific methods for triggering the interception of all attempts to tamper with system accounts and logging each such attempt include:

[0102] Step S1: The trigger receives and parses the information about the tampering behavior to obtain the specific tampering behavior.

[0103] Generally, any tampering behavior needs to be initiated by a certain account. This initiation requires the use of database management. Therefore, before the trigger receives and parses the tampering behavior information, the database management will first receive the tampering behavior initiated by any account. Then, the database management connects to the database instance and sends the tampering behavior information to the trigger code formed in the database instance.

[0104] Once the trigger receives information about the tampering behavior, it parses the information to obtain the specific tampering behavior.

[0105] Step S2: Based on the trigger code and the specific tampering behavior, determine the specific trigger that triggers the corresponding tampering behavior.

[0106] In the trigger code, different triggers correspond to different types of tampering behavior, so it is necessary to determine the specific trigger based on the specific tampering behavior.

[0107] In one possible embodiment, the tampering behavior includes: deleting a system account or modifying system account permissions. The trigger, based on its code and the specific tampering behavior, determines the specific trigger that triggers the corresponding tampering behavior, including:

[0108] The trigger determines which specific trigger to trigger based on the trigger code and the action of deleting a system account; or the trigger determines which specific trigger to trigger based on the trigger code and the action of modifying system account permissions.

[0109] Step S3: The specific trigger determines whether the tampering behavior is initiated against a system account, and then determines whether to block the tampering behavior and log the tampering behavior.

[0110] Once the specific triggers are determined, each trigger needs to determine whether the tampering behavior was initiated against a system account. Due to the nature of system accounts, it is forbidden to delete or modify their permissions. Therefore, if it was not initiated against a system account, it can be considered a normal operation, and it will not be intercepted or logged. Of course, if it was initiated against a system account, it is an abnormal tampering operation, which needs to be intercepted and logged.

[0111] Since each tampering action carries the target account, the specific trigger determines whether the tampering action was initiated against a system account, thereby determining whether to intercept the tampering action and log the tampering action, including:

[0112] If the delete account trigger determines that the target account carried by the system account being deleted is not a system account, then the deletion operation is performed and the target account is deleted. If the delete account trigger determines that the target account carried by the system account being deleted is a system account, then the tampering behavior is blocked, an error message indicating that the deletion of the system account is prohibited is displayed, and the tampering behavior of deleting the system account is logged.

[0113] If the trigger determines that the target account for modifying system account permissions is not a system account, it will grant the permissions and modify the target account's permissions. If the trigger determines that the target account for modifying system account permissions is a system account, it will block the tampering behavior, display an error message indicating that modifying system account permissions is prohibited, and log the tampering behavior.

[0114] The above process can be used Figure 2 The anti-tampering interception flowchart shown is summarized as follows:

[0115] A tampering action occurs when a user deletes a system account or modifies system account permissions, both carrying the target account information. In this case, the database management system connects to the database instance, and the triggers parse the tampering information as follows: executing the SQL statement to delete the system account (Drop User) and executing the SQL statement to modify system account permissions (Grant). Based on the specific tampering action, the system determines to trigger the Drop User trigger and the Grant trigger. Each trigger checks whether the account in question is a system account.

[0116] The `drop user` trigger checks if the target account is a system account. If it is a system account, it returns an error message indicating that deleting a reserved system account is prohibited, and then logs the error. If the target account is not a system account, it executes SQL to delete the user.

[0117] The Grant trigger checks whether the target account is a system account. If it is a system account, it returns an error message indicating that modification of system-reserved account permissions is prohibited, and then logs the error. If the target account is not a system account, it executes the Grant authorization and modifies the user's permissions.

[0118] The above provides a detailed explanation of how trigger code intercepts all attempts to tamper with system accounts and how to log each such attempt. The following section, using the above methods, explains and illustrates system account checks.

[0119] Database management can initiate system account checks according to preset rules to check whether system accounts have been tampered with. If it is determined that the system accounts have been tampered with, the account recovery module can retrieve the recorded system account information from the metadata and restore the tampered system accounts and their corresponding permissions.

[0120] The preset rules include a first scheduled task and a second scheduled task. Database management can periodically read and record logs according to the time specified in the first scheduled task. These logs are generated by triggers created from trigger code, recording each instance of tampering with a system account. For example, if the first scheduled task is for 12 hours, then database management will read the logs every 12 hours. Naturally, if there is no tampering, there will be no log entry. Furthermore, after the triggers record each instance of tampering with a system account, if the account recovery module restores the tampered system account and its corresponding permissions, the log entry must be deleted to prevent it from being read repeatedly and mistakenly indicating another instance of tampering.

[0121] Therefore, if there are readable log records, it means that tampering occurred within the time period of the first scheduled task, such as within 12 hours, so the database management system initiates a system account check; if there are no readable log records, it means that no tampering occurred within the time period of the first scheduled task, such as within 12 hours, so the database management system will not initiate a system account check.

[0122] In another scenario, database management will periodically initiate system account checks according to the time specified in the second scheduled task. For example, if the second scheduled task is scheduled for 24 hours, then database management will initiate a system account check every 24 hours without needing to read the logs first.

[0123] The above process can be referred to Figure 3The flowchart illustrating the process of checking whether a system account has been tampered with is summarized as follows: The database management platform (i.e., database control) uses scheduled task 1 (i.e., the first scheduled task) to read the log of tampering behavior of system accounts. If such behavior is found, a system account check is initiated. The database management platform can also directly initiate a system account check using scheduled task 2 (i.e., the second scheduled task). If it is determined that the system account has been tampered with, the account recovery module is activated to restore the tampered system account and its corresponding permissions.

[0124] In summary, all the above processes can be borrowed. Figure 4 The flowchart illustrating the collaborative operation of various modules to achieve tamper-proof functionality is summarized as follows:

[0125] The data management platform initializes the database, checks triggers, and checks system accounts. The trigger code generator module generates trigger codes and calculates trigger code checksums, which are then recorded by the metadata management module.

[0126] The trigger code verification module calculates the current trigger checksum, reads the checksum recorded in the metadata (i.e., the metadata management module), compares the two checksums. If they match, no processing is needed. If they do not match, the trigger code is regenerated through the trigger code recovery module, and finally the trigger code in the database instance is restored.

[0127] After checking the system account, if it is determined that the system account has been tampered with, the system account and permissions recorded in the metadata are read through the account recovery module, and the tampered system account and permissions are restored.

[0128] Based on the aforementioned cloud database built-in system account anti-tampering protection system, this embodiment of the invention also provides a cloud database built-in system account anti-tampering protection method, which includes:

[0129] Step T1: The trigger code generator module reads the system account information recorded in the metadata;

[0130] Step T2: The trigger code generator module automatically generates trigger code based on the system account information;

[0131] Step T3: The trigger code generator module calculates the first checksum of the trigger code, initializes the trigger code into the database instance, and sends the first checksum to the metadata management module for storage.

[0132] Step T4: The metadata management module obtains and manages the system account information from the metadata, and simultaneously receives and stores the first verification code;

[0133] Step T5: The trigger code verification module reads the trigger code from the database instance and calculates the second checksum of the trigger code;

[0134] Step T6: The trigger code verification module reads the first verification code from the metadata management module;

[0135] Step T7: The trigger code verification module compares the first verification code and the second verification code to determine whether the trigger code has been tampered with, and if it is determined that the trigger code has been tampered with, it sends recovery information to the trigger code recovery module;

[0136] Step T8: The trigger code recovery module reads the system account information based on the recovery information;

[0137] Step T9: The trigger code recovery module automatically regenerates the trigger code based on the system account information and overwrites the tampered trigger code in the database instance;

[0138] Step T10: The account recovery module receives a recovery instruction from the database management system and restores the tampered system account and its corresponding permissions based on the system account information recorded in the metadata. The recovery instruction is issued by the database management system when it determines that the system account has been tampered with.

[0139] The methods for steps T1 to T10 above have been described in the foregoing explanation and description of the cloud database built-in system account anti-tampering protection system, and can be referred to the corresponding parts above, and will not be repeated here.

[0140] Optionally, after the trigger code generator module calculates the first checksum of the trigger code and initializes the trigger code into the database instance, the cloud database built-in system account anti-tampering protection method further includes:

[0141] The trigger code is used to intercept all attempts to tamper with the system account, and each attempt to tamper with the system account is logged.

[0142] The specific method for the trigger to intercept all attempts to tamper with the system account and to log each tampering attempt includes:

[0143] The trigger receives and parses the information about the tampering behavior to obtain the specific tampering behavior;

[0144] The trigger determines the specific trigger that triggers the specific tampering behavior based on the trigger code and the specific tampering behavior.

[0145] The specific trigger determines whether the account initiating the tampering behavior is the system account, determines whether to intercept the tampering behavior, and records the tampering behavior in the log;

[0146] The tampering behavior includes deleting a system account or modifying system account permissions. The trigger, based on the trigger code and the specific tampering behavior, determines the specific trigger that triggers the corresponding tampering behavior, including:

[0147] The trigger, based on the trigger code and the action of deleting the system account, determines which specific trigger to trigger; or

[0148] The trigger determines the grant trigger among the specific triggers based on the trigger code and the behavior of modifying system account permissions;

[0149] Specifically, the trigger determines whether the account initiating the tampering behavior is a system account, decides whether to intercept the tampering behavior, and logs the tampering behavior, including:

[0150] If the account deletion trigger determines that the account that initiated the tampering behavior is the system account, then it performs the deletion operation and deletes the system account.

[0151] If the account deletion trigger determines that the account initiating the tampering behavior is not the system account, it will block the tampering behavior, send an error message prohibiting the deletion of the system account, and log the tampering behavior of deleting the system account.

[0152] If the grant trigger determines that the account initiating the tampering behavior is the system account, then it performs the grant operation to modify the system account permissions.

[0153] If the granting trigger determines that the account initiating the tampering behavior is not the system account, it will intercept the tampering behavior, send an error message prohibiting modification of system account permissions, and log the tampering behavior that modifies system account permissions.

[0154] Optionally, the method for determining whether the system account has been tampered with by the database control includes:

[0155] The database management system initiates a system account check according to preset rules to check whether the system account has been tampered with.

[0156] If the database control determines that the system account has been tampered with, it sends the recovery command to the account recovery module.

[0157] The preset rules include: a first scheduled task and a second scheduled task. The database management initiates system account checks according to the preset rules, including:

[0158] The database management system periodically reads and records logs according to the time specified in the first scheduled task. The logs are generated by triggers formed by the trigger code, and each tampering behavior that modifies the system account is recorded in the logs.

[0159] If a readable log record exists, the database management system initiates a system account check.

[0160] If no readable log record exists, the database management will not initiate the system account check.

[0161] The database management system periodically initiates system account checks according to the time specified in the second scheduled task.

[0162] Optionally, after restoring the tampered system account and its corresponding permissions, the cloud database built-in system account anti-tampering protection method further includes:

[0163] The account recovery module sends a recovery message to the trigger.

[0164] The trigger receives the recovered information and deletes the recorded log.

[0165] The above content has been described in the foregoing explanation and description of the cloud database built-in system account anti-tampering protection system, and can be referred to in the corresponding sections above, so it will not be repeated here.

[0166] Based on the above-mentioned cloud database built-in system account anti-tampering protection method, this embodiment of the invention also provides an electronic device, including:

[0167] One or more processors; and

[0168] One or more machine-readable media storing instructions thereon, when executed by the one or more processors, cause the electronic device to perform the cloud database built-in system account anti-tampering protection method as described in any one of steps T1 to T10.

[0169] Based on the above-described cloud database built-in system account anti-tampering protection method, this embodiment of the invention also provides a computer-readable storage medium, wherein the stored computer program causes a processor to execute the cloud database built-in system account anti-tampering protection method as described in any one of steps T1 to T10.

[0170] Through the above embodiments, the cloud database built-in system account anti-tampering protection system of the present invention differs from the hard-coding method used in current triggers. It automatically generates trigger code based on system account information without hard-coding or pre-setting the system account information to be protected. Simultaneously, it can monitor whether the trigger code itself has been tampered with. Utilizing the trigger code verification module, code recovery module, and metadata, it can not only automatically detect whether the trigger code itself has been tampered with, but also automatically recover the tampered trigger code after detection, greatly improving the security of the system account protection technology.

[0171] Triggers can be used to promptly intercept attempts to tamper with system accounts and permissions. Furthermore, once system accounts are detected to have been tampered with, system accounts and permissions can be automatically restored based on metadata.

[0172] The cloud database built-in system account anti-tampering protection system proposed in this invention prevents the trigger code itself from being tampered with through trigger verification codes. It also has functions such as automatic trigger code recovery, interception of system account tampering behavior, and automatic system account recovery. The modules work together to realize a multi-layered anti-tampering and automatic recovery mechanism for cloud-native database built-in accounts, which has high practicality.

[0173] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0174] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0175] The technical solutions provided by the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A cloud database built-in system account anti-tampering protection system, characterized in that, The cloud database's built-in system account anti-tampering protection system includes: The trigger code generator module is used to read the system account information recorded in the metadata, automatically generate trigger code based on the system account information, calculate the first check code of the trigger code, initialize the trigger code into the database instance, and send the first check code to the metadata management module for storage. The metadata management module is used to manage the system account information and store the first verification code; The trigger code verification module is used to read the trigger code in the database instance, calculate the second check code of the trigger code, and read and compare the first check code and the second check code to determine whether the trigger code has been tampered with. The trigger code recovery module is used to regenerate the trigger code using the system account information and overwrite the tampered trigger code in the database instance if it is determined that the trigger code has been tampered with. The account recovery module is used to recover the tampered system account and its corresponding permissions by using the system account information recorded in the metadata if it is determined that the system account has been tampered with.

2. The cloud database built-in system account anti-tampering protection system according to claim 1, characterized in that, The cloud database's built-in system account anti-tampering protection system uses the trigger code to intercept all attempts to tamper with system accounts and logs each tampering attempt.

3. The cloud database built-in system account anti-tampering protection system according to claim 1, characterized in that, The cloud database's built-in system account anti-tampering protection system also includes: database management, used to initiate system account checks according to preset rules to check whether the system account has been tampered with, and, if it is determined that the system account has been tampered with, to restore the tampered system account and its corresponding permissions through the account recovery module.

4. The cloud database built-in system account anti-tampering protection system according to claim 3, characterized in that, The preset rules include: a first timed task and a second timed task; The database control is used to periodically read and record logs according to the time in the first scheduled task. The record logs are obtained by recording each tampering behavior that modifies the system account, which is generated by the trigger code. If a readable log record exists, the database management system initiates a system account check. If no readable log record exists, the database management will not initiate the system account check. The database management is used to periodically initiate system account checks according to the time specified in the second scheduled task.

5. The cloud database built-in system account anti-tampering protection system according to claim 2, characterized in that, The trigger records each tampering behavior of the system account in a log, and is also used to delete the log if the account recovery module restores the tampered system account and its corresponding permissions.

6. The cloud database built-in system account anti-tampering protection system according to claim 2, characterized in that, The specific method for the trigger to intercept all attempts to tamper with the system account and to log each tampering attempt includes: The trigger receives and parses the information about the tampering behavior to obtain the specific tampering behavior; The trigger determines the specific trigger that triggers the specific tampering behavior based on the trigger code and the specific tampering behavior. The specific trigger determines whether the tampering behavior is initiated against the system account, and then determines whether to intercept the tampering behavior and log the tampering behavior.

7. The cloud database built-in system account anti-tampering protection system according to claim 6, characterized in that, The tampering includes: deleting system accounts or modifying system account permissions; The trigger, based on the trigger code and the specific tampering behavior, determines the specific trigger that triggers the corresponding specific tampering behavior, including: The trigger, based on the trigger code and the action of deleting the system account, determines which specific trigger to trigger; or The trigger determines the grant trigger among the specific triggers based on the trigger code and the behavior of modifying system account permissions.

8. The cloud database built-in system account anti-tampering protection system according to claim 7, characterized in that, The tampering behavior carries the target account; the specific trigger determines whether the tampering behavior is initiated against the system account, and then determines whether to intercept the tampering behavior, and logs the tampering behavior, including: If the delete account trigger determines that the target account carried by the deleted system account is not the system account, then it performs the deletion operation and deletes the target account. If the account deletion trigger determines that the target account carried by the deleted system account is the system account, it will intercept the tampering behavior, send an error message prohibiting the deletion of the system account, and log the tampering behavior of deleting the system account. If the grant trigger determines that the target account carried by the modification of system account permissions is not the system account, then the grant operation is performed to modify the permissions of the target account. If the grant trigger determines that the target account carried by the modification of system account permissions is the system account, it will intercept the tampering behavior, send an error message prohibiting the modification of system account permissions, and log the tampering behavior of modifying system account permissions.

9. The cloud database built-in system account anti-tampering protection system according to claim 6, characterized in that, The cloud database's built-in system account anti-tampering protection system also includes: database management; Before the trigger receives and parses the information about the tampering behavior, the database control is also used to receive the tampering behavior initiated by any account, connect to the database instance, and send the information about the tampering behavior to the trigger.

10. A method for preventing tampering with built-in system accounts in a cloud database, characterized in that, The cloud database built-in system account anti-tampering protection method is applied to the cloud database built-in system account anti-tampering protection system, which includes: a trigger code generator module, a metadata management module, a trigger code verification module, a trigger code recovery module, and an account recovery module; the cloud database built-in system account anti-tampering protection method includes: The trigger code generator module reads the system account information recorded in the metadata; The trigger code generator module automatically generates trigger code based on the system account information; The trigger code generator module calculates the first checksum of the trigger code, initializes the trigger code into the database instance, and sends the first checksum to the metadata management module for storage. The metadata management module obtains and manages the system account information from the metadata, and simultaneously receives and stores the first verification code; The trigger code verification module reads the trigger code from the database instance and calculates the second checksum of the trigger code; The trigger code verification module reads the first verification code from the metadata management module; The trigger code verification module compares the first verification code and the second verification code to determine whether the trigger code has been tampered with, and if it is determined that the trigger code has been tampered with, it sends recovery information to the trigger code recovery module. The trigger code recovery module reads the system account information based on the recovery information; The trigger code recovery module automatically regenerates the trigger code based on the system account information and overwrites the tampered trigger code in the database instance. The account recovery module receives a recovery instruction from the database management system and restores the tampered system account and its corresponding permissions based on the system account information recorded in the metadata. The recovery instruction is issued by the database management system when it determines that the system account has been tampered with.

11. The cloud database built-in system account anti-tampering protection method according to claim 10, characterized in that, After the trigger code generator module calculates the first checksum of the trigger code and initializes the trigger code into the database instance, the cloud database built-in system account anti-tampering protection method further includes: The trigger code is used to intercept all attempts to tamper with the system account, and each attempt to tamper with the system account is logged. The specific method for the trigger to intercept all attempts to tamper with the system account and to log each tampering attempt includes: The trigger receives and parses the information about the tampering behavior to obtain the specific tampering behavior; The trigger determines the specific trigger that triggers the specific tampering behavior based on the trigger code and the specific tampering behavior. The specific trigger determines whether the account initiating the tampering behavior is the system account, determines whether to intercept the tampering behavior, and records the tampering behavior in the log; The tampering behavior includes: deleting a system account or modifying system account permissions. The trigger, based on the trigger code and the specific tampering behavior, determines the specific trigger that triggers the corresponding tampering behavior, including: The trigger, based on the trigger code and the action of deleting the system account, determines which specific trigger to trigger; or The trigger determines the grant trigger among the specific triggers based on the trigger code and the behavior of modifying system account permissions; Specifically, the trigger determines whether the account initiating the tampering behavior is a system account, decides whether to intercept the tampering behavior, and logs the tampering behavior, including: If the account deletion trigger determines that the account that initiated the tampering behavior is the system account, then it performs the deletion operation and deletes the system account. If the account deletion trigger determines that the account initiating the tampering behavior is not the system account, it will block the tampering behavior, send an error message prohibiting the deletion of the system account, and log the tampering behavior of deleting the system account. If the grant trigger determines that the account initiating the tampering behavior is the system account, then it performs the grant operation to modify the system account permissions. If the granting trigger determines that the account initiating the tampering behavior is not the system account, it will intercept the tampering behavior, send an error message prohibiting modification of system account permissions, and log the tampering behavior that modifies system account permissions.

12. The cloud database built-in system account anti-tampering protection method according to claim 10, characterized in that, The method for determining whether the system account has been tampered with by the database control includes: The database management system initiates a system account check according to preset rules to check whether the system account has been tampered with. If the database control determines that the system account has been tampered with, it sends the recovery command to the account recovery module. The preset rules include: a first scheduled task and a second scheduled task. The database management initiates system account checks according to the preset rules, including: The database management system periodically reads and records logs according to the time specified in the first scheduled task. The logs are generated by triggers formed by the trigger code, and each tampering behavior that modifies the system account is recorded in the logs. If a readable log record exists, the database management system initiates a system account check. If no readable log record exists, the database management will not initiate the system account check. The database management system periodically initiates system account checks according to the time specified in the second scheduled task.

13. The cloud database built-in system account anti-tampering protection method according to claim 11, characterized in that, After restoring the tampered system account and its corresponding permissions, the cloud database built-in system account anti-tampering protection method also includes: The account recovery module sends a recovery message to the trigger. The trigger receives the recovered information and deletes the recorded log.

14. An electronic device, characterized in that, include: One or more processors; and One or more machine-readable media on which instructions are stored, which, when executed by the one or more processors, cause the electronic device to perform the cloud database built-in system account anti-tampering protection method as described in any one of claims 10 to 13.

15. A computer-readable storage medium, characterized in that, The stored computer program causes the processor to execute the cloud database built-in system account anti-tampering protection method as described in any one of claims 10 to 13.