マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。

目次

概要

汎用認証サイトにSAML2.0を実装するため仕様を読む。

  • ターゲットはSP Initiated な Web Browser SSO Profileに絞る。
  • ココに書いた情報は、SAML の Coreの範囲。

以下、詳細

SAML and XML Signature Syntax and Processing

SAMLのXML署名・暗号に関する処理。

  • SAMLではデジタル署名は必ずしも必要ではない。
    • Message内のAssertionなど署名が継承されている場合。
    • 仲介者を通過しないBindingで、セキュアチャネルで認証されたメッセージ。
  • 署名するケース
    仲介者を通過する場合は署名するべき。
    • UAなどの仲介者
    • IdP以外から取得するAssertion
  • 署名の方法
    • 基本は、XMLデジタル署名を使用する。
    • S/MIME や signed Java objectsを使用してもイイ。

Signing Assertions

Assertionの署名ができる。

Request/Response Signing

Request/Responseの署名ができる。

Signature Inheritance

簡単に言って、

  • <ds:Signature>要素を持つ親要素からその子要素すべてが署名されている。
  • XML 文書のルート要素であってもなくてもかまわない

XML Signature Profile

XML Signature 仕様[XMLSig]は、
柔軟性と数多くの選択肢を備えた
データ署名の一般的な XML 構文を規定する。

Signing Formats and Algorithms

SAMLでは以下のXML署名・暗号を行う。

References

署名したルート要素のID属性を<ds:SignedInfo?>の<ds:Reference>要素に含める。

Canonicalization Method

オブジェクトに署名する前に使用された標準化アルゴリズム

Transforms

エンベロープドには、

  • 署名変換以外の変換
  • 排他的標準化変換

が含まれていてはならない。

KeyInfo?

SAMLでは、<ds:KeyInfo?>はオプション。

Example

<Response
  IssueInstant="2003-04-17T00:46:02Z" Version="2.0"
  ID="_c7055387-af61-4fce-8b98-e2927324b306"
  xmlns="urn:oasis:names:tc:SAML:2.0:protocol"
  xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<saml:Issuer>https://www.opensaml.org/IDP"</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
  <ds:SignedInfo>
    <ds:CanonicalizationMethod
      Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    <ds:SignatureMethod
      Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
    <ds:Reference URI="#_c7055387-af61-4fce-8b98-e2927324b306">
      <ds:Transforms>
        <ds:Transform
          Algorithm="http://www.w3.org/2000/09/xmldsig#envelopedsignature"/>
        <ds:Transform
          Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
          <InclusiveNamespaces
            PrefixList="#default saml ds xs xsi"
            xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"/>
        </ds:Transform>
      </ds:Transforms>
      <ds:DigestMethod
        Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
      <ds:DigestValue>...</ds:DigestValue>
    </ds:Reference>
  </ds:SignedInfo>
  <ds:SignatureValue>...</ds:SignatureValue>
  <ds:KeyInfo>
    <ds:X509Data>
      <ds:X509Certificate>...</ds:X509Certificate>
    </ds:X509Data>
  </ds:KeyInfo>
</ds:Signature>
<Status>
  <StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</Status>
<Assertion ID="_a75adf55-01d7-40cc-929f-dbd8372ebdfc"
  IssueInstant="2003-04-17T00:46:02Z" Version="2.0"
  xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
  <Issuer>https://www.opensaml.org/IDP</Issuer>
  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:SignedInfo>
      <ds:CanonicalizationMethod
        Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
      <ds:SignatureMethod
        Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
      <ds:Reference URI="#_a75adf55-01d7-40cc-929f-dbd8372ebdfc">
        <ds:Transforms>
          <ds:Transform
            Algorithm="http://www.w3.org/2000/09/xmldsig#envelopedsignature"/>
          <ds:Transform
            Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
            <InclusiveNamespaces
              PrefixList="#default saml ds xs xsi"
              xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"/>
          </ds:Transform>
        </ds:Transforms>
        <ds:DigestMethod
          Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
        <ds:DigestValue>...</ds:DigestValue>
      </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>...</ds:SignatureValue>
    <ds:KeyInfo>
      <ds:X509Data>
        <ds:X509Certificate>...</ds:X509Certificate>
      </ds:X509Data>
    </ds:KeyInfo>
  </ds:Signature>
  <Subject>
    <NameID
      Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">
      scott@example.org
    </NameID>
    <SubjectConfirmation
      Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"/>
  </Subject>
  <Conditions NotBefore="2003-04-17T00:46:02Z"
    NotOnOrAfter="2003-04-17T00:51:02Z">
    <AudienceRestriction>
      <Audience>http://www.opensaml.org/SP</Audience>
    </AudienceRestriction>
  </Conditions>
  <AuthnStatement AuthnInstant="2003-04-17T00:46:00Z">
    <AuthnContext>
      <AuthnContextClassRef>
        urn:oasis:names:tc:SAML:2.0:ac:classes:Password
      </AuthnContextClassRef>
    </AuthnContext>
  </AuthnStatement>
