다음을 통해 공유


<customBinding>의 <security>

사용자 지정 바인딩에 대한 보안 옵션을 지정합니다.

<system.serviceModel>
  <bindings>
    <customBinding>
      <binding>
        <customBinding>의 <security>

<security 
   allowSerializedSigningTokenOnReply="Boolean"
   authenticationMode="AuthenticationMode"
      defaultAlgorithmSuite="SecurityAlgorithmSuite"
   includeTimestamp="Boolean"
      requireDerivedKeys="Boolean"
   keyEntropyMode="ClientEntropy/ServerEntropy/CombinedEntropy" 
messageProtectionOrder="SignBeforeEncrypt/SignBeforeEncryptAndEncryptSignature/EncryptBeforeSign"
      messageSecurityVersion="WSSecurityJan2004/WSSecurityXXX2005"
   requireDerivedKeys="Boolean"
   requireSecurityContextCancellation="Boolean"
   requireSignatureConfirmation="Boolean"
      securityHeaderLayout=
              "Strict/Lax/LaxTimestampFirst/LaxTimestampLast"
   includeTimestamp="Boolean">
   <issuedTokenParameters />
   <localClientSettings />
   <localServiceSettings />
   <secureConversationBootstrap />
</security>

특성 및 요소

특성

특성 설명

allowSerializedSigningTokenOnReply

선택적 요소입니다. serialize된 토큰을 회신에 사용할 수 있는지 여부를 지정하는 부울 값입니다.

authenticationMode

선택적 요소입니다. 개시자와 응답자 간에 인증 모드가 사용되도록 지정합니다. 아래의 모든 값을 참조하십시오.

기본값은 sspiNegotiated입니다.

defaultAlgorithmSuite

선택적 요소입니다. 메시지 암호화 및 키 래핑 알고리즘을 설정합니다. 알고리즘과 키 크기는 SecurityAlgorithmSuite 클래스로 결정됩니다. 이러한 알고리즘은 WS-SecurityPolicy(Security Policy Language) 사양에 지정된 알고리즘에 매핑됩니다.

가능한 값이 아래에 나와 있습니다. 기본값은 Basic128입니다.

이 특성은 기본값과 다른 알고리즘 집합에 적합한 다른 플랫폼에서 작업할 때 사용됩니다. 이 설정을 수정하는 경우 관련 알고리즘의 장점과 단점을 파악해야 합니다. 이 특성은 SecurityAlgorithmSuite 형식입니다. 기본값은 Aes256입니다.

includeTimestamp

각 메시지에 타임스탬프가 포함되는지 여부를 지정하는 부울 값입니다. 기본값은 true입니다.

keyEntropyMode

메시지 보안 설정을 위한 키의 계산 방식을 지정합니다. 키는 클라이언트 키 자료만을 기반으로 하거나 서비스 키 자료만을 기반으로 하거나 두 가지의 조합을 기반으로 할 수 있습니다. 유효한 값은 다음과 같습니다.

  • ClientEntropy: 세션 키는 클라이언트가 제공한 키 데이터를 기반으로 합니다.
  • ServerEntropy: 세션 키는 서버가 제공한 키 데이터를 기반으로 합니다.
  • CombinedEntropy: 세션 키는 클라이언트 및 서비스가 제공한 키 데이터를 기반으로 합니다.

기본값은 CombinedEntropy입니다.

이 특성은 SecurityKeyEntropyMode 형식입니다.

MessageProtectionOrder

메시지 수준 보안 알고리즘이 메시지에 적용되는 순서를 설정합니다. 유효한 값은 다음과 같습니다.

  • SignBeforeEncrypt: 서명한 다음 암호화합니다.
  • SignBeforeEncryptAndEncryptSignature: 먼저 서명하고 암호화한 다음 서명을 암호화합니다.
  • EncryptBeforeSign: 암호화한 다음 서명합니다.

기본값은 SignBeforeEncrypt입니다.

이 특성은 MessageProtectionOrder 형식입니다.

messageSecurityVersion

선택적 요소입니다. 사용되는 WS-Security 버전을 설정합니다. 유효한 값은 다음과 같습니다.

  • WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11
  • WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10
  • WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10

기본값은 WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11이며 간단하게 Default와 같이 XML로 나타낼 수 있습니다. 이 특성은 MessageSecurityVersion 형식입니다.

requireDerivedKeys

키를 원본 증명 키에서 파생할 수 있는지 여부를 지정하는 부울 값입니다. 기본값은 true입니다.

requireSecurityContextCancellation

선택적 요소입니다. 더 이상 필요하지 않은 보안 컨텍스트를 취소 및 종료할지 여부를 지정하는 부울 값입니다. 기본값은 true입니다.

requireSignatureConfirmation

선택적 요소입니다. WS-Security 서명 확인을 사용할 수 있는지 여부를 지정하는 부울 값입니다. true로 설정되면 응답자가 메시지 서명을 확인합니다. 기본값은 false입니다.

서비스가 요청을 완전히 인식하고 응답하는지 확인하기 위해 서명 확인이 사용됩니다.

securityHeaderLayout

