【问题标题】:Websphere extendedDocumentRoot how to restrict by security roleWebsphere extendedDocumentRoot 如何通过安全角色进行限制
【发布时间】:2018-05-19 21:44:21
【问题描述】:

我们使用的是 Websphere 8.5.5 传统版

我已将扩展文档根添加到 Websphere 的 ibm-web-ext.xml 文件并将文件共享设置为 true。

<fileServingAttribute name="extendedDocumentRoot" value="C:/extdocroot"/>
<enable-file-serving value="true"/>

在扩展文档根文件夹 (C:/extdocroot) 中有一个名为 pdfs 的文件夹。我想将 pdfs 文件夹限制为仅限已登录并具有“学校”特定角色的用户。

提供 pdf 的 URL 是 https://domain-name:9080/context-path/pdf/pdf-name.pdf 我在 web.xml 文件中添加了一个安全约束

<security-constraint>
    <display-name>school PDFs</display-name>
    <web-resource-collection>
       <web-resource-name>School PDFs</web-resource-name>
       <url-pattern>/pdf/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
       <role-name>school</role-name>
    </auth-constraint>
</security-constraint>

无论用户以什么角色登录,因为 PDF 将由服务器提供服务。 Websphere 忽略了从扩展文档根目录提供 PDF 的 URL 的安全约束。是否可以通过登录用户的角色来限制这些 PDF。

注意:我的公司已要求我尝试将这些文件放在 ear 文件之外,并让 Websphere 使用用户角色保护这些文件。我还被指示不要使用 Apache HTTP Server 来托管这些文件,因为它位于 DMZ 中。

【问题讨论】:

    标签: security websphere security-constraint


    【解决方案1】:

    我发现这是 Websphere 8.5.5.11 中的一个错误。升级到 8.5.5.12 后,我能够在 web.xml 中为扩展文档根目录中的文件夹添加安全约束。

    我还在 Websphere 9.0.0.5 中对此进行了测试,一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-26
      • 2015-10-28
      • 1970-01-01
      • 2015-09-30
      相关资源
      最近更新 更多