存储数据库密码的最佳实践 [英] Best practice for storing database password

查看:144
本文介绍了存储数据库密码的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将访问数据库的自定义服务器应用程序。我需要决定将凭据(和地址)存储到该服务器的位置。

I am developing a custom server application that will access a database. I need to decide where I will store the credentials (and to address) to that server.

一种常见的解决方案是将凭证放在配置文件中。但是,我不希望受感染的服务器意味着黑客可以访问数据库(托管在单独的服务器上)。

A common solution is to put the credential in a config file. However, I do not want a compromised server to mean that the hacker has access to the DB (which is hosted on a separate server).

我可以存储凭据环境,但这只是通过默默无闻的安全。 Evil先生可以在环境中找到它。

I could store the credentials in the environment, but that is just security through obscurity. Mr. Evil can just look in the environment to find it.

有人建议加密。但是,如果我将密钥存储在可执行文件中,快速解编译(我们使用的是Java),我仍然注定失败。

Someone suggested encryption. However, if I store the key in the executable, a quick de-compile (we are using Java) and I am still doomed.

我还想避免每次启动服务器时都输入一个释义。

I also want to avoid having to enter a paraphrase every time I start the server.

有什么建议吗?我觉得我错过了一些简单的东西。

Any suggestions? I feel like I'm missing something simple.

谢谢

推荐答案

我不认为你错过了一些简单的事情。有问题的服务器可以在没有您帮助的情况下连接到数据库,在这种情况下, 拥有凭据;或者在没有供应的情况下无法连接。您可以采取各种步骤,例如您列出的步骤,使受攻击的服务器更难以显示数据库的凭据,但在一天结束时,是否必须拥有这些凭据并将它们提供给数据库服务器进行连接,它们必须存储在某个地方 —或者至少,它必须有一些获取它们的方法,因此在这个意义上是可以破解的。

I don't think you're missing something simple. Either the server in question can connect to the database without your help, in which case it has to have the credentials; or it cannot connect without your supplying them. You can take various steps like the ones you've listed to make it harder for a compromised server to reveal the credentials to the database, but at the end of the day, if it has to have those credentials and supply them to the DB server to connect, they'll have to be stored on it somewhere — or at least, it will have to have some means of getting them, and so will be hackable in that sense.

你最好的选择是专注于发现入侵(受损服务器)尽快,保持良好的异地,离线备份,最坏的情况,首先为入侵设置许多障碍,等等。

Your best bet is to focus on finding out about intrusions (compromised servers) as quickly as possible, keeping good off-site, off-line backups for the worst case, putting up lots of barriers to intrusion in the first place, etc.

这篇关于存储数据库密码的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