Updated on 2024-10-24 GMT+08:00

Configuring the TDE Function

Transparent Data Encryption (TDE) encrypts data files and backup files using certificates to implement real-time I/O encryption and decryption. This function effectively protects the security of databases and data files.

TDE is only available for certain RDS for SQL Server editions. For details, see Table 1.

Table 1 RDS for SQL Server editions that support TDE

DB Instance Type

Editions Support for TDE

Primary/Standby

  • 2008 R2 Enterprise Edition
  • 2012 Enterprise Edition
  • 2014 Enterprise Edition
  • 2016 Enterprise Edition
  • 2019 Standard Edition. To enable TDE in this edition, contact customer service.

Single

  • 2016 Enterprise Edition
  • 2017 Enterprise Edition
  • 2019 Standard Edition

Cluster

  • 2017 Enterprise Edition

Constraints

  1. If TDE has been enabled for a single DB instance, the instance cannot be changed to primary/standby DB instances.
  2. RDS for SQL Server currently does not support TDE certificate download. To restore data offline using the encrypted .bak file, perform the following operations:
    1. Disable TDE for the database. For details, see Configuring Database-Level TDE.
    2. Create a manual backup for the database.
    3. Restore data from the manual backup.
    4. Enable TDE for the database as required.
  3. Enabling TDE improves data security but affects read and write performance of encrypted databases. Exercise caution when enabling TDE.
  4. To migrate on-premises encrypted databases to RDS SQL Server DB instances, you need to disable database-level TDE first.
  5. DB instances with the instance-level TDE function enabled cannot be restored from backups to existing DB instances.
  6. When enabling the instance-level TDE function or using the stored procedure rds_tde to enable or disable database-level TDE, you are advised not to perform the following operations:
    • Delete files from file groups in databases.
    • Delete databases.
    • Take databases offline
    • Split databases.
    • Convert databases or file groups to the READ ONLY state.
    • Run the ALTER DATABASE command.
    • Create backups.
    • Start backup for databases or database files.
    • Start restoration for databases or database files.

Enabling Instance-Level TDE

  1. Log in to the management console.
  2. Click in the upper left corner and select a region.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, click the target instance name to go to the Overview page.
  5. Under TDE, click .

    Figure 1 Enabling instance-level TDE

  6. In the displayed dialog box, click Yes.

    Once enabled, the instance-level TDE function cannot be disabled. Exercise caution when deciding to enable instance-level TDE.

Configuring Database-Level TDE

Before enabling the database-level TDE function, ensure that the instance-level TDE function has been enabled.

  1. Connect to the target DB instance.

    For details, see Connecting to a DB Instance Through a Public Network, Connecting to a DB Instance Through a Private Network, and Connecting to a DB Instance Through DAS (Recommended).

  2. Use the stored procedure rds_tde to enable, disable, or query the database-level TDE status.

    exec master.dbo.rds_tde DatabaseName,TDE_Action

    • DatabaseName: indicates the target database name, which can be null.
    • TDE_Action:
      • The value -1 indicates that the database encryption status is queried.

        If DatabaseName is null, the encryption status of all databases is returned.

      • The value 0 indicates that the TDE function is disabled.
      • The value 1 indicates that the TDE function is enabled.
    1. Enable TDE for database db1.

      exec master.dbo.rds_tde db1, 1

      Figure 2 Enabling TDE
    2. Disable TDE for database db1.

      exec master.dbo.rds_tde db1, 0

      Figure 3 Disabling TDE
    3. Query the TDE status of database db1.

      exec master.dbo.rds_tde db1, -1

      Figure 4 Querying the TDE status (Enabled)
      Figure 5 Querying the TDE status (Disabled)
    4. Query the TDE status of all databases.

      exec master.dbo.rds_tde null, -1

      Figure 6 Querying the TDE status of all databases