Configuring Full Dialog Security in SQL Server 2005 Express Service Broker ConversationDecember 8, 2008 In the previous installment of our series dedicated to the most prominent features of SQL Server 2005 Express Edition, we discussed the role of transport-level encryption in securing communication between distributed Service Broker endpoints. As we mentioned at that point, a considerably more flexible mechanism not only provides similar functionality on the dialog level, but also facilitates authorization of individual services. Presentation of its principles will be the main subject of this article. Unlike its transport counterpart, which protects all Service Broker-related
traffic flowing between designated endpoints (constituting entry points for any
number of distinct services collocated on the same SQL Server 2005 instance),
dialog security is associated directly with a specific initiator and target
pair, providing the means for their identification (which, in turn, is the
primary reason for its granular authorization capabilities). As you might
recall, lack of this functionality in earlier examples forced us to loosen up Full dialog security relies on the same concept of hybrid cryptography that
we described when discussing transport-level protection. Asymmetric keys and
their respective certificates serve as identifiers of initiator and target
services participating in a Service Broker dialog (the primary distinction here
is that keys are associated with services, rather than with endpoints). To
accomplish this, the setup involves generating master keys in both databases
hosting respective services and leveraging them to protect locally stored
(manually created) private keys as well as (automatically generated) symmetric
keys responsible for encrypting content of individual conversations (note that
this is different from the configuration of transport-level encryption, which
employed master database for this purpose). Ownership of these private keys need
to be granted (via the Since the description we just provided might sound fairly confusing, we will
guide you through a sample process of configuring dialog-level encryption using
the same distributed setup we have been leveraging in the recent examples (for
the relevant T-SQL statements, refer to our
earlier article). To refresh your memory, our sample environment consists
of two databases ( To start, we will create master keys in databases hosting initiator and
target services using the -- on srvEnt01 USE dbSBEnt01 GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = 't0UGh2gu3$$' GO -- on srvExp01 USE dbSBExp01 GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = '1@mS0$ecReT' GO In the next step, we create a local user in each database that will provide
an association (through authorization) between the symmetric key pair (with its
respective certificate) and the local service. This is necessary since
certificates do not constitute security principals and cannot be directly tied
to services. Users, with their ability to hold certificate authorization and
service-level association (assigned via either AUTHORIZATION or REMOTE -- on srvEnt01 USE dbSBEnt01 GO CREATE USER udbSBEnt01 WITHOUT LOGIN GO ALTER AUTHORIZATION ON SERVICE::[//databaseJournal.com/SQL2005EX/ServiceBroker/svcRecv] TO udbSBEnt01 GO -- on srvExp01 USE dbSBExp01 GO CREATE USER udbSBExp01 WITHOUT LOGIN GO ALTER AUTHORIZATION ON SERVICE::[//databaseJournal.com/SQL2005EX/ServiceBroker/svcSend] TO udbSBExp01 GO GRANT RECEIVE ON qSend TO udbSBExp01 GO In the next article of our series we will present the remaining steps necessary to establish a distributed Service Broker conversation protected with dialog-level security between two instances of SQL Server 2005. |