-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Open
Labels
component/dumplingThis is related to Dumpling of TiDB.This is related to Dumpling of TiDB.component/lightningThis issue is related to Lightning of TiDB.This issue is related to Lightning of TiDB.sig/migratetype/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Feature Request
Is your feature request related to a problem? Please describe:
Currently the MySQL password is stored as plain-text in the config.toml, which some users feel uncomfortable with.
Describe the feature you'd like:
Provide some way to hide the password. Example:
# the current situation.
[tidb]
password = "Passw0rd!!"
# same as above, only base-64 encoded
[tidb]
password = { base64 = "UGFzc3cwcmQhIQ==" }
# same as above (using TOML's dotted-key feature)
[tidb]
password.base64 = "UGFzc3cwcmQhIQ=="
# read from a file
[tidb]
password.file = "/data/secret/lightning.txt"
# read from environment
[tidb]
password.env = "TIDB_PASSWORD"
# read from file, cached in memory, so the file can be deleted after Lightning starts
# (without caching Lightning will fetch the password from the file in case of reconnect)
[tidb]
password.cached.file = "/data/secret/lightning.txt"
# encrypted using AES-256-CTR, key read from a local file in raw binary.
[tidb]
password.aes-256-ctr = { data.base64 = "zdpUpVhoJoggKw==", key.file = "/data/secret/lightning-key.bin", nonce.base64 = "XN74TC92g2MBNbzEPpxZUA==" }
# (same as above)
[tidb.password.aes-256-ctr]
data.base64 = "zdpUpVhoJoggKw=="
key.file = "/data/secret/lightning-key.bin"
nonce.base64 = "XN74TC92g2MBNbzEPpxZUA=="
# (also same as above)
[tidb]
password.aes-256-ctr.data.base64 = "zdpUpVhoJoggKw=="
password.aes-256-ctr.key.file = "/data/secret/lightning-key.bin"
password.aes-256-ctr.nonce.base64 = "XN74TC92g2MBNbzEPpxZUA=="
# can also read the encrypted password from a binary file.
[tidb]
password.aes-256-ctr = { data.file = "/data/secret/lightning.enc", key.file = "/data/secret/lightning-key.bin", nonce.base64 = "XN74TC92g2MBNbzEPpxZUA==" }The password will always be decrypted in the Lightning process no matter which algorithm is chosen, since the MySQL protocol demands the original password for authentication.
Describe alternatives you've considered:
Don't do it. Rely on Lightning-in-SQL.
Teachability, Documentation, Adoption, Optimization:
Metadata
Metadata
Assignees
Labels
component/dumplingThis is related to Dumpling of TiDB.This is related to Dumpling of TiDB.component/lightningThis issue is related to Lightning of TiDB.This issue is related to Lightning of TiDB.sig/migratetype/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.