傳統版和 Liberty 之間的 WS-Security 行為差異
Liberty 中可新增到 Web 服務應用程式的 WS-Security 限制,與傳統版中的服務所套用的相同限制,行為可能有所不同。
WS-Security 啟用與配置
Liberty 中的 WS-Security 是利用 Web 服務應用程式 WSDL 檔內的 WS-SecurityPolicy 來配置,且是透過在 server.xml 檔中新增 wsSecurity-1.1 特性來啟用。traditional 中的 WS-Security 是利用原則集來配置,並透過附加原則集來啟用。 如果您將啟用 WS-Security 的 Liberty Web 服務應用程式部署於傳統版,您必須建立及附加對等的原則集和連結,以取得相同的 Web 服務安全層次。
WS-Security 原則
- 名稱空間
- Liberty CXF WS-Security 支援下列 WS-Security 原則名稱空間:
http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702 http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802
- 也支援下列名稱空間,但有若干限制:
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy
- traditional 的 WS-Security 支援下列 WS-Security 原則名稱空間:
http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512
- Liberty CXF WS-Security 支援下列 WS-Security 原則名稱空間:
- 主張相較於傳統版,Liberty 在 WS-Security 原則 1.2 中支援更多主張。 traditional WS-Security 的部分原則主張是透過 XPath 或連結來實作。 下列清單顯示一些重要差異:
- 支援記號
如果要在 Liberty 中簽署或加密 SupportingToken,例如 UsernameToken,您以 SignedSupportingTokens、SignedEncryptedSupportingTokens 或 EncryptedSupportingTokens 的方式來主張記號。 在 traditional 中,您必須利用 XPath 表示式來簽署或加密 SupportingToken。
在 traditional 中,不支援所有背書記號,其中包括:EndorsingSupportingTokens、SignedEndorsingSupportingTokens、EndorsingEncryptedSupportingTokens 和 SignedEndorsingEncryptedSupportingTokens。
- 安全連結主張
Liberty 支援 SymmetricBinding、AsymmetricBinding 和 TransportBinding 主張。 傳統版伺服器不支援 TransportBinding 主張。
- IncludeToken 主張
Liberty 施行 IncludeToken 主張,但在傳統版的 WS-Security 執行時期環境中會忽略這個主張。
- UsernameToken 主張
Liberty 支援在 UsernameToken 主張中衍生 PasswordDigest 和金鑰。WebSphere Application Server 傳統版只支援 UsernameToken 中的 PasswordText。
- 支援記號
Security 標頭中無法辨識的元素
- 傳統版會拒絕 Security 標頭中無法辨識的元素,而 Liberty 則會接受。
加密標頭
- WS-Security 1.1 規格建議利用 <wsse11:EncryptedHeader> 元素來進行 SOAP 標頭區塊的加密。
- Liberty 所用的 CXF WS-Security 不會產生 EncryptedHeader 元素。相反地,CXF WS-Security 會產生 <xenc:EncryptedData> 元素。 不過,如果 <security> 標頭中的 mustUnderstand 設為 0,Liberty 所用的 CXF WS-Security 可以處理及使用送入的 <wsse11:EncryptedHeader> 元素。
- WebSphere® Application Server 傳統版一律會在 <security> 標頭中將 mustUnderstand 設為 1。
如果要使 Liberty 順利處理 EncryptedHeader 元素,您必須設定出埠連結配置中的下列內容,將 mustUnderstand 明確設為 0:
<properties name="com.ibm.wsspi.wssecurity.config.request.setMustUnderstand" value="false"/>
中間非授信憑證
- 沒有任何方法可以指定中間非授信憑證,讓憑證路徑驗證器建置從入埠憑證到信任儲存庫中之授信憑證的憑證路徑。 不論是入埠憑證或它的中間核簽者,都必須在信任儲存庫中,憑證才會受到信任。
已知的問題
- 在 Liberty CXF WS-Security 中,有一些已知的問題。部分問題有暫行解決方法。 如果要尋找已尋問題和暫行解決方法,請參閱 WS-Security 已知問題和暫行解決方法。
未測試和不支援的特性
- Liberty WS-Security 包括 CXF 專案中的所有 WS-Security 執行時期環境程式碼。不過,CXF WS-Security 並非所有功能和特性都已經過測試或驗證。 如果要查看未經驗證的規格清單,請參閱未經測試的 WS-Security 規格。