TDengine TSDB Security Configuration Guide

Juno Qiu

July 5, 2026 /

Data security is essential for production TSDB deployments. TDengine provides controls for IP whitelisting, audit logs, and encryption at rest.

IP whitelisting

IP whitelisting controls which hosts can access the database.

Configuration

CREATE USER testuser PASS 'password' HOST '192.168.1.0/24';
ALTER USER testuser ADD HOST '10.0.0.0/8';

Querying the whitelist

SELECT USER, ALLOWED_HOST FROM INFORMATION_SCHEMA.INS_USERS;
SHOW USERS;

Removing whitelist entries

ALTER USER testuser DROP HOST '192.168.1.0/24';

Important notes

ItemDescription
Open-source edition limitationThe open-source edition allows configuration but does not enforce it
Cluster consistencyThe whitelist must be consistent across all cluster nodes
Automatic additionCluster node IPs are automatically added to the whitelist
Default allowance127.0.0.1 is in the whitelist by default

Audit logs

Audit logs record user operations so administrators can review security events and trace historical activity.

Enabling the audit function

In the taosd configuration file (taos.cfg), set the following parameters:

  • audit 1
  • auditLevel 3
  • monitorFqdn localhost
  • monitorPort 6043

Creating an audit database

CREATE DATABASE audit_db IS_AUDIT 1;

Audit log structure

Audit logs use JSON format with the following fields: tsuseroperationdbresourceclient_addressdetails.

Viewing audit logs

Via taosExplorer: System Management, Audit, View Audit Logs.

Via CLI:

SELECT * FROM audit_db.operations;

Encryption at rest

TDengine supports Transparent Data Encryption (TDE) to reduce the risk of data exposure from storage media or copied data files.

Generating keys

taosk -c /etc/taos --set-cfg-algorithm sm4 --set-meta-algorithm sm4 --encrypt-server --encrypt-database --encrypt-config --encrypt-metadata --encrypt-data

Checking encryption status

SELECT * FROM INFORMATION_SCHEMA.INS_ENCRYPT_STATUS;

Backing up keys

taosk -c /etc/taos --backup --svr-key your_key

Encryption algorithms

AlgorithmDescription
SM4SM4 block cipher algorithm (default)
AES-128-CBCAES-128-CBC block cipher algorithm

Security deployment recommendations

Network layer

  • Configure firewall rules
  • Use VPC (Virtual Private Cloud) for network isolation
  • Enable IP whitelisting

Access control

  • Apply the principle of least privilege
  • Rotate passwords regularly
  • Enable audit logs

Data protection

  • Enable encryption at rest
  • Perform regular data backups
  • Configure replica strategies

Summary

TDengine Enterprise Edition provides several security controls:

  1. IP whitelisting restricts allowed access sources
  2. Audit logs record user operations
  3. Transparent Data Encryption protects data at rest
  4. Use these controls together rather than relying on a single security mechanism