通过拒绝视图定义来保护存储过程 [英] protect stored procedure by deny view definition

查看:26
本文介绍了通过拒绝视图定义来保护存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否足以保护存储过程代码,如果用户有拒绝查看任何数据库拒绝查看任何定义?

Is it enough for protecting stored procedure code if user has DENY VIEW ANY DATABASE DENY VIEW ANY DEFINITION?

用户仅被授予 execute sp.他是否有可能追踪或以某种方式看到代码?我无法使用探查器在该登录名下进行连接,但也许还有其他可用的方法.

User is granted execute sp only. Is it possible for him to trace or somehow see the code? I could not connect under that login with profiler but maybe some other ways available.

推荐答案

不清楚您的目标是什么:您是否试图保护知识产权?防止用户看到源代码中的敏感信息(例如密码);阻止用户自己更改程序或其他什么?您的用户是您自己公司的内部用户还是外部客户?他们托管数据库和应用程序还是你托管?

It's not clear what your goal is: are you trying to protect intellectual property; prevent users from seeing sensitive information in source code (e.g. passwords); prevent users from ALTERing the procedures themselves, or something else? Are your users internal users in your own company or are they external customers? Do they host the database and the application or do you?

为了保护知识产权:

  • 您的用户(客户?)是否签署了 NDA 或合同,其中规定了您的条款和条件,并包括对披露您的知识产权的处罚
  • 将敏感信息移动到您托管的服务中并作为网络服务公开

为了防止用户看到源代码:

To prevent users seeing the source code:

  • CREATE PROCEDURE WITH ENCRYPTION - 这只会阻止普通"用户看到代码,它不会阻止具有系统管理员权限的确定用户
  • 在 .NET 中编写 CLR 过程而不是使用 TSQL
  • 将敏感信息移至已编译的客户端应用程序中
  • 将敏感信息移动到您托管的服务中并作为网络服务公开

防止用户修改程序:

  • 不要给他们必要的权限

最终,具有系统管理员权限的坚定用户将始终进行逆向工程、调试、反编译或以其他方式揭示代码中的逻辑.因此,您需要非常清楚您正在尝试预防什么、对您或您的公司有什么潜在影响,以及您愿意投入多少时间和金钱来预防.

In the end, a determined user with sysadmin permissions will always reverse-engineer, debug, decompile or otherwise uncover the logic in your code. So you need to be very clear about exactly what you're trying to prevent, what the potential impact is on you or your company, and how much time and money you're willing to invest in preventing it.

这篇关于通过拒绝视图定义来保护存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