混淆数据库表名
我们即将进行一个项目,我们将处理高度敏感的数据。除了加密数据之外,我还在考虑混淆表名。
例如,tEmployees
将变为 t58633B7A
。添加这个有用吗?毕竟,这是关于构建安全/预防层。
PS 我们将把混淆的表名映射到数据访问层中的真实姓名
We're about to undergo a project where we'll be handling highly sensitive data. Apart from encrypting the data I was thinking about obfuscating the table names.
So tEmployees
would become t58633B7A
for example. Would this be a useful to add? after all it's about building layers of security/prevention.
P.S. We'll map the obfuscated table names to the real names in our Data Access Layer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
尝试使用PowerDesigner设计数据库。当您设计表(物理数据模型,PDM)时,有列名称和列代码。输入具有可读字段名称的列名称,但对于列代码,输入不可读的字段名称。
例如,创建带有列的 EMPLOYEE(隐藏在 table_1 中):
同时在 SQLServer 中照常创建表(您可以从生成数据库菜单中获取脚本)
并创建视图
子句WITH ENCRYPTION防止用户偷看sql语句来组成视图。
在应用程序代码中使用视图 EMPLOYEE 而不是 table_1
示例:
并将其与数据加密结合起来(请参阅:http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetry-key -加密教程与脚本/)
当然使用这种技术,用户仍然可以从视图中访问表,但是用户无法获取表与主键和外键的相互关系,视图没有关系信息。
但是,如果您根本不使用视图来完全混淆此过程,则必须使用从 PDM 收集的表信息进行编码。
希望能帮到你。由于我和你有同样的问题,当数据库使用管理帐户连接到计算机时,数据库会暴露给用户。
Try to design database with PowerDesigner. When you design table (Physical Data Model, PDM) there are column name and column code. Enter the column name with Readable field name but for the column code enter with unreadable field name.
For example to create EMPLOYEE (obscured to table_1) with columns :
Meanwhile in SQLServer create table as usual (you can get the script from Generate Database Menu)
and create view
the clause WITH ENCRYPTION prevent user from peek the sql statement to make up the view.
In the application code use view EMPLOYEE instead of table_1
Example :
and combine it with data encryption (see : http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/)
Of course with this technique, the user still can guest table from the view, but the user can't get the table inter relationship with Primary key and foreign key, the view doesn't have the relational information.
But if you completely obfuscate this process do not using view at all, you must code with table information gathered from PDM.
Hope that can help you. Since i have the same problem with you, when database attached to the machine with administrative account, the database is exposed to the user.
这似乎完全是多余的。如果攻击者获得了对数据库的访问权限,那么从总体上看,仅仅不知道表名就几乎没有什么保护作用。如果有的话,您应该花时间在更好的入侵检测和保护机制上。
This seems entirely superfluous. If an attacker has gained access to the database, then simply not knowing the table name is little protection in the grand scheme of things. You should spend your time, if anything, on better intrusion detection and protection mechanisms.
尽管您会一遍又一遍地听到“通过默默无闻实现安全性”很糟糕,但它确实有助于提高攻击的门槛,只要您记住这不是一个解决方案。
对于您的具体情况,我想说,维护、调试、故障排除数据库的成本将超过少量感知安全性带来的好处。
Although you will hear over and over again that security through obscurity is bad, it does help raise the bar to attack, so long as you keep in mind that it is not a solution.
For your particular case, I would say that the cost of maintaining, debugging, troubleshooting your database will outweigh the benefits from the tiny amount of perceived security.
完全是浪费时间。
嗯,不是真的……它确实有在面试时吓跑真正人才的特点,并且可能会让你在 TheDailyWTF 上被提及。
What a complete waste of time.
Well, not really..... it does have the feature of scaring away actual talent during interviews, and might get you a mention on TheDailyWTF.
我想说这可能是浪费时间。如果有人能够破解你的程序,足以访问你的数据库,那么你就完蛋了,这个黑客会立刻找出你愚蠢的混淆方案。
I would say it's probably a waste of time. If someone can hack your program enough that is has access to your database, then your screwed anyway and this hacker will figure out your silly obfuscation scheme in a heartbeat.