【问题标题】:Is it bad to have 'You have created a service' page for published wcf service on the internet?在互联网上为已发布的 wcf 服务创建“您已创建服务”页面是不是很糟糕?
【发布时间】:2011-04-04 16:16:31
【问题描述】:

我已经创建了 wcf 服务并计划使其可以从 Internet 访问。 “您已创建服务”页面似乎是一些存根,应在将服务投入生产之前对其进行替换。在生产中使用此欢迎页面是一种不好的做法吗?当您在 Internet 上发布 wcf 服务时,您如何处理该欢迎页面?

谢谢

【问题讨论】:

    标签: wcf wcf-security


    【解决方案1】:

    在生产中,您可以通过添加以下内容来关闭此页面:

    <behaviors>
      <serviceBehaviors>
        <behavior name="ProductionService">
          <serviceDebug includeExceptionsInDetail="false" httpHelpPageEnabled="false" />
        </behavior>
      <serviceBehaviors>
    </behavirs>
    

    还要考虑发布 WSDL/元数据。如果您不想发布 WSDL 但想使用 mex 端点,请使用以下配置:

    <behaviors>
      <serviceBehaviors>
        <behavior name="ProductionService">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionsInDetail="false" httpHelpPageEnabled="false" />
        </behavior>
      <serviceBehaviors>
    </behavirs>
    

    您的服务必须在其 behaviorConfiguration 属性中使用这些行为。

    【讨论】:

      【解决方案2】:

      是的,这很糟糕。它表示潜在的攻击者系统未完全配置,因此他们会尝试攻击它。也不是很专业。

      好吧,打印一些有用的东西或者隐藏它:-)

      【讨论】:

      • 我怎样才能在那里打印一些东西而不是默认的欢迎页面?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多