Launch security is automatically applied by the COM runtime when a server application is started due to a remote object creation request. After the request has been received from a client, the COM runtime obtains all the necessary security parameters from the registry if the creating process didn't specifically specify security parameters.
There are two default activation settings in the registry that have machine-wide effect. They are both named values under the same key.
HKEY_LOCAL_MACHINE\Software\Microsoft\OLE
EnableDCOM = <value>
The value is a string (
) and can be a REG_SZ
or an Y
. A value of N
enables remote activation of COM servers on this machine, any other value disables it. Even when remote activation is disabled, local activation is still allowed and is governed by the specific permissions in the Y
key of each class and the default settings in the LaunchPermission
key.DefaultLaunchPermission
HKEY_LOCAL_MACHINE\Software\Microsoft\OLE
DefaultLaunchPermission = <value>
The
value is of type DefaultLaunchPermission
and consists of a binary ACL of the principals (accounts or groups) that can have launch classes on this system. The value can be overridden by specifying a REG_BINARY
value in the registry for a particular COM object. By default, the following principals are given 'allow launch' permissions:LaunchPermission
On a per-class basis, security configuration settings are stored as a set of named values under the following key:
HKEY_LOCAL_MACHINE\Software\Classes\AppID\
{AppID_value}\
<named_value> = <value>
For a class, the
is a GUID that appears, as a string, under the AppID_value
named value under the CLSID key of the class. The string AppID
is used as a subkey under {AppID_value}
....\Classes\AppID
For an executable, the
is the name of the module (e.g. AppID_value
). Under the myapp.exe
key there's a {myapp.exe}
named value REG_SZ
with the AppID associated with the executable.AppID
The launch permissions are set in the named value
. The type and content of the value is the same as in the LaunchPermission
. Other named values under the same key are:DefaultLaunchPermission
AccessPermission
specifying permissions to access running instances of the class. It's used only if the client doesn't call CoInitializeSecurity()
.RunAs
specifying that the server should run with the security context of the specified user.LocalService
specifying that the server is a Windows NT service.ServiceParameters
specifying the parameters to be passed to the service on invocation.RemoteServerName
specifying the remote machine on which the server will be activated by default, if the client hasn't programmatically requested otherwise (by specifying, for example, a COSERVERINFO
parameter to CoCreateInstanceEx()
).
You can change the default settings through the
utility.Dcomcnfg
The procedure is similar for setting the security parameters of a specific application.
Other than configuring DCOM security parameters through registry editing, it's also possible to have fine-grain control over these parameters using programmatic means. Let's examine some of the Win32 APIs and COM object interfaces associated with DCOM security control.