</Assertion>
</Response>
  • Active Directory 連携 / SAMLを使用したLDAP認証
    ManageEngine? Service Desk Plus Cloud
    https://www.manageengine.jp/products/ServiceDesk_Plus/ad-sso-integration.html
    <Assertion ID="_c42ed101-0051-48ad-a678-8cb58dee03f6"...>
      ...
      <ds:Signature xmlns:ds="//www.w3.org/2000/09/xmldsig#">
        <ds:SignedInfo>
          <ds:CanonicalizationMethod Algorithm="//www.w3.org/2001/10/xml-exc-c14n#" />
          <ds:SignatureMethod Algorithm="//www.w3.org/2000/09/xmldsig#rsa-sha1" />
          <ds:Reference URI="#_c42ed101-0051-48ad-a678-8cb58dee03f6">
            <ds:Transforms>
              <ds:Transform Algorithm="//www.w3.org/2000/09/xmldsig#enveloped-signature" />
              <ds:Transform Algorithm="//www.w3.org/2001/10/xml-exc-c14n#" />
            </ds:Transforms>
            <ds:DigestMethod Algorithm="//www.w3.org/2000/09/xmldsig#sha1" />
            <ds:DigestValue>wlE4Jf0Z8Z+2OyWE69RRH81atZ8=</ds:DigestValue>
          </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue>...</ds:SignatureValue>
        <KeyInfo xmlns="//www.w3.org/2000/09/xmldsig#">
        <ds:X509Data>
        <ds:X509Certificate>...</ds:X509Certificate>
        </ds:X509Data>
        </KeyInfo>
      </ds:Signature>

SAML and XML Encryption Syntax and Processing

  • SOAP Bindingは SSL/TLSやSOAP Message Security 機密保護機構の使用をサポート。
  • <SubjectconfirmationData?>内の<ds:KeyInfo?>要素を使用し<SubjectConfirmation?>秘密を保護できる。
  • その他
  • <BaseID>または<NameID>要素を暗号化し、
    <EncryptedID>の<xenc:EncryptedData?>・<xenc:EncryptedKey?>に追加。
  • <Attribute>要素を暗号化し、
    <EncryptedAttribute?>の<xenc:EncryptedData?>・<xenc:EncryptedKey?>に追加。
  • <Assertion>要素全体を暗号化し、
    <EncryptedAssertion?>の<xenc:EncryptedData?>・<xenc:EncryptedKey?>に追加。

General Considerations

要素の暗号化は XML Encryption[XMLEnc]の使用により提供される。

Combining Signatures and Encryption

  • XML Encryption と XML Signature の使用を結合することができる(MAY)。
  • 署名・暗号化の順番
    • <Assertion>の場合、署名(<ds:Signature>要素を追加)→暗号化
    • <BaseID>/<NameID>/<Attribute>の場合、暗号化→署名

参考

XML署名・暗号

oasis-open.org

https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf

5 SAML and XML Signature Syntax and Processing

5.1 Signing Assertions
5.2 Request/Response Signing
5.3 Signature Inheritance

5.4 XML Signature Profile
5.4.1 Signing Formats and Algorithms
5.4.2 References
5.4.3 Canonicalization Method
5.4.4 Transforms
5.4.5 KeyInfo
5.4.6 Example

6 SAML and XML Encryption Syntax and Processing
6.1 General Considerations
6.2 Combining Signatures and Encryption

Tags: :IT国際標準, :認証基盤, :クレームベース認証, :SAML


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019-04-24 (水) 16:08:11 (1822d)