保护 SQL 查询的安全,确保没有人知道该密码

发布于 2024-10-26 03:50:22 字数 149 浏览 8 评论 0原文

有哪些有效且安全的方法来保护 SQL 查询?

简而言之,我想确保程序员不会看到应用程序用于执行查询的密码。我想到了 RSA 或 PGP 之类的东西,但不知道如何实现更改密码而不在应用程序中的某个地方进行编码。

我们的环境是典型的Linux/MySQL。

What are some effective and secure methods of securing SQL queries?

In short I would like to insure that programmers do not see the passwords used by the application to perform queries. Something like RSA or PGP comes to mind, but don't know how one can implement a changing password without being encoded in the application somewhere.

Our environment is a typical Linux/MySQL.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

莫相离 2024-11-02 03:50:22

这可能更多的是流程问题,而不是编码问题。

软件开发过程中,需要严格区分实施过程和上线过程。包含密码的配置文件必须在转出期间(而不是之前)填充真实密码。程序员可以使用开发环境的密码,并且部署团队会在应用程序完成后更改这些密码。这样,真正的密码就永远不会泄露给应用程序编码人员。

如果无法确保程序员无法访问实时系统,则需要对配置文件进行加密。执行此操作的最佳方法取决于编程语言。我目前正在开发一个 Java 应用程序,该应用程序使用 ESAPI 中的适当函数来加密 .properties 文件项目,我可以推荐它。如果您使用其他语言,则必须找到等效的机制。

每当您想要更改密码时,管理员都会生成一个新文件并对其进行加密,然后再将该文件复制到服务器。

如果您想要最大程度的安全性并且不想存储密钥来解密系统上的配置,管理员可以在系统重新启动时提供该密钥。但这可能会让事情变得太过分,具体取决于您的需求。

This might be more of a process issue and less of a coding issue.

You need to strictly separate the implementation process and the roll-out process during software development. The configuration files containing the passwords must be filled with the real passwords during roll-out, not before. The programmers can work with the password for the developing environment and the roll-out team changes those passwords once the application is complete. That way the real passwords are never disclosed to the people coding the application.

If you cannot ensure that programmers do not get access to the live system, you need to encrypt the configuration files. The best way to do this depends on the programming language. I am currently working on a Java application that encrypts the .properties files with the appropriate functions from the ESAPI project and I can recommend that. If you are using other languages, you have to find equivalent mechanisms.

Any time you want to change passwords, an administrator generates a new file and encrypts it, before copying the file to the server.

In case you want maximum security and do not want to store the key to decrypt the configuration on your system, an administrator can supply it whenever the system reboots. But this might take things too far, depending on your needs.

梦中楼上月下 2024-11-02 03:50:22

如果程序员无权访问包含登录凭据的配置文件,并且无法通过调试或 JMX 接口访问它们,那么这应该可行。当然,这会带来其他问题,但这可能会满足您的要求。 (我不是合格的安全评估员 - 因此请咨询您的安全评估员,以确保符合 PCI 合规性。)

If programmers don't have access to the configuration files that contain the login credentials and can't get to them through the debug or JMX interfaces then that should work. Of course that introduces other problems but that would potentially satisfy your requirement. (I am not a Qualified Security Assessor - so check with yours to be sure for PCI compliance.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文