
Notification Services Security Model
Notification Services has an engine that runs hosted event providers, generators, and distributors. It also can have client applications that submit events or manage subscriptions.
The login accounts used by the engine and by client applications use either Windows Authentication or SQL Server Authentication to access SQL Server; they gain database access though database user accounts, and then obtain the necessary permissions on instance and application databases through membership in Notification Services database roles.
The following illustration shows the database roles that provide the required permissions for each engine component, for a non-hosted event provider, and for a subscription management interface.
Database permissions are assigned to the database roles. The database users for individual components obtain their required permissions by membership in the correct role:
-
Accounts used by event providers obtain permissions through membership in the NSEventProvider database role. The event provider host runs hosted event providers. Non-hosted event providers are independent applications.
-
Accounts used by generators obtain permissions through membership in the NSGenerator database role.
-
Accounts used by distributors obtain permissions through membership in the NSDistributor database role.
-
Accounts used by subscription management interfaces obtain permissions through membership in the NSSubscriberAdmin database role.
If an engine runs hosted event providers, generators, and distributors, its account can obtain all of the required permissions through the NSRunService database role.
For information about implementing security for Notification Services, see Securing Notification Services.
Additional Accounts for Condition Actions
In Microsoft SQL Server 2005, Notification Services has a new subscription rule feature. Event-driven rules and scheduled rules can now use condition actions, which allow subscribers to define richer subscriptions using user-defined query clauses.
Because subscriptions based on condition actions allow for user-defined query clauses, the data available to the query should be limited. For this reason, you must define a database user that condition actions run under. The database user should only be allowed to query tables and views that contain input data.
The generator fires the rules that contain condition actions. However, the condition action queries are further constrained by the specified database user. You specify the database user when you define a Notification Services application.
For more information about condition actions, see Defining Condition Actions.
Windows Permissions
In addition to database permissions, some components also require additional Windows permissions:
-
The account used to run the Notification Services engine must be a member of the SQLServer2005NotificationServicesUser$ComputerName Windows group. This provides access to the Notification Services binaries used to run the service. If using the NS$instanceName Windows service to run the engine, Notification Services adds the service account to the SQLServer2005NotificationServicesUser$ComputerName group when you register the instance.
Any other components that require access to the Notification Services binaries may also require membership in the SQLServer2005NotificationServicesUser$ComputerName group. The Notification Services assemblies and resources are in the global assembly cache (GAC), and are available without membership in this group.
-
Event providers sometimes require permissions in folders and other databases. For example, a file system watcher event provider needs read access to an XML Schema Definition (XSD) file that describes the event schema and read and modify access to the folder where event files are dropped. SQL Server event providers need access to the database tables or views that are used as event sources.
-
Distributors need permissions to deliver notifications to the delivery service, such as a Simple Mail Transfer Protocol (SMTP) server, Short Message Service (SMS), Web server, or file system. Distributors that use the XSL transform (XSLT) content formatter also need access to the XSLT files.