alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.29k stars 12.84k forks source link

Database connections supports password encryption #3327

Closed David-wu91 closed 4 years ago

David-wu91 commented 4 years ago

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

发布生产环境数据库用户要求不能配置明文,是否支持数据库链接配置密文 db.url.0=jdbc:mysql://localhost:3320/config?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true db.user=root db.password=mFis1RWHgO0XnWoRkGft+(密文)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

KomachiSion commented 4 years ago

Have you test use encrypt password? Nacos use HikariCP as Connection pool, I remember that HikariCP can directly use encrypt password.

David-wu91 commented 4 years ago

我尝试使用了jasypt-spring-boot加密,是可行的。对于springboot来说这套方案可能更加完善,后续是否可以考虑将该包加入到正式版本呢?

KomachiSion commented 4 years ago

可能需要更深入的思考下,如果jdbc本身不支持密文密码,那么nacos去做解密其实也是不合适的。因为根本不知道用户用的是什么加密方式,如果有必要的话,也是通过插件的形式,让用户自己添加。