传统版与 Liberty 之间的 WS-Security 行为差异

可以添加至 Liberty 中 Web Service 应用程序的 WS-Security 约束,可能与应用于传统版中服务的相同约束具有不同的行为。

WS-Security 启用和配置

Liberty 中的 WS-Security 是使用 Web Service 应用程序的 WSDL 文件中的 WS-SecurityPolicy 来配置,并且是通过在 server.xml 文件中添加 wsSecurity-1.1 功能部件来启用。传统版中的 WS-Security 是使用策略集配置的,并通过连接策略集启用。如果将已启用 WS-Security 的 Liberty Web Service 应用程序部署到传统版,那么必须创建并连接等价的策略集和绑定,以获取相同级别的 Web Service 安全性。

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
    • 传统版的 WS-Security 支持下列 WS-Security 策略名称空间:
      http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512
  • 断言
    与传统版相比,Liberty 支持 WS-Security Policy 1.2 中的更多断言。传统版 WS-Security 中的某些策略断言是通过 XPath 或绑定实现的。以下列表显示了一些重要差异:
    • 支持令牌

      要对 Liberty 中的 SupportingToken(例如,UsernameToken)进行签名或加密,您将该令牌断言为 SignedSupportingTokensSignedEncryptedSupportingTokensEncryptedSupportingTokens。在传统版中,您必须使用 XPath 表达式对 SupportingToken 进行签名或加密。

      并非所有签署令牌在传统版中都受支持,包括 EndorsingSupportingTokensSignedEndorsingSupportingTokensEndorsingEncryptedSupportingTokensSignedEndorsingEncryptedSupportingTokens

    • 安全性绑定断言

      Liberty 支持 SymmetricBindingAsymmetricBindingTransportBinding 断言。传统服务器不支持 TransportBinding 断言。

    • IncludeToken 断言

      IncludeToken 断言在 Liberty 中强制实施,但在传统版的 WS-Security 运行时环境中被忽略。

    • UsernameToken 断言

      Liberty 支持在 UsernameToken 断言中进行 PasswordDigest 和密钥派生。WebSphere Application Server 传统版仅支持 UsernameToken 中的 PasswordText。

安全性头中无法识别的元素

  • 传统版会拒绝安全性头中无法识别的元素,而 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 WS-Security 包括 CXF 项目中的所有 WS-Security 运行时环境代码。但是,并非 CXF WS-Security 中的所有功能和功能部件都经过测试或验证。要查看未经过验证的规范的列表,请参阅未经测试的 WS-Security 规范

用于指示主题类型的图标 概念主题



时间戳记图标 最近一次更新时间: Tuesday, 6 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cwlp_wssec_cxf_diff
文件名:cwlp_wssec_cxf_diff.html