在 WebSphere Application Server 中定制安全性

如果为 Report Launcher for ClearQuest 定义的缺省安全角色和配置不符合需求,那么可以通过更新 Report Launcher for ClearQuest® 部署描述符文件来对其进行更改。 更新此文件后,使用 WebSphere® Application Server wsadmin 实用程序来应用部署描述符设置。

关于此任务

仅当您要定制配置 Report Launcher 和报告的安全性中所述的缺省 Report Launcher 安全角色和配置时,才需要此任务。

定制安全配置之前,请考虑您要尝试实现的安全行为。例如,您是否希望所有用户在启动 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 文件的目录。
    2. 通过命令提示符,运行以下命令来启动 wsadmin 实用程序:
      Windows:
      %CLEARQUEST_HOME%\cqweb\cqwebprofile\bin\wsadmin
      UNIX 和 Linux:
      $CLEARQUEST_HOME/cqweb/cqwebprofile/bin/wsadmin.sh
    3. 如果出现提示,那么提供 WebSphere 管理用户的凭证。
    4. 在 WebSphere Application Server 中运行以下命令以更新部署描述符:
      wsadmin> $AdminApp update RationalClearQuestReportLauncher file {-operation update -contents launcher_web.xml -contenturi CQReportLauncher.war/WEB-INF/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>

反馈