- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在 MSDN 文档中,SecurityPermissionFlag.SkipVerification说:
Ability to skip verification of code in this assembly. Code that is unverifiable can be run if this permission is granted.
This is a powerful permission that should be granted only to highly trusted code.
This flag has no effect when used dynamically with stack modifiers such as Deny, Assert, and PermitOnly.
我目前正在开发的一些项目要求我使用 SkipVerificationFlag
。具体案例是一些自定义类使用 CaSTLe Windsor 创建控制反转组件的实例,因为调用整个方法的程序集不是完全可信的。
这可能是c#中的伪代码对于带有 SkipVerification
的方法:
[SecuritySafeCritical]
[ReflectionPermission(SecurityAction.Assert, Unrestricted = true)]
[SecurityPermission(SecurityAction.Assert, SkipVerification = true)]
public override TComponent Resolve<TComponent>(string id = null, bool release = true, object argumentsAsAnonymousObject = null)
{
// Some stuff...
windsorContainer.Resolve<TComponent>(...);
}
CaSTLe Windsor 程序集在 AppDomain
中完全受信任。
如果我认为我只相信 CaSTLe Windsor 代码而仅此而已,那我错了吗?
上述伪代码的消费者/调用者处于不受信任(非完全信任)AppDomain
中。或者换句话说:使用该门的第三方代码是安全透明的。
在我看来,由于温莎城堡不会做危险的事情,因此使用整面旗帜是安全的。
我的决定在安全方面的坏后果是什么?
谢谢。
最佳答案
据我所知,根据可用信息,断言 SkipValidation
似乎没有其他后果。
如果您可以完全依赖在关键部分内执行的代码,它可以被视为安全代码,因此 CaSTLe Windsor(或任何其他受信任的代码)没有问题。
关于c# - SecurityPermission 和 SecurityPermissionFlag.SkipVerification 的后果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15120670/
在编译iPhone应用程序时,有一个针对“优化”架构(仅限armv7)与标准armv6/armv7架构的设置。 编译纯armv7架构有什么好处/后果? 最佳答案 除非您的程序需要 OpenGLES 2
例如我有这段代码: Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try
使用子域在 Wordpress 或 Blogger 上托管博客是否有任何 SEO 劣势?我不想为自己的站点创建博客模块而费心——我宁愿只设置一个 CNAME 条目并将子域指向一个免费的 Wordpre
我们使用免费 API 制作简单的 501C3 map 。通常我们的地理编码使用率很低,但我们所做的更改 [oops] 触发了所有 >2500 条记录的重新请求。 我们可以等待 24 小时“超时”。 我
我在 Heroku 上有一个 Web 应用程序,它一直使用大约 300% 的允许 RAM (512 MB)。我看到我的日志充满了错误 R14(超出内存配额)[每秒一个条目]。尽管状况不佳,我的应用程序
我在我的应用程序中以 FileChannel.MapMode.READ_WRITE 模式创建/使用内存映射文件。这些文件在应用程序的整个生命周期中创建和删除。 由于 GC 不一定释放直接缓冲区以_取消
增加最大连接数有什么害处?即使使用当前设置和复制设置,我们的主服务器也会提示已经有太多客户端。 在 postgresql.conf 中将最大连接数增加到 400 是否安全,或者我的服务器是否有问题,因
我正在处理的网站存在一些小问题,我想发布一个测试版本,在其中进行一些调整以查看效果(我想在移动设备上进行测试设备也是如此,因此拥有实时版本肯定是在多个设备上进行测试的最简单方法)。 理想情况下,我想要
我正在构建一个网站,其中导航栏的元素使用 HTML5 的 Canvas 元素进行动画处理。例如,按钮是 float 的圆圈。这个想法是按钮的文本将 float 到这些圆圈的右侧。我想知道,就 SEO
我是一名优秀的程序员,十分优秀!