2016-07-22 8 views
0

私はspring samlサンプルを正常にデプロイして実行しました。以下に示すSAMLレスポンス(IdP - > SP)から、SAMLの応答とアサーションは署名/符号なしですか?

  1. SAML応答は署名されているのか署名されていないのでしょうか?
  2. アサーションが暗号化されているかどうか(私はそれが暗号化されていると思います)
  3. アサーションは署名されているか、私のSPサーバーのデバッグログから
 

    <?xml version="1.0" encoding="UTF-8"?><samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="https://MY_SP/spring-security-saml2-sample/saml/SSO" ID="_22bf0c00-9cfa-5dbb-7af7-d34eec7d9b6f" InResponseTo="we3977191e5g4try1b3g52j4f84e43f" IssueInstant="2016-07-22T08:22:41.568Z" Version="2.0"> 
     <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://MY_ADFS_SERVER/adfs/services/trust</Issuer> 
     <samlp:Status> 
      <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/> 
     </samlp:Status> 
     <EncryptedAssertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion"> 
      <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Element"> 
      <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/> 
      <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 
       <e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#"> 
        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"> 
         <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> 
        </e:EncryptionMethod> 
        <KeyInfo> 
         <ds:X509Data xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 
         <ds:X509IssuerSerial> 
          <ds:X509IssuerName>CN=apollo, OU=R&amp;D, O=RM5 Software Oy, L=Helsinki, S=Uusimaa, C=FI</ds:X509IssuerName> 
          <ds:X509SerialNumber>2343092425</ds:X509SerialNumber> 
         </ds:X509IssuerSerial> 
         </ds:X509Data> 
        </KeyInfo> 
        <e:CipherData> 
         <e:CipherValue>Mpz3raT40LBmwUfzz+a52+ryijTMqVqtnk8T2YOJ27Xs/dS 
    jMZHShDfMGsD1wwXb2a2jGjpjCLgLWsZ1t8LWgxevSbmTZuGGSfAMhfdOwmJMijRYdKrHdiyn+syFUof 
    0MDMykI135ulCL9MGWVUvR1pNz+W+tZzQKcQ+is6USH4OGnUKiMSaow==</e:CipherValue> 
        </e:CipherData> 
       </e:EncryptedKey> 
      </KeyInfo> 
      <xenc:CipherData> 
       <xenc:CipherValue>iefcMnnYFLtb 
    EObkQpItoZk4tRuMDX9dqt1DucK91ZZRigHeQ2DuUYe2FZpGtQ2vFVtS2ycXSnVR2V4wx4Vd2VeR/G3I 
    GHkqQ9GtOxv8RvkRtEbJTptmjoMT1t7ZNE4tn+hDmzMMK7Xy9f+xkk/z5IHvNKlscnsG/wXoRuMykKnJ 
    tODd0ILiVF/ygQqY477lxVFDlaa4HH/rcx+DZOcDFiFjiuLj41dF1rdG90XCmWvr2BfUTzYl3SHakoyK 
    AmmgesyCJQcHN54ckFiO/wvLttw09wdvC4sg92xlhhfGtQqMuvfT7YESOvHnC1FOEsf4CjoMaByZjwN2 
    QBRHPRJTBPjwmfVgTk+g==</xenc:CipherValue> 
      </xenc:CipherData> 
      </xenc:EncryptedData> 
     </EncryptedAssertion> 
    </samlp:Response> 

は、上記のSAML応答が解析された直後に、以下に見られます。これは、メッセージやアサーションが署名されていないかどうかを混乱させます。

- Evaluating security policy of type 'org.opensaml.ws.security.provider.BasicSecurityPolicy' for decoded message 
- Evaluating simple signature rule of type: org.opensaml.saml2.binding.security.SAML2HTTPPostSimpleSignRule 
- HTTP request was not signed via simple signature mechanism, skipping 
- SAML protocol message was not signed, skipping XML signature processing 
- Successfully decoded message. 

答えて

0
  1. SAML応答が署名されていません。
  2. SAMLアサーションは暗号化されています。 (「EncryptedAssertion」が表示されます)
  3. SAMLアサーションには署名はありません。

SPメタデータに「WantAssertionsSigned = "true"」を設定し、IdPと交換し、署名付きSAMLレスポンスを受信するかどうかを確認してください。

が参照:http://docs.spring.io/spring-security-saml/docs/current/reference/html/configuration-metadata.html

+0

をIDPの設定を変更した後、今は、後応じて添加されます。ただし、この署名は応答とアサーションの両方に適用されるのか、または応答のみに適用されますか?メッセージとの違いをどのように知るのですか? – cole

+0

WantAssertionsSigned = "true"に設定すると、受信した署名がアサーション部分に対応します。受信したアサーション部分のみに署名し、受信した署名でチェックしてください。同じである必要があります。 – Zeigeist

関連する問題