甚至阻止超级管理员/dba 删除/更新表?
我需要确保一些关键任务表永远不会被删除或编辑。唯一可能的操作是从中读取数据,并且 dba 可以添加更多行。就是这样。
现在为了增加安全性,我想阻止甚至 dba 都能够删除/更改记录,所以基本上没有人可以删除或更改记录,也没有超级管理员。这些表对于跟踪某些类型用户的活动至关重要,我需要无限期保留这些用户的数据,其中一些是关键的查找表。因此,系统锁定值和用户跟踪值的混合。
想法是,如果有人想要销毁他们需要杀死该数据库的数据。有办法做到这一点吗?
There are some mission critical tables which i need to ensure never get deleted or edited. only possible action is to read from it and the dba can add more rows. That's it.
Now for added security i want to prevent even the dba from being able to delete/alter the records, so basically no one can ever delete or alter a record, no super admin also. These tables are critical for activity tracking of certain type of users who's data i need to preserve indefinitely and some are critical lookup tables. So a mixture of system locked values and user tracked values.
Idea is if someone wants to destroy the data they need to kill that database. Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,不可能,超级用户始终控制着数据库。您可以撤销更新和删除权限,但超级用户始终可以再次向自己授予这些权限。
No, not possible, the superuser is always in control of the database. You could REVOKE update and delete permissions, but a superuser can always GRANT these permissions to himself again.
您无法阻止超级用户执行某些操作。您唯一能做的就是防止任何用户意外删除或更新记录。这可以通过创建更新和删除规则来实现。
请参阅此链接以供参考。
There is no way you can prevent a superuser to do something. The only thing you can do is prevent ANY user from ACCIDENTALLY deleting or updating the records. This can be achieved by creating rule on update and on delete.
See this link for reference.
对于MySQL,可以采取以下方法。
一旦您拥有了应用程序帐户,请删除超级用户帐户(实际上,任何“WITH GRANT OPTION”帐户)。系统管理员帐户应仅具有停止和启动系统的权限,但无权读取敏感表。
接下来,更改表以使其使用 MEMORY 引擎。这意味着应用程序管理员(而不是 DBA)将需要在数据库重新启动时恢复内容。这也意味着 DBA 无法使用“skip-grants”选项重新启动数据库来访问数据 - 因为数据将在重新启动期间消失。 (但是,系统的根用户始终可以转储系统内存并在其中找到您的数据。)
更好的方法是使用只有应用程序管理员知道的密钥来加密应用程序中的数据。
For MySQL, the following approach can be taken.
Once you have your application accounts in place, drop the superuser account (really, any account "WITH GRANT OPTION"). The system admin accounts should only have permission to stop and start the system, but not to read from your sensitive table.
Next, alter your table so that it uses the MEMORY engine. This means that the application administrator (not the DBA) will need to restore the contents whenever the database is restarted. It also means that the DBA cannot restart the database with the "skip-grants" option to gain access to the data - because the data will evaporate during the restart. (However, the system's root user can always dump the system memory and find your data in that.)
A better approach is to encrypt your data in the application with a key only known by the application administrator.