다음을 통해 공유


방법: 익명 대화 보안을 위한 시작 서비스 구성(Transact-SQL)

SQL Server에서는 원격 서비스가 바인딩되는 서비스에 대한 모든 대화에 대화 보안을 사용합니다. 대상 서비스를 호스팅하는 데이터베이스에 대화를 생성한 해당 사용자가 없으면 해당 대화는 익명 보안을 사용합니다.

보안 정보보안 정보

신뢰할 수 있는 출처에서 제공하는 인증서만 설치합니다.

시작 서비스가 대화 보안을 사용하도록 하려면

  1. 신뢰할 수 있는 출처에서 원격 데이터베이스의 사용자 인증서를 얻습니다.

  2. 로그인 없이 사용자를 만듭니다.

  3. 원격 서비스에 대한 인증서를 설치합니다. 3단계에서 생성된 사용자가 인증서를 소유합니다. 기본적으로 인증서는 BEGIN DIALOG에 대해 활성화됩니다.

  4. 사용자와 대상 서비스를 지정하는 원격 서비스 바인딩을 만듭니다. 익명 대화 보안의 경우 원격 서비스 바인딩은 ANONYMOUS = ON을 지정합니다.

이 예에서는 현재 인스턴스의 OrderParts 서비스와 원격 인스턴스의 SupplierOrders 서비스 간의 대화에 대해 익명 대화 보안을 구성합니다.

USE AdventureWorks ;
GO

-- Given a certificate for a remote user for the remote service
-- SupplierOrders, create a remote service binding for
-- the service.  The remote user will be granted permission
-- to send messages to the local service OrderParts. 
-- This example assumes that the certificate for the service 
-- is saved in the file'C:\Certificates\SupplierOrders.cer' and that
-- the initiating service already exists.


-- Create a user without a login.

CREATE USER [SupplierOrdersUser]
    WITHOUT LOGIN ;
GO

-- Install a certificate for the owner of the service
-- in the remote database. The certificate is
-- provided by the owner of the remote service. The
-- user for the remote service owns the certificate.

CREATE CERTIFICATE [SupplierOrdersCertificate]
    AUTHORIZATION [SupplierOrdersUser]
    FROM FILE='C:\Certificates\SupplierOrders.cer' ;
GO

-- Create the remote service binding. Notice
-- that the user specified in the binding
-- does not own the binding itself.

-- Creating this binding specifies that messages from
-- this database are secured using the certificate for
-- the [SupplierOrdersUser] user.

-- Since anonymous is ON, the credentials for the user
-- that begins the conversation are not used for the
-- conversation.

CREATE REMOTE SERVICE BINDING [SupplierOrdersBinding]
    TO SERVICE 'SupplierOrders'
    WITH USER = [SupplierOrdersUser],
         ANONYMOUS = ON ;
GO