From ca518a7649942f4ef92817d10c93787ade1afaa2 Mon Sep 17 00:00:00 2001 From: lysu Date: Mon, 25 May 2020 16:07:59 +0800 Subject: [PATCH 1/8] refine enable tls between coms --- TOC.md | 5 +- enable-encrypt-stored-data.md | 45 ++++++++++ ...tocols.md => enable-tls-between-clients.md | 0 enable-tls-between-components.md | 82 +++++-------------- .../sql-statement-alter-instance.md | 2 +- 5 files changed, 71 insertions(+), 63 deletions(-) create mode 100644 enable-encrypt-stored-data.md rename encrypted-connections-with-tls-protocols.md => enable-tls-between-clients.md (100%) diff --git a/TOC.md b/TOC.md index 70ac73d43c55..605c92265dcf 100644 --- a/TOC.md +++ b/TOC.md @@ -205,8 +205,9 @@ + [TiDB 集群报警规则与处理方法](/alert-rules.md) + [TiFlash 报警规则与处理方法](/tiflash/tiflash-alert-rules.md) @孙若曦 + 安全加固 - + [使用 TLS 加密连接](/encrypted-connections-with-tls-protocols.md) @苏立 - + [为 TiDB 组件间开启 TLS 和数据加密存储](/enable-tls-between-components.md) @苏立 + + [为 TiDB 客户端服务端间通信开启加密传输](/enable-tls-between-clients.md) @苏立 + + [为 TiDB 组件间通信开启加密传输](/enable-tls-between-components.md) @苏立 + + [为 TiDB 开启数据加密存储](/enable-encrypt-stored-data.md) @苏立 + [生成自签名证书](/generate-self-signed-certificates.md) @刘新韬 + 权限 + [与 MySQL 安全特性差异](/security-compatibility-with-mysql.md) @毛康力 diff --git a/enable-encrypt-stored-data.md b/enable-encrypt-stored-data.md new file mode 100644 index 000000000000..bc94bc426919 --- /dev/null +++ b/enable-encrypt-stored-data.md @@ -0,0 +1,45 @@ +--- +title: 为 TiDB 开启数据加密存储 +category: how-to +aliases: ['/docs-cn/dev/how-to/secure/enable-encrypt-stored-data/'] +--- + +## 开启数据加密存储 + +在 TiDB 集群中,用户的数据都存储在 TiKV 中,配置了 TiKV 数据加密存储功能,就代表 TiDB 集群已经加密存储了用户的数据。本部分主要介绍如何配置 TiKV 的加密存储功能。 + +### 操作流程 + +1. 生成 token 文件。 + + token 文件存储的是密钥,用于对用户数据进行加密,以及对已加密的数据进行解密。 + + {{< copyable "shell-regular" >}} + + ```bash + ./tikv-ctl random-hex --len 256 > cipher-file-256 + ``` + + > **注意:** + > + > TiKV 只接受 hex 格式的 token 文件,文件的长度必须是 2^n,并且小于等于 1024。 + +2. 配置 TiKV。 + + ```toml + [security] + # Cipher file 的存储路径 + cipher-file = "/path/to/cipher-file-256" + ``` + +> **注意:** +> +> 若使用 [Lightning](/tidb-lightning/tidb-lightning-overview.md) 向集群导入数据,如果目标集群开启了加密功能,Lightning 生成的 sst 文件也必须是加密的格式。 + +### 使用限制 + +目前 TiKV 数据加密存储存在以下限制: + +- 对之前没有开启加密存储的集群,不支持开启该功能。 +- 已经开启加密功能的集群,不允许关闭加密存储功能。 +- 同一集群内部,不允许部分 TiKV 实例开启该功能,部分 TiKV 实例不开启该功能。对于加密存储功能,所有 TiKV 实例要么都开启该功能,要么都不开启该功能。这是由于 TiKV 实例之间会有数据迁移,如果开启了加密存储功能,迁移过程中数据也是加密的。 diff --git a/encrypted-connections-with-tls-protocols.md b/enable-tls-between-clients.md similarity index 100% rename from encrypted-connections-with-tls-protocols.md rename to enable-tls-between-clients.md diff --git a/enable-tls-between-components.md b/enable-tls-between-components.md index 49c0c789becc..10267da9926b 100644 --- a/enable-tls-between-components.md +++ b/enable-tls-between-components.md @@ -1,27 +1,25 @@ --- -title: 为 TiDB 组件间开启 TLS 和数据加密存储 +title: 为 TiDB 组件间通信开启加密传输 category: how-to aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-components/'] --- -# 为 TiDB 组件间开启 TLS 和数据加密存储 +## 支持使用加密传输的组件 -本文档介绍 TiDB 集群如何开启 TLS 验证和数据加密存储。 +本部分介绍如何为 TiDB 集群内各部组件间开启加密传输,一旦开启以下组件间均将使用加密传输: -## 开启 TLS 验证 + - TiDB 与 TiKV、PD + - TiKV 与 PD + - TiDB Control 与 TiDB,TiKV Control 与 TiKV,PD Control 与 PD + - TiKV、PD、TiDB 各自集群内内部通讯 + +目前暂不支持只开启其中部分组件的加密传输。 -本部分介绍 TiDB 集群如何开启 TLS 验证,TLS 验证支持: - -- TiDB 组件之间的双向验证,包括 TiDB、TiKV、PD 相互之间,TiDB Control 与 TiDB、 TiKV Control 与 TiKV、PD Control 与 PD 的双向认证,以及 TiKV peer 之间、PD peer 之间。一旦开启,所有组件之间均使用验证,不支持只开启某一部分的验证。 -- MySQL Client 与 TiDB 之间的客户端对服务器身份的单向验证以及双向验证。 - -MySQL Client 与 TiDB 之间使用一套证书,TiDB 集群组件之间使用另外一套证书。 - -### TiDB 集群组件间开启 TLS(双向认证) +### 配置开启机密传输 1. 准备证书。 - 推荐为 TiDB、TiKV、PD 分别准备一个 server 证书,并保证可以相互验证,而它们的各种客户端共用 client 证书。 + 推荐为 TiDB、TiKV、PD 分别准备一个 server 证书,并保证可以相互验证,而它们的 Control 工具则可选择共用 client 证书。 有多种工具可以生成自签名证书,如 `openssl`,`easy-rsa`,`cfssl`。 @@ -69,11 +67,11 @@ MySQL Client 与 TiDB 之间使用一套证书,TiDB 集群组件之间使用 key-path = "/path/to/pd-server-key.pem" ``` - 此时 TiDB 集群各个组件间已开启双向验证。 + 此时 TiDB 集群各个组件间已开启加密传输。 > **注意:** > - > 若 TiDB 集群各个组件间已开启 TLS,在使用 tidb-ctl、tikv-ctl 或 pd-ctl 工具连接集群时,需要指定 client 证书,示例: + > 若 TiDB 集群各个组件间开启加密传输后,在使用 tidb-ctl、tikv-ctl 或 pd-ctl 工具连接集群时,需要指定 client 证书,示例: {{< copyable "shell-regular" >}} @@ -92,10 +90,12 @@ MySQL Client 与 TiDB 之间使用一套证书,TiDB 集群组件之间使用 ```bash ./tikv-ctl --host="127.0.0.1:20160" --ca-path="/path/to/ca.pem" --cert-path="/path/to/client.pem" --key-path="/path/to/clinet-key.pem" ``` + +### 认证组件调用者身份 -3. 配置校验调用者 Common Name。 +通常被调用者除了校验调用者提供的密钥、证书和 CA 有效性外,还需要校验调用方身份以防止拥有有效证书的非法访问者进行访问(例如:TiKV 只能被 TiDB 访问,需阻止拥有合法证书但非 TiDB 的其他访问者访问 TiKV)。 - 通常被调用者除了校验调用者提供的密钥、证书和 CA 有效性外,还需要校验调用方身份(例如:TiKV 只能被 TiDB 访问,需阻止拥有合法证书但非 TiDB 的其他访问者访问 TiKV)。推荐在生成证书时通过 `Common Name` 标识证书使用者身份,并在被调用者配置检查证书 `Common Name` 列表来检查调用者身份。 +如希望进行组件调用者身份认证,需要在生证书时通过 `Common Name` 标识证书使用者身份,并在被调用者配置检查证书 `Common Name` 列表来检查调用者身份。 - TiDB @@ -129,50 +129,12 @@ MySQL Client 与 TiDB 之间使用一套证书,TiDB 集群组件之间使用 cert-allowed-cn = ["TiKV-Server", "TiDB-Server", "PD-Control"] ``` -4. 重加载证书。 - - TiDB、PD 和 TiKV 会在每次新建相互通讯的连接时重新读取当前的证书和密钥文件内容,实现证书和密钥的重加载。目前暂不支持 CA 的重加载。 - -### MySQL 与 TiDB 间开启 TLS - -请参考 [使用加密连接](/encrypted-connections-with-tls-protocols.md)。 - -## 开启数据加密存储 - -在 TiDB 集群中,用户的数据都存储在 TiKV 中,配置了 TiKV 数据加密存储功能,就代表 TiDB 集群已经加密存储了用户的数据。本部分主要介绍如何配置 TiKV 的加密存储功能。 - -### 操作流程 - -1. 生成 token 文件。 - - token 文件存储的是密钥,用于对用户数据进行加密,以及对已加密的数据进行解密。 - - {{< copyable "shell-regular" >}} - - ```bash - ./tikv-ctl random-hex --len 256 > cipher-file-256 - ``` - - > **注意:** - > - > TiKV 只接受 hex 格式的 token 文件,文件的长度必须是 2^n,并且小于等于 1024。 - -2. 配置 TiKV。 - - ```toml - [security] - # Cipher file 的存储路径 - cipher-file = "/path/to/cipher-file-256" - ``` +### 证书重加载 -> **注意:** -> -> 若使用 [Lightning](/tidb-lightning/tidb-lightning-overview.md) 向集群导入数据,如果目标集群开启了加密功能,Lightning 生成的 sst 文件也必须是加密的格式。 +TiDB、PD 和 TiKV 和各种 Client 都会在每次新建相互通讯的连接时重新读取当前的证书和密钥文件内容,实现证书和密钥的重加载。目前暂不支持 CA 的重加载。 -### 使用限制 +### 客户端与 TiDB 间开启加密传输 -目前 TiKV 数据加密存储存在以下限制: +本文介绍的是 TiDB 集群内各部组件如何开启加密传输, -- 对之前没有开启加密存储的集群,不支持开启该功能。 -- 已经开启加密功能的集群,不允许关闭加密存储功能。 -- 同一集群内部,不允许部分 TiKV 实例开启该功能,部分 TiKV 实例不开启该功能。对于加密存储功能,所有 TiKV 实例要么都开启该功能,要么都不开启该功能。这是由于 TiKV 实例之间会有数据迁移,如果开启了加密存储功能,迁移过程中数据也是加密的。 +对于客户端应用与 TiDB 之间的加密传输配置请参考[为 TiDB 客户端服务端间通信开启加密传输](/enable-tls-between-clients.md),客户端应用与 TiDB 之间通讯可以使用与本文介绍的内部集群间通讯证书完全不同的另一套证书。 diff --git a/sql-statements/sql-statement-alter-instance.md b/sql-statements/sql-statement-alter-instance.md index b04c317e5da8..b816f736d2a9 100644 --- a/sql-statements/sql-statement-alter-instance.md +++ b/sql-statements/sql-statement-alter-instance.md @@ -41,4 +41,4 @@ ALTER INSTANCE RELOAD TLS; ## 另请参阅 -[MySQL 客户端开启 TLS](/encrypted-connections-with-tls-protocols.md) +[MySQL 客户端开启 TLS](/enable-tls-between-clients.md) From 382b61ce2de1965fd2b7d7057d2f85d4e67a9fd3 Mon Sep 17 00:00:00 2001 From: lysu Date: Mon, 25 May 2020 16:21:14 +0800 Subject: [PATCH 2/8] refine client-server tls --- enable-tls-between-clients.md | 18 +++++++++--------- enable-tls-between-components.md | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/enable-tls-between-clients.md b/enable-tls-between-clients.md index d47189613fff..bf88b6f095bb 100644 --- a/enable-tls-between-clients.md +++ b/enable-tls-between-clients.md @@ -1,12 +1,12 @@ --- -title: 使用加密连接 +title: 为 TiDB 客户端服务端间通信开启加密传输 category: how-to -aliases: ['/docs-cn/dev/how-to/secure/enable-tls-clients/'] +aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-clients.md/'] --- # 使用加密连接 -TiDB 服务端默认采用非加密连接,因而具备监视信道流量能力的第三方可以知悉 TiDB 服务端与客户端之间发送和接受的数据,包括但不限于查询语句内容、查询结果等。若信道是不可信的,例如客户端是通过公网连接到 TiDB 服务端的,则非加密连接容易造成信息泄露,建议使用加密连接确保安全性。 +TiDB 服务端与客户端之间默认采用非加密连接,因而具备监视信道流量能力的第三方可以知悉 TiDB 服务端与客户端之间发送和接受的数据,包括但不限于查询语句内容、查询结果等。若信道是不可信的,例如客户端是通过公网连接到 TiDB 服务端的,则非加密连接容易造成信息泄露,建议使用加密连接确保安全性。 TiDB 服务端支持启用基于 TLS(传输层安全)协议的加密连接,协议与 MySQL 加密连接一致,现有 MySQL 客户端如 MySQL 运维工具和 MySQL 驱动等能直接支持。TLS 的前身是 SSL,因而 TLS 有时也被称为 SSL,但由于 SSL 协议有已知安全漏洞,TiDB 实际上并未支持。TiDB 支持的 TLS/SSL 协议版本为 TLS 1.0、TLS 1.1、TLS 1.2、TLS 1.3。 @@ -76,12 +76,6 @@ ssl-key = "certs/server-key.pem" 若证书参数无误,则 TiDB 在启动时将会输出 `secure connection is enabled`,否则 TiDB 会输出 `secure connection is NOT ENABLED`。 -## 重加载证书、密钥和 CA - -在需要替换证书、密钥或 CA 时,可以在完成对应文件替换后,对运行中的 TiDB 实例执行 [`ALTER INSTANCE RELOAD TLS`](/sql-statements/sql-statement-alter-instance.md) 语句从原配置的证书 ([`ssl-cert`](/tidb-configuration-file.md#ssl-cert))、密钥 ([`ssl-key`](/tidb-configuration-file.md#ssl-key)) 和 CA ([`ssl-ca`](/tidb-configuration-file.md#ssl-ca)) 的路径重新加证书、密钥和 CA,而无需重启 TiDB 实例。 - -新加载的证书密钥和 CA 将在语句执行成功后对新建立的连接生效,不会影响语句执行前已建立的连接。 - ## 配置 MySQL 客户端使用加密连接 MySQL 5.7 及以上版本自带的客户端默认尝试使用安全连接,若服务端不支持安全连接则自动退回到使用非安全连接;MySQL 5.7 以下版本自带的客户端默认采用非安全连接。 @@ -177,3 +171,9 @@ TiDB 支持的 TLS 版本及密钥交换协议和加密算法由 Golang 官方 - TLS\_AES\_128\_GCM\_SHA256 - TLS\_AES\_256\_GCM\_SHA384 - TLS\_CHACHA20\_POLY1305\_SHA256 + +## 重加载证书、密钥和 CA + +在需要替换证书、密钥或 CA 时,可以在完成对应文件替换后,对运行中的 TiDB 实例执行 [`ALTER INSTANCE RELOAD TLS`](/sql-statements/sql-statement-alter-instance.md) 语句从原配置的证书 ([`ssl-cert`](/tidb-configuration-file.md#ssl-cert))、密钥 ([`ssl-key`](/tidb-configuration-file.md#ssl-key)) 和 CA ([`ssl-ca`](/tidb-configuration-file.md#ssl-ca)) 的路径重新加证书、密钥和 CA,而无需重启 TiDB 实例。 + +新加载的证书密钥和 CA 将在语句执行成功后对新建立的连接生效,不会影响语句执行前已建立的连接。 \ No newline at end of file diff --git a/enable-tls-between-components.md b/enable-tls-between-components.md index 10267da9926b..0f9476d0a527 100644 --- a/enable-tls-between-components.md +++ b/enable-tls-between-components.md @@ -15,11 +15,11 @@ aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-components/'] 目前暂不支持只开启其中部分组件的加密传输。 -### 配置开启机密传输 +### 配置开启加密传输 1. 准备证书。 - 推荐为 TiDB、TiKV、PD 分别准备一个 server 证书,并保证可以相互验证,而它们的 Control 工具则可选择共用 client 证书。 + 推荐为 TiDB、TiKV、PD 分别准备一个 Server 证书,并保证可以相互验证,而它们的 Control 工具则可选择共用 Client 证书。 有多种工具可以生成自签名证书,如 `openssl`,`easy-rsa`,`cfssl`。 From 23041ed08884966e42109ce56d66c85f001f1c47 Mon Sep 17 00:00:00 2001 From: lysu Date: Mon, 25 May 2020 16:28:58 +0800 Subject: [PATCH 3/8] refine footer --- enable-tls-between-clients.md | 6 +++++- enable-tls-between-components.md | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/enable-tls-between-clients.md b/enable-tls-between-clients.md index bf88b6f095bb..adc2a0a04867 100644 --- a/enable-tls-between-clients.md +++ b/enable-tls-between-clients.md @@ -176,4 +176,8 @@ TiDB 支持的 TLS 版本及密钥交换协议和加密算法由 Golang 官方 在需要替换证书、密钥或 CA 时,可以在完成对应文件替换后,对运行中的 TiDB 实例执行 [`ALTER INSTANCE RELOAD TLS`](/sql-statements/sql-statement-alter-instance.md) 语句从原配置的证书 ([`ssl-cert`](/tidb-configuration-file.md#ssl-cert))、密钥 ([`ssl-key`](/tidb-configuration-file.md#ssl-key)) 和 CA ([`ssl-ca`](/tidb-configuration-file.md#ssl-ca)) 的路径重新加证书、密钥和 CA,而无需重启 TiDB 实例。 -新加载的证书密钥和 CA 将在语句执行成功后对新建立的连接生效,不会影响语句执行前已建立的连接。 \ No newline at end of file +新加载的证书密钥和 CA 将在语句执行成功后对新建立的连接生效,不会影响语句执行前已建立的连接。 + +### TiDB 集群内组件间加密传输 + +本文介绍的是 TiDB 服务端与客户端之间如何开启加密传输, 对于 TiDB 集群内组件的加密传输配置请参考[为 TiDB 组件间通信开启加密传输](/enable-tls-between-components.md)。 \ No newline at end of file diff --git a/enable-tls-between-components.md b/enable-tls-between-components.md index 0f9476d0a527..958a6063ddc8 100644 --- a/enable-tls-between-components.md +++ b/enable-tls-between-components.md @@ -133,8 +133,6 @@ aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-components/'] TiDB、PD 和 TiKV 和各种 Client 都会在每次新建相互通讯的连接时重新读取当前的证书和密钥文件内容,实现证书和密钥的重加载。目前暂不支持 CA 的重加载。 -### 客户端与 TiDB 间开启加密传输 +### TiDB 服务端与客户端加密传输 -本文介绍的是 TiDB 集群内各部组件如何开启加密传输, - -对于客户端应用与 TiDB 之间的加密传输配置请参考[为 TiDB 客户端服务端间通信开启加密传输](/enable-tls-between-clients.md),客户端应用与 TiDB 之间通讯可以使用与本文介绍的内部集群间通讯证书完全不同的另一套证书。 +本文介绍的是 TiDB 集群内各部组件如何开启加密传输, 对于 TiDB 服务端与客户端之间的加密传输配置请参考[为 TiDB 客户端服务端间通信开启加密传输](/enable-tls-between-clients.md),客户端应用与 TiDB 之间通讯可以使用与本文介绍的内部集群间通讯证书完全不同的另一套证书。 From 255d4db690af48b47bab50461ab477ca381da4f6 Mon Sep 17 00:00:00 2001 From: lysu Date: Mon, 25 May 2020 16:38:39 +0800 Subject: [PATCH 4/8] fix lint --- enable-tls-between-components.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/enable-tls-between-components.md b/enable-tls-between-components.md index 958a6063ddc8..34a8219ba9fc 100644 --- a/enable-tls-between-components.md +++ b/enable-tls-between-components.md @@ -8,10 +8,10 @@ aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-components/'] 本部分介绍如何为 TiDB 集群内各部组件间开启加密传输,一旦开启以下组件间均将使用加密传输: - - TiDB 与 TiKV、PD - - TiKV 与 PD - - TiDB Control 与 TiDB,TiKV Control 与 TiKV,PD Control 与 PD - - TiKV、PD、TiDB 各自集群内内部通讯 +- TiDB 与 TiKV、PD +- TiKV 与 PD +- TiDB Control 与 TiDB,TiKV Control 与 TiKV,PD Control 与 PD +- TiKV、PD、TiDB 各自集群内内部通讯 目前暂不支持只开启其中部分组件的加密传输。 From e0730c0e0ab17fc95510bdbf3c565844be3fba4e Mon Sep 17 00:00:00 2001 From: lysu Date: Mon, 25 May 2020 16:42:23 +0800 Subject: [PATCH 5/8] fix lint --- enable-tls-between-components.md | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/enable-tls-between-components.md b/enable-tls-between-components.md index 34a8219ba9fc..e33b3db0b917 100644 --- a/enable-tls-between-components.md +++ b/enable-tls-between-components.md @@ -97,37 +97,37 @@ aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-components/'] 如希望进行组件调用者身份认证,需要在生证书时通过 `Common Name` 标识证书使用者身份,并在被调用者配置检查证书 `Common Name` 列表来检查调用者身份。 - - TiDB +- TiDB - 在 `config` 文件或命令行参数中设置: + 在 `config` 文件或命令行参数中设置: - ```toml - [security] - cluster-verify-cn = [ - "TiDB-Server", - "TiKV-Control", - ] - ``` + ```toml + [security] + cluster-verify-cn = [ + "TiDB-Server", + "TiKV-Control", + ] + ``` - - TiKV +- TiKV - 在 `config` 文件或命令行参数中设置: + 在 `config` 文件或命令行参数中设置: - ```toml - [security] - cert-allowed-cn = [ - "TiDB-Server", "PD-Server", "TiKV-Control", "RawKvClient1", - ] - ``` + ```toml + [security] + cert-allowed-cn = [ + "TiDB-Server", "PD-Server", "TiKV-Control", "RawKvClient1", + ] + ``` - - PD +- PD - 在 `config` 文件或命令行参数中设置: + 在 `config` 文件或命令行参数中设置: - ```toml - [security] - cert-allowed-cn = ["TiKV-Server", "TiDB-Server", "PD-Control"] - ``` + ```toml + [security] + cert-allowed-cn = ["TiKV-Server", "TiDB-Server", "PD-Control"] + ``` ### 证书重加载 From 9416e5b90dbbdad5187d9c533e1890289acc7486 Mon Sep 17 00:00:00 2001 From: lysu Date: Tue, 26 May 2020 10:53:42 +0800 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- enable-encrypt-stored-data.md | 11 +++++------ enable-tls-between-clients.md | 4 ++-- enable-tls-between-components.md | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/enable-encrypt-stored-data.md b/enable-encrypt-stored-data.md index bc94bc426919..d71ee0bbdf7d 100644 --- a/enable-encrypt-stored-data.md +++ b/enable-encrypt-stored-data.md @@ -1,14 +1,13 @@ --- title: 为 TiDB 开启数据加密存储 category: how-to -aliases: ['/docs-cn/dev/how-to/secure/enable-encrypt-stored-data/'] --- -## 开启数据加密存储 +# 为 TiDB 开启数据加密存储 在 TiDB 集群中,用户的数据都存储在 TiKV 中,配置了 TiKV 数据加密存储功能,就代表 TiDB 集群已经加密存储了用户的数据。本部分主要介绍如何配置 TiKV 的加密存储功能。 -### 操作流程 +## 操作流程 1. 生成 token 文件。 @@ -22,7 +21,7 @@ aliases: ['/docs-cn/dev/how-to/secure/enable-encrypt-stored-data/'] > **注意:** > - > TiKV 只接受 hex 格式的 token 文件,文件的长度必须是 2^n,并且小于等于 1024。 + > TiKV 只接受 hex 格式的 token 文件,文件的长度必须是 2n,并且小于等于 1024。 2. 配置 TiKV。 @@ -34,9 +33,9 @@ aliases: ['/docs-cn/dev/how-to/secure/enable-encrypt-stored-data/'] > **注意:** > -> 若使用 [Lightning](/tidb-lightning/tidb-lightning-overview.md) 向集群导入数据,如果目标集群开启了加密功能,Lightning 生成的 sst 文件也必须是加密的格式。 +> 若使用 [TiDB Lightning](/tidb-lightning/tidb-lightning-overview.md) 向集群导入数据,如果目标集群开启了加密功能,Lightning 生成的 SST 文件也必须是加密的格式。 -### 使用限制 +## 使用限制 目前 TiKV 数据加密存储存在以下限制: diff --git a/enable-tls-between-clients.md b/enable-tls-between-clients.md index adc2a0a04867..46b6c8267c02 100644 --- a/enable-tls-between-clients.md +++ b/enable-tls-between-clients.md @@ -4,7 +4,7 @@ category: how-to aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-clients.md/'] --- -# 使用加密连接 +# 为 TiDB 客户端服务端间通信开启加密传输 TiDB 服务端与客户端之间默认采用非加密连接,因而具备监视信道流量能力的第三方可以知悉 TiDB 服务端与客户端之间发送和接受的数据,包括但不限于查询语句内容、查询结果等。若信道是不可信的,例如客户端是通过公网连接到 TiDB 服务端的,则非加密连接容易造成信息泄露,建议使用加密连接确保安全性。 @@ -180,4 +180,4 @@ TiDB 支持的 TLS 版本及密钥交换协议和加密算法由 Golang 官方 ### TiDB 集群内组件间加密传输 -本文介绍的是 TiDB 服务端与客户端之间如何开启加密传输, 对于 TiDB 集群内组件的加密传输配置请参考[为 TiDB 组件间通信开启加密传输](/enable-tls-between-components.md)。 \ No newline at end of file +本文介绍的是 TiDB 服务端与客户端之间如何开启加密传输, 对于 TiDB 集群内组件的加密传输配置请参考[为 TiDB 组件间通信开启加密传输](/enable-tls-between-components.md)。 diff --git a/enable-tls-between-components.md b/enable-tls-between-components.md index e33b3db0b917..1046e5e2d731 100644 --- a/enable-tls-between-components.md +++ b/enable-tls-between-components.md @@ -4,7 +4,7 @@ category: how-to aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-components/'] --- -## 支持使用加密传输的组件 +## 为 TiDB 组件间通信开启加密传输 本部分介绍如何为 TiDB 集群内各部组件间开启加密传输,一旦开启以下组件间均将使用加密传输: From 477a05aafd8a7d18885be05469dd57b0acdd04b6 Mon Sep 17 00:00:00 2001 From: lysu Date: Tue, 26 May 2020 10:55:26 +0800 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- enable-tls-between-clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enable-tls-between-clients.md b/enable-tls-between-clients.md index 46b6c8267c02..00d4475608f8 100644 --- a/enable-tls-between-clients.md +++ b/enable-tls-between-clients.md @@ -1,7 +1,7 @@ --- title: 为 TiDB 客户端服务端间通信开启加密传输 category: how-to -aliases: ['/docs-cn/dev/how-to/secure/enable-tls-between-clients.md/'] +aliases: ['/docs-cn/dev/how-to/secure/enable-tls-clients/','/docs-cn/dev/encrypted-connections-with-tls-protocols/'] --- # 为 TiDB 客户端服务端间通信开启加密传输 From 5e47c05a6256ea1619b2b8728b6e2b1692093ddd Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Tue, 26 May 2020 11:29:47 +0800 Subject: [PATCH 8/8] Update enable-encrypt-stored-data.md --- enable-encrypt-stored-data.md | 1 + 1 file changed, 1 insertion(+) diff --git a/enable-encrypt-stored-data.md b/enable-encrypt-stored-data.md index d71ee0bbdf7d..cbc8bd6b8b90 100644 --- a/enable-encrypt-stored-data.md +++ b/enable-encrypt-stored-data.md @@ -1,5 +1,6 @@ --- title: 为 TiDB 开启数据加密存储 +summary: 介绍如何为 TiDB 开启数据加密存储。 category: how-to ---