如何保护 SQL Server 存储过程

发布于 01-07 06:20 字数 114 浏览 4 评论 0原文

我们有一个应用程序依赖于一些非常有趣且复杂的 MS SQL 存储过程。现在我们希望在共享环境中将数据库与这些过程一起使用。有没有一种方法可以保护/加密/无论如何,以便服务器管理员无法读取(复制)这些存储过程的内容?

We have an application that relies on some pretty interesting and complex MS SQL stored procedures. Now we want to use the database with those procedures in a shared environment. Is there a way to secure/encrypt/whatever so that the contents of those stored procs cannot be read (copied) by the server administrator?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

内心荒芜2025-01-14 06:20:15

不,系统管理员始终可以获得存储过程的文本。

No, a sysadmin can always get the text of a stored procedure.

冷月断魂刀2025-01-14 06:20:15

您可以创建一个带有加密的过程,但这只能保护您免遭随意窥探(严格意义上来说,这并不是真正的加密,更像是混淆),因为网上有很多资源可以向您展示如何解密。

如果您有重要的业务逻辑,请将其放入 CLR 中。这将保护你免受一些窥探,但坚定的人仍然会找到一种方法来反编译你的东西。

You can create a procedure WITH ENCRYPTION but this only protects you from casual prying (it's not really encryption in the strictest sense, more like obfuscation), since there are many resources online that will show you how to decrypt.

If you have important business logic, put it into CLR. That will protect you from some of the prying, but a determined person will still find a way to decompile your stuff.

岛歌少女2025-01-14 06:20:15

您可以使用WITH ENCRYPTION 子句来混淆文本,但这不是真正的加密。您也可以采用本质上调用 DLL 的 CLR 路线,但我认为这可能会对性能产生影响。

我认为您不应该向任何您不信任的人授予 sa 访问权限来查看存储过程代码,如果您的代码确实如此绝密,我想知道为什么您首先要使用共享托管环境?

如果您无法退出共享环境,至少尝试获取只有您有权访问的自己的实例。

You can obfuscate the text with the WITH ENCRYPTION clause but this isn't true encryption. You could also go the CLR route which essentially calls a DLL but I think this could have performance implications.

I dont think you should give sa access to anyone you don't trust enough to view stored procedure code, and if your code is really so top-secret I wonder why you're even using a shared hosting environment in the first place?

If you can't get out of the shared environment, at least try and get your own instance which only you have sa access to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文