Udostępnij za pośrednictwem


Jak Konfigurowanie inicjowanie usług dla Zabezpieczenia pełne okno dialogowe (języka Transact-SQL)

SQL Server używa okna dialogowego zabezpieczeń konwersacji do usługi, dla których wiązanie usługi zdalnej istnieje w bazie danych, obsługującym usługę inicjujący.Jeśli baza danych, obsługującej usługa docelowy zawiera użytkownika, który odpowiada użytkownika, który utworzył okna dialogowego, a wiązanie usługa zdalnej nie określa anonimowe zabezpieczeń, a następnie pełne zabezpieczenia korzysta z okna dialogowego.

Aby upewnić się, że usługa inicjujący używa okna dialogowego zabezpieczeń, utwórz wiązanie usługa zdalnej dla usługa.Dla SQL Server Aby korzystać z pełnego bezpieczeństwa, wiązanie usługi zdalnej nie musi określać anonimowe zabezpieczeń, a miejsce docelowe bazy danych musi być skonfigurowany do używania pełne zabezpieczenia dla tej usługa.

Aby skonfigurować usługa inicjujący Zabezpieczenia pełne okno dialogowe

  1. Uzyskaj certyfikat dla właściciela usługa miejsce docelowe w zdalnej bazie danych z zaufanego urządzenie źródłowe.Zazwyczaj to polega na wysyłaniu certyfikat przy użyciu zaszyfrowanych wiadomości e-mail lub przenoszenia certyfikat dla nośnik fizyczny, taki jak dyskietka.

    Security noteSecurity Note:

    Certyfikatów należy instalować tylko z zaufanych źródeł.

    Uwaga

    Certyfikat musi być zaszyfrowany przy użyciu klucz głównego w bazie danych.Aby uzyskać więcej informacji zobacz CREATE MASTER klucz (języka Transact-SQL).

  2. Utwórz użytkownika bez logowania dla usługa zdalnego.

  3. Zainstaluj certyfikat dla usługa zdalnego użytkownika.Certyfikat należące do użytkownika, utworzony w poprzednim kroku.

  4. Utwórz wiązanie usługi zdalnej, które określa użytkowników zdalnych usług i usługa.

  5. Utwórz użytkownika bez identyfikatora logowania do usługa lokalnej jest właścicielem.

  6. Utworzenie certyfikat dla lokalnej usługa.Certyfikat należące do użytkownika, utworzony w poprzednim kroku.

    Uwaga

    Certyfikat musi być zaszyfrowany przy użyciu klucz głównego w bazie danych.Aby uzyskać więcej informacji zobacz CREATE MASTER klucz (języka Transact-SQL).

  7. tworzyć kopię zapasową certyfikat.

    Security noteSecurity Note:

    Tylko tworzyć kopię zapasową certyfikat dla tego użytkownika.Nie tworzyć kopię zapasową lub dystrybucji klucz prywatnego skojarzonego z certyfikatem.

  8. Dostarcza certyfikat i nazwę inicjujący usługa administrator bazy danych dla zdalnej bazy danych.Na przykład certyfikat na nośniku fizycznym, takim jak dyskietki lub dysku CD-ROM, mogą wymieniać umieszczając certyfikat w udziale pliku lub za pośrednictwem bezpiecznej poczty e-mail.

    Uwaga

    Dla programu SQL Server do używania zabezpieczeń Pełne okno dialogowe certyfikat musi być zainstalowany w zdalnej bazie danych, a użytkownik utworzony w kroku 7 musi być użytkownik, który rozpoczyna się do konwersacji.

Example

USE AdventureWorks ;
GO

--------------------------------------------------------------------
-- The first part of the script configures security to allow the
-- remote service to send messages in this database. The script creates
-- a user in this database, loads the certificate for the remote service,
-- grants permission to the user, and creates a remote service binding.

-- Given a certificate for the owner of the remote target 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.  For convenience,
-- the name of the user is based on the name of the
-- the remote service.

CREATE USER [SupplierOrdersUser]
    WITHOUT LOGIN ;
GO

-- Install a certificate for a user
-- 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.

-- When the anonymous option is omitted, anonymous is OFF.
-- Therefore, the credentials for the user that begins
-- are used in the remote database.

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

--------------------------------------------------------------------
-- The second part of the script creates a local user that will begin
-- conversations to the remote service. The certificate for this
-- user must be provided to the owner of the remote service.


-- Create a user without a login for the local service.

CREATE USER [OrderPartsUser]
    WITHOUT LOGIN ;
GO

-- Create a certificate for the local service.
CREATE CERTIFICATE [OrderPartsCertificate]
    AUTHORIZATION [OrderPartsUser]
    WITH SUBJECT = 'Certificate for the order service user.';
GO

-- Make this user the owner of the initiator service.

ALTER AUTHORIZATION ON SERVICE::OrderParts TO OrderPartsUser 

-- Backup the certificate for the user that initiates the
-- conversation. This example assumes that the certificate
-- is named OrderServiceCertificate.
BACKUP CERTIFICATE [OrderPartsCertificate]
    TO FILE = 'C:\Certificates\OrderParts.cer' ;
GO

-- Grant RECEIVE permissions on the queue for the service.
-- This allows the local user to begin conversations from
-- services that use the queue.

GRANT RECEIVE ON [OrderPartsQueue] TO [OrderPartsUser] ;
GO