在 WebSphere Application Server 中自訂安全

如果針對 Report Launcher for ClearQuest 定義的預設安全角色及配置不符合您的需求,您可以更新 Report Launcher for ClearQuest® 部署描述子檔案來進行變更。更新此檔案之後,請使用 WebSphere® Application Server wsadmin 公用程式來套用部署描述子設定。

關於這項作業

只有在您想要自訂配置 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 Cell 目錄是 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 存取 AuthenticatedUsers 角色的所有使用者。
<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 資料夾的存取權侷限於部門經理
此程式碼範例建置在前一個範例之上。粗體的程式碼區段建立另一個 Managers 角色作為 AuthenticatedUsers 角色的子集。此程式碼會建立安全限制,只容許 Managers 角色的使用者存取 /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>

意見