当使用 Jaspyt 加密 Spring 属性文件时,环境变量真的是存储主密码的安全位置吗?
我在我的 Java 项目中使用 Jaspyt 和 Spring 3。我当前将数据库连接属性存储在属性文件中。用户名和密码是纯文本,因此我一直在考虑使用 Jaspyt 的 EncryptablePropertyPlaceholderConfigurer。
文档和教程建议将用于解密的主密码存储在环境变量中。这真的比在属性文件中存储纯文本值更安全吗?如果有人破坏了盒子,主密码是否不会在(1)环境变量或(2)服务器启动脚本中可见?我想您可以手动设置环境变量并在服务器启动后取消设置,但手动过程似乎难以管理。
我只是偏执吗?您是否使用过一种方法来保护您的连接用户名和密码?
I'm using Jaspyt and Spring 3 in my Java project. I currently store the database connection properties in a properties file. The user name and password are plain text, so I've been looking at using Jaspyt's EncryptablePropertyPlaceholderConfigurer.
The documentation and tutorials suggest storing the master password used for decryption in an environment variable. Is that really any more secure than storing plain text values in the properties file? If someone compromises the box, wouldn't the master password be either visible in (1) the environment variables or (2) the server start-up script? I suppose you could manually set the environment variable and unset it after server start-up, but the manual process of that seems unmanageable.
Am I just being paranoid? Is there an approach that you've used to secure your connection user names and passwords?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
存储明文密码从来都不是一个安全的过程。接管服务器的攻击者在任何情况下都可以访问您的密码。
如果无法手动输入(像往常一样),您只能为团队的一部分隐藏密码。如果您不想泄露数据库密码,请使用 JNDI 数据库连接。这使得密码仅对应用程序服务器管理员可见。
Storeing clear text passwords is never a safe procedure. An attacker who takes over the server has access to your passwords in all cases.
If manual entry is not an option (as usual) you can only hide the password only for a part of your team. If you not want to disclose the database passwords, use a JNDI database connection. This makes the passwords only visible to the application server administrators.