Skip to content

Commit

Permalink
add back tiflash sm4 encryption support (pingcap#11802)
Browse files Browse the repository at this point in the history
* Revert "remove tiflash sm4 encryption support (pingcap#11387)"

* small fix for sm4 support version

* Update encryption-at-rest.md

Co-authored-by: xixirangrang <hfxsd@hotmail.com>

* update tiflash-learner.toml

* add more desc

* Update tiflash-configuration.md

Co-authored-by: xixirangrang <hfxsd@hotmail.com>
Co-authored-by: Ran <huangran@pingcap.com>
  • Loading branch information
3 people authored Nov 7, 2022
1 parent cb429f0 commit d540448
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion encryption-at-rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ SM4 加密只在 v6.3.0 及之后版本的 TiKV 上支持。v6.3.0 之前的 TiK

### TiFlash

TiFlash 支持静态加密。数据密钥由 TiFlash 生成。TiFlash(包括 TiFlash Proxy)写入的所有文件,包括数据文件、Schema 文件、临时文件等,均由当前数据密钥加密。TiFlash 目前只支持在 CTR 模式下使用 AES 对数据文件进行透明加密,暂时不支持 SM4 加密算法。相关的加密配置项(在 [`tiflash-learner.toml`](/tiflash/tiflash-configuration.md#配置文件-tiflash-learnertoml) 中)和监控项含义均与 TiKV 一致。
TiFlash 支持静态加密。数据密钥由 TiFlash 生成。TiFlash(包括 TiFlash Proxy)写入的所有文件,包括数据文件、Schema 文件、临时文件等,均由当前数据密钥加密。TiFlash 支持的加密算法、加密配置方法(配置项在 [`tiflash-learner.toml`](/tiflash/tiflash-configuration.md#配置文件-tiflash-learnertoml) 中)和监控项含义等均与 TiKV 一致。

如果 TiFlash 中部署了 Grafana 组件,可以查看 **TiFlash-Proxy-Details** -> **Encryption**

SM4 加密只在 v6.4.0 及之后版本的 TiFlash 上支持。v6.4.0 之前的 TiFlash 仅支持 AES 加密。

### PD

PD 的静态加密为实验特性,其配置方式与 TiKV 相同。
Expand Down
14 changes: 14 additions & 0 deletions tiflash/tiflash-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@ delta_index_cache_size = 0
## 若开启该选项,日志中的用户数据会以 `?` 代替显示
## 默认值为 false
redact-info-log = false

[security.encryption]
## 数据文件的加密方法。
## 可选值为 "aes128-ctr"、"aes192-ctr"、"aes256-ctr"、"sm4-ctr" (仅 v6.4.0 及之后版本) 和 "plaintext"。
## 默认值为 "plaintext",即默认不开启加密功能。选择 "plaintext" 以外的值则表示启用加密功能。此时必须指定主密钥。
data-encryption-method = "aes128-ctr"
## 轮换密钥的频率,默认值:`7d`。
data-key-rotation-period = "168h" # 7 days

[security.encryption.master-key]
## 指定启用加密时的主密钥。若要了解如何配置主密钥,可以参考《静态加密 - 配置加密》:https://docs.pingcap.com/zh/tidb/dev/encryption-at-rest#配置加密

[security.encryption.previous-master-key]
## 指定轮换新主密钥时的旧主密钥。旧主密钥的配置格式与主密钥相同。若要了解如何配置主密钥,可以参考《静态加密 - 配置加密》:https://docs.pingcap.com/zh/tidb/dev/encryption-at-rest#配置加密
```

除以上几项外,其余功能参数和 TiKV 的配置相同。需要注意的是:`key``engine``label` 是保留项,不可手动配置。
Expand Down

0 comments on commit d540448

Please sign in to comment.