限制用户仅通过应用层进行数据操作,以实现多数据库解决方案
我正在开始开发一个新软件,该软件必须兼容 SQL Server(2005 及更高版本)、Oracle(10r2 及更高版本)和 Sybase(12.5 及更高版本)。我计划使用存储过程实现数据库抽象,因此我可以使用更具性能的代码来针对每种情况实现数据库特定的方法。我计划拒绝访问所有表信息,包括数据读取,并允许仅通过存储过程访问信息。问题是,当我授予将用于 INSERT 的存储过程的 EXECUTE 权限时,如果用户通过 SSMS 或 SQL Plus 连接到数据库,他将能够通过直接调用该过程来添加数据,我会喜欢阻止这种情况发生。我希望通过存储过程进行的数据操作只能通过我的应用程序执行。我可以为我的应用程序和用户提供单独的登录名,但我希望我的应用程序能够使用用户的凭据通过 NT 身份验证连接到数据库。有办法做到这一点吗?
有没有更好的方法来实现我想要实现的目标?
谢谢
I'm starting the development of a new software that must be compliant to SQL Server (2005 and above), Oracle (10r2 and above) and Sybase (12.5 and above). I'm planning on implementing the database abstraction using stored procedures, so I can use more performatic code implementing database specific approaches for each case. I plan to deny access to all table information, including data read, and allow access to information only through stored procedures. The problem is that when I grant the EXECUTE permission on a Stored Procedure that will be used to INSERT, if the user connects to the database through SSMS or SQL Plus, he will be able to add data by calling the procedure directly, and I would like to prevent that. I would like that the data manipulation through stored procedures be executed only through my application. I could give separate logins for my application and the users, but I want to have the possibility of my application connecting to the database through NT authentication, using the user's credential. Is there a way to do this?
Is there a better way to achieve what I'm trying to achieve?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在应用程序中嵌入 UUID,并让存储过程在将数据写入数据库之前需要它。
You could embed a UUID in your application and have the stored procedure require it before it will write data into the DB.