在 WebSphere Application Server 中定制安全性

如果缺省的 Report Launcher for ClearQuest WebSphere Application Security 配置不满足您的需求,那么可通过更新 Report Launcher for ClearQuest® 部署描述符文件来定制设置。更新该文件后,使用 WebSphere® Application Server wsadmin 实用程序来应用该部署描述符设置。

关于此任务

仅当您要定制为 Report Launcher for ClearQuest 定义的缺省 WebSphere Application Server 安全角色和配置时,才需要该任务。

定制安全配置之前,请考虑您要尝试实现的安全行为。例如,您是否希望所有用户在启动 Report Launcher 时都进行认证?您是否希望向不同用户或组提供不同的报告访问权?请查看安全配置设置示例,作为更新配置的起点。

更新 Report Launcher for ClearQuest 部署描述符,以在 WebSphere Application Server 上配置客户机认证。

过程

  1. 将 Report Launcher for ClearQuest 部署描述符文件 web.xml 复制到工作目录,并重命名该文件。 web.xml 文件位于以下目录中:
    Windows:
    cd %CLEARQUEST_HOME%\cqweb\cqwebprofile\installedApps\dfltCell\RationalClearQuestReportLauncher.ear\CQReportLauncher.war\WEB-INF\web.xml
    UNIX 和 Linux:
    cd $CLEARQUEST_HOME/cqweb/cqwebprofile/installedApps/dfltCell/RationalClearQuestReportLauncher.ear/CQReportLauncher.war/WEB-INF/web.xml
    注: 在 Windows、Unix 和 Linux 平台上,缺省的 WebSphere Application Server 单元目录为 dfltCell。在 Solaris 平台上,缺省目录为 <srv>Node01Cell
    该过程中的其余步骤假定您已将复制到工作目录的 web.xml 文件重命名为 launcher_web.xml
  2. 更新安全性约束和安全角色元素,以捕获所期望的安全设置。不必修改 login-config 元素。 有关可能配置的一些想法,请参阅安全配置设置示例
  3. 使用 WebSphere Application Server wsadmin 实用程序来应用这些部署描述符更改:
    1. 通过命令提示符,更改至 launcher_web.xml 文件所在的工作目录。
      Windows:
      %CLEARQUEST_HOME%\cqweb\cqwebprofile\bin\wsadmin
      UNIX 和 Linux:
      $CLEARQUEST_HOME/cqweb/cqwebprofile/bin/wsadmin.sh
    2. 在命令提示符窗口中启动 wsadmin 实用程序。
    3. 如果出现提示,那么提供 WebSphere 管理用户的凭证。
    4. 在 WebSphere Application Server 中运行以下命令以更新部署描述符:
      wsadmin> $AdminApp update RationalClearQuestReportLauncher file {-operation
      update -contents launcher_web.xml -contenturi CQReportLauncher.war/WEBINF/
      web.xml}
      wsadmin> $AdminConfig save
      wsadmin>exit

安全配置设置示例

您可以使用以下代码样本作为在自身环境中配置 Report Launcher 应用程序安全性的起点。

示例 1:需要所有用户登录 Report Launcher 以访问报告
该代码样本显示了需要所有用户登录 Report Launcher for ClearQuest 以访问报告文件服务器上已配置的文件夹和报告的安全配置设置。该示例创建了安全角色 AuthenticatedUsers,它包含所有已认证的用户。然后,安全性约束赋予 Report Launcher 对已认证的用户角色中所有用户的访问权。
<security-constraint>
   	<web-resource-collection>
<web-resource-name>authenticated</web-resource-name>
      			<url-pattern>/*</url-pattern>
		</web-resource-collection>
   		<auth-constraint>
<role-name>AuthenticatedUsers</role-name>
   		</auth-constraint>
   		<user-data-constraint>
				<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
</security-constraint>

<login-config>
   <auth-method>FORM</auth-method>
   <realm-name>default</realm-name>
   <form-login-config>
      <form-login-page>/Login.jsp</form-login-page>
      <form-error-page>/Login.jsp?error=true</form-error-page>
   </form-login-config>
</login-config>

<security-role>
   <role-name>AuthenticatedUsers</role-name>
</security-role>
示例 2:将对 ManagementReports 文件夹的访问权限制为仅限部门经理
该代码样本基于上一个示例而构建。它建立了额外的管理员角色,作为已认证的用户角色的子集,并创建了安全性约束,以仅允许管理员角色中的用户访问 /reports/home/ManagementReports 文件夹。 如果未经授权的用户单击 ManagementReports 文件夹链接,那么 Report Launcher 会禁用该链接,并在文件夹条目上显示一个锁标记,表明该文件夹的内容受到保护,无法访问。
<security-constraint>
   	<web-resource-collection>
<web-resource-name>authenticated</web-resource-name>
      			<url-pattern>/*</url-pattern>
		</web-resource-collection>
   		<auth-constraint>
<role-name>AuthenticatedUsers</role-name>
   		</auth-constraint>
   		<user-data-constraint>
				<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
</security-constraint>

<security-constraint>
   	<web-resource-collection>
		<web-resource-name>secure</web-resource-name>
<url-pattern>/reports/home/ManagementReports/*</url-pattern>
   		</web-resource-collection>
   		<auth-constraint>
<role-name>Managers</role-name>
   		</auth-constraint>
   		<user-data-constraint>
				<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
</security-constraint>

<login-config>
   <auth-method>FORM</auth-method>
   <realm-name>default</realm-name>
   <form-login-config>
      <form-login-page>/Login.jsp</form-login-page>
      <form-error-page>/Login.jsp?error=true</form-error-page>
   </form-login-config>
</login-config>

<security-role>
   <role-name>AuthenticatedUsers</role-name>
</security-role>

<security-role>
   <role-name>Managers</role-name>
</security-role>

反馈