선택적 요소입니다. 보안 헤더의 요소 순서를 지정합니다. 유효한 값은 다음과 같습니다.

  • Strict: 일반적인 "사용 전 선언" 원칙에 따라 항목이 보안 헤더에 추가됩니다.
  • LaxWSS: SOAP 메시지 보안을 확인하는 순서로 항목이 보안 헤더에 추가됩니다.
  • LaxWithTimestampFirstWSS: SOAP 메시지 보안을 확인하는 순서로 항목이 보안 헤더에 추가됩니다. 단, 보안 헤더의 첫 번째 요소는 wsse:Timestamp 요소여야 합니다.
  • LaxWithTimestampLastWSS: SOAP 메시지 보안을 확인하는 순서로 항목이 보안 헤더에 추가됩니다. 단, 보안 헤더의 마지막 요소는 wsse:Timestamp 요소여야 합니다.

기본값은 Strict입니다.

이 요소는 SecurityHeaderLayout 형식입니다.

자식 요소

요소 설명

<issuedTokenParameters>

현재 발급된 토큰을 지정합니다. 이 요소는 IssuedTokenParametersElement 형식입니다.

<localClientSettings> 요소

이 바인딩에 대한 로컬 클라이언트의 보안 설정을 지정합니다. 이 요소는 LocalClientSecuritySettingsElement 형식입니다.

<localServiceSettings> 요소

이 바인딩에 대한 로컬 서비스의 보안 설정을 지정합니다. 이 요소는 LocalServiceSecuritySettingsElement 형식입니다.

<secureConversationBootstrap>

보안 대화 서비스 개시에 사용되는 기본값을 지정합니다.

부모 요소

요소 설명

<binding>

사용자 지정 바인딩의 모든 바인딩 기능을 정의합니다.

설명

요소 사용에 대한 자세한 내용은 SecurityBindingElement Authentication ModesHow To: Create a Custom Binding Using the SecurityBindingElement를 참조하십시오.

예제

다음 예에서는 사용자 지정 바인딩을 사용하여 보안을 구성하는 방법을 보여 줍니다. 여기서는 사용자 지정 바인딩을 사용하여 메시지를 안전하게 전송하고 메시지 수준 보안을 가능하게 하는 방법을 보여 줍니다. 이러한 방법은 클라이언트와 서비스 간에 메시지를 전송하는 데 보안 전송이 요구되면서 동시에 메시지가 메시지 수준에서 보호되어야 하는 경우에 유용합니다. 이러한 구성은 시스템이 제공한 바인딩에서 지원되지 않습니다.

서비스 구성은 TLS/SSL 프로토콜을 사용하여 보호되는 TCP 통신 및 Windows 메시지 보안을 지원하는 사용자 지정 바인딩을 정의합니다. 사용자 지정 바인딩은 서비스 인증서를 사용하여 전송 수준에서 서비스를 인증하고 클라이언트와 서비스 간 전송 시 메시지를 보호합니다. 이러한 구성은 <sslStreamSecurity> 바인딩 요소에 의해 수행됩니다. 서비스 인증서는 서비스 동작을 사용하여 구성됩니다.

또한 사용자 지정 바인딩은 기본 자격 증명 형식인 Windows 자격 증명 형식의 메시지 보안을 사용합니다. 이러한 구성은 <customBinding>의 <security> 바인딩 요소에 의해 수행됩니다. Kerberos 인증 메커니즘이 사용 가능한 경우 클라이언트 및 서비스는 모두 메시지 수준 보안을 사용하여 인증됩니다. Kerberos 인증 메커니즘을 사용할 수 없는 경우 NTLM 인증이 사용됩니다. NTLM은 서비스에 대해 클라이언트를 인증하지만 클라이언트에 대해 서비스를 인증하지는 않습니다. <customBinding>의 <security> 바인딩 요소는 SecureConversation authenticationType을 사용하도록 구성됩니다. 이렇게 하면 클라이언트와 서비스 모두에 보안 세션이 만들어집니다. 이러한 구성은 서비스의 이중 계약을 사용할 때 필요합니다. 이 예제에 대한 자세한 내용은 Custom Binding Security을 참조하십시오.

<configuration>
  <system.serviceModel>
    <services>
      <service 
          name="Microsoft.ServiceModel.Samples.CalculatorService"
          behaviorConfiguration="CalculatorServiceBehavior">
        <host>
          <baseAddresses>
            <!-- use following base address -->
            <add baseAddress="net.tcp://localhost:8000/ServiceModelSamples/Service"/>
          </baseAddresses>
        </host>
        <endpoint address=""
                    binding="customBinding"
                    bindingConfiguration="Binding1" 
                    contract="Microsoft.ServiceModel.Samples.ICalculatorDuplex" />
        <!-- the mex endpoint is exposed at net.tcp://localhost:8000/ServiceModelSamples/service/mex -->
        <endpoint address="mex"
                  binding="mexTcpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>

    <bindings>
      <!-- configure a custom binding -->
      <customBinding>
        <binding name="Binding1">
          <security authenticationMode="SecureConversation"
                     requireSecurityContextCancellation="true">
          </security>
          <textMessageEncoding messageVersion="Soap12WSAddressing10" writeEncoding="utf-8"/>
          <sslStreamSecurity requireClientCertificate="false"/>
          <tcpTransport/>
        </binding>
      </customBinding>
    </bindings>

    <!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
    <behaviors>
      <serviceBehaviors>
        <behavior name="CalculatorServiceBehavior">
          <serviceMetadata />
          <serviceDebug includeExceptionDetailInFaults="False" />
          <serviceCredentials>
            <serviceCertificate findValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

참고 항목

참조

<customBinding>
SecurityElement
SecurityBindingElement
CustomBinding

기타 리소스

Windows Communication Foundation Bindings
Extending Bindings
Custom Bindings
How To: Create a Custom Binding Using the SecurityBindingElement
Custom Binding Security