【发布时间】:2014-03-11 22:43:42
【问题描述】:
我绝对是 Symfony 的菜鸟,目前我正处于学习曲线的上坡路,但我仍在努力前进 - 我们都曾在某个时候到达过那里。
我在设计我的应用程序时阅读了一些资源,其中之一是信息安全中的最小权限原则:
In information security, computer science, and other fields, the principle of least privilege, also known as the principle of minimal privilege or just least privilege, requires that in a particular abstraction layer of a computing environment, every module (such as a process, a user or a program on the basis of the layer we are considering) must be able to access only such information and resources that are necessary to its legitimate purpose.
考虑到这一点,我决定需要 3 个不同的数据库用户来访问我的数据库:
- 只读
- 易失性 - 插入、更新、删除
- 管理员 - 锁定、备份、更改
在我看来,对于 Symfony,它的设计考虑了单个数据库用户,虽然它看起来是 possible to use multiple users/connections,但似乎也不建议将其作为标准做法:
Using multiple entity managers is pretty easy, but more advanced and not usually required. Be sure you actually need multiple entity managers before adding in this layer of complexity.
那么我的问题是:
- 我是否让事情变得更复杂?
- 使用单个数据库用户是否会降低 Symfony 的安全性?
- 我的文章是否链接到了在 Symfony 中实现最小权限原则的正确方法?
【问题讨论】:
标签: symfony doctrine-orm