Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

DM uses a hard-coded encryption key #659

Closed
sokada1221 opened this issue May 13, 2020 · 2 comments
Closed

DM uses a hard-coded encryption key #659

sokada1221 opened this issue May 13, 2020 · 2 comments

Comments

@sokada1221
Copy link

sokada1221 commented May 13, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.

Used DM for a database migration, and noticed that it performs encryption without configuring any key. For example,

/ # ./dmctl -encrypt 123456
dezL/wb4mC5ymD0M+5Jy5ECTLCjSfjw=

I had a bad feeling about this, and took a quick look into the encryption code.
AES-CFB-256 is used with a random IV in pkg/encrypt/encrypt.go - this is good.
But the same publicly available key is always used, which defeats the whole point of encryption.

  1. What did you expect to see?

A way to configure encryption key. SetSecretKey function is available but not accessible as a feature.

  1. What did you see instead?

Hard-coded key in pkg/encrypt/encrypt.go

  1. Versions of the cluster

    • DM version (run dmctl -V or dm-worker -V or dm-master -V):

      / # ./dmctl -V
      Release Version: v1.0.5
      Git Commit Hash: a8e9f53f91e29756b09a22cdc37a6a6efcdfe55b
      Git Branch: release-1.0
      UTC Build Time: 2020-04-27 06:56:31
      Go Version: go version go1.13 linux/amd64
      
    • Upstream MySQL/MariaDB server version:

      N/A
      
    • Downstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

      N/A
      
    • How did you deploy DM: DM-Ansible or manually?

      DM-Ansible
      
    • Other interesting information (system version, hardware config, etc):

  2. current status of DM cluster (execute query-status in dmctl)

N/A

  1. Operation logs

N/A

  1. Configuration of the cluster and the task

N/A

  1. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus for DM if possible

N/A

@csuzhangxc
Copy link
Member

@shinnosuke-okada We plan to support (and recommend) plaintext in #633.

"A way to configure encryption key" seems not easy to use.

@csuzhangxc
Copy link
Member

we already support plaintext from v1.0.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants