【问题标题】:Risks of "Full" trust mode“完全”信任模式的风险
【发布时间】:2015-04-13 14:08:48
【问题描述】:

我们在 SSRS 11 和 .NET 4.5 上面临 the slow performance issue

A solution是在web.config中设置trust模式为full。这种修改有什么风险?

【问题讨论】:

    标签: reporting-services web-config .net-4.5 code-access-security full-trust


    【解决方案1】:

    首先,您可以通过 web.config 中的FullTrustAssembliesSection 为您需要的程序集提供Full Trust level,而这只能为signed assemblies 完成:

    <system.web>
      <securityPolicy>
        <fullTrustAssemblies>
          <add assemblyName="MyCustomAssembly"
            version="1.0.0.0"
            publicKey="a 320 hex character representation
            of the public key blob used with a
            signed assembly"
          />
        </fullTrustAssemblies>
      </securityPolicy>
    </system.web>
    

    注意

    The default policy 用于评估权限授予完全信任 Global Assembly Cache (GAC) 程序集和部分信任 其他程序集。

    另外请注意,您可以configure trust level for an application in IIS

    所以这个选项可以帮助你确定哪个程序集应该在FullTrust 策略下运行,并将其他的设置为默认值。但是,如果您仍然担心您的应用程序或某个库的信任级别,我建议您调查Trust Level table 并回答以下问题:

    • 我们的应用程序是否可以与第三方组件一起使用?
    • 我们是否以尽可能低的信任级别运行他们的代码?
    • 究竟应该能够在我们的应用程序中执行哪些自定义代码?
    • 我们可以通过identity for an application 管理此权限吗?
    • 我们可以通过CAS rules 管理此权限吗?
    • 能否将第三方代码移至单独的sandbox ApplicationDomain

    之后,您可以随意管理您的应用程序安全性。希望这会有所帮助。

    另见:
    * ASP.NET Application Security in Hosted Environments * Security Practices: ASP.NET Security Practices at a Glance

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-24
      • 2020-05-14
      • 1970-01-01
      • 1970-01-01
      • 2012-03-06
      • 2016-06-20
      • 1970-01-01
      相关资源
      最近更新 更多