如何确保MySQL数据库的安全性? [英] How do I keep a mySQL database secure?

查看:554
本文介绍了如何确保MySQL数据库的安全性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将实现PHP/mySQL设置来存储信用卡信息.

I'm going to be implementing a PHP/mySQL setup to store credit card information.

AES_ENCRYPT/AES_DECRYPT似乎是解决之道,

但我仍然对以下几点感到困惑:

如何确保加密密钥的安全性?

将其硬编码到我的PHP脚本中(该脚本将与db驻留在同一服务器上)似乎是一个主要的安全漏洞.

Hardwiring it into my PHP scripts (which will live on the same server as the db) seems like a major security hole.

这里的最佳实践"解决方案是什么?

推荐答案

您应该认真考虑一下是否真的需要保留CC#.如果您没有充分的理由,那就不要!每隔一周,您会听到一些公司受到威胁,并且CC#被盗.所有这些公司都犯了致命的缺陷-他们保留了太多的信息.保留CC#,直到交易清除.之后,将其删除.

You should think long and hard about whether you REALLY need to keep the CC#. If you don't have a great reason, DON'T! Every other week you hear about some company being compromised and CC#'s being stolen. All these companies made a fatal flaw - they kept too much information. Keep the CC# until the transaction clears. After that, delete it.

就保护服务器而言,最好的做法是保护硬件并使用MySQL的内部系统套接字,并确保阻止对MySQL服务器的任何网络访问.确保同时使用系统权限和MySQL权限,以根据需要进行尽可能少的访问.对于某些脚本,您可以考虑只写身份验证.确实没有一种万无一失的加密方法(因为您将始终需要解密,因此必须存储密钥).这并不是说您不应该-可以将密钥存储在一个位置,并且如果您发现系统受到破坏,则可以破坏文件并使数据无用.

As far as securing the server, the best course of action is to secure the hardware and use the internal system socket to MySQL, and make sure to block any network access to the MySQL server. Make sure you're using both your system permissions and the MySQL permissions to allow as little access as needed. For some scripts, you might consider write-only authentication. There's really no encryption method that will be foolproof (as you will always need to decrypt, and thus must store the key). This is not to say you shouldn't - you can store your key in one location and if you detect system compromise you can destroy the file and render the data useless.

这篇关于如何确保MySQL数据库的安全性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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