Websphere extendedDocumentRoot如何通过安全角色进行限制

时间:2017-12-06 04:55:01

标签: security websphere security-constraint

我们正在使用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的网址是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中。

1 个答案:

答案 0 :(得分:0)

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

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

相关问题