Windows Client Development |
This section discusses security issues that arise when developing Windows client applications that attach to IOM servers.
The SAS Server maintains two distinct security contexts, ClientUserID and ServerUserID. ServerUserID is the context under which the SAS server process is running. All calls from the SAS operating system process into the host operating system are made using the security context of the ServerUserID. All files are created under the ServerUserID.
The ServerUserID remains fixed for the entire lifetime of the SAS operating system process. It cannot be changed once the process has been created.
The ClientUserID context is used by SAS for checking authorization prior to actually making a system call. Once the SAS server has determined that the ClientUserID is authorized to perform an operation (usually open/read/write) against a resource (usually a file), the actual call goes through to the operating system using the ServerUserID.
You will have a more secure environment if both the ClientUserID and the ServerUserID are the same. In most cases, they will be the same. However, it is possible to configure the system to make these contexts different.
There are several points to consider if the ServerUserID is different from the ClientUserID:
ClientUserID and ServerUserID are specified differently depending on whether you are using COM/DCOM or the IOM Bridge for COM to communicate between client and server. Both methods are discussed in the following sections.
When establishing a connection through the IOM Bridge for COM, a client provides a Login name and Password that the IOM server uses to establish the ClientUserID. This ClientUserID will remain fixed for the duration of the lifetime of the Workspace.
When using the IOM Bridge for COM, the SAS server process is launched by the spawner.
The IOM Bridge for COM supports encryption of network traffic between the client and the IOM server. Weak encryption support (through the SASPROPRIETARY encryption algorithm) is available with base SAS software. Stronger encryption requires a license to SAS/Secure on the server machine.
On the Windows platform, the SAS/Secure license allows the encryption algorithms available through the CryptoAPI to be used. On other platforms, encryption algorithms are included in the SAS/Secure software. See Using the Workspace Manager for details on how to specify which encryption algorithm to use and how to specify what gets encrypted.
Note: The SAS/Secure Client for Windows must be installed on the Windows client machines to use the CryptoAPI. (See Windows Client Installation for more information.)
On every IOM method call, the SAS server attempts to impersonate the caller. If this impersonation is successful, then the ClientUserID will be set to the caller's UserID. If not successful, then the ClientUserID will default to the ServerUserID.
Permission to impersonate must be granted by the client application by calling CoInitializeSecurity, or by setting entries in the Windows registry (on the client).
Note: Client-side registry settings are ignored for applications that call CoInitializeSecurity.
The client-side Windows registry settings are configurable with the Windows utility dcomcnfg). In dcomcnfg, the ImpersonationLevel must be at least Impersonate, and the AuthenticationLevel must be set to a value other than None. The ClientUserID may change with every call, based on who is making the call (This is not possible using the IOM Bridge for COM).
Please see Setting up a COM/DCOM Server for more information on using the dcomcnfg utility to configure DCOM settings.
Notes:
On Windows NT, the COM Service Control Manager (SCM) is responsible for launching COM and DCOM processes. The SCM reads values from the Windows registry to determine which identity to use when launching a process. These registry settings are configured using the Windows dcomcnfg utility on the server.
The ServerUserID is set under the identity tab for the properties of the SAS Workspace (Ver 1.0) application. (See Setting Launch Policies per Application for specific details on how to get to this tab.)
You can choose one of the following options for the identity to use to run the IOM server (the ServerUserID):
For DCOM, encryption is enabled by using an AuthenticationLevel of Packet Privacy.
Here is a quick summary of the authentication levels available. These must be set on both the client and server machines. The stronger of the two is selected. For more details, consult Microsoft documentation.
The following is a summary of the impersonation levels available. The value set on the client machine determines the impersonation level used for the connection. The impersonation level set on the server machine is not used.
This visual basic example retrieves the ClientUserID and the ServerUserID from the IOM server.
' This example prints both the client userid and the server userid. ' Create a local COM connection set obSAS = obWSMgr.Workspaces.CreateObject("MyServer", VisibilityNone, Nothing, "", "", sInfo) ' Get the host properties obSAS.Utilities.HostSystem.GetInfo swInfo, hwInfo debug.print "ServerUserID: " & swInfo(SAS.HostSystemSoftwareInfoIndexServerUserID) debug.print "ClientUserID: " & swInfo(SAS.HostSystemSoftwareInfoIndexClientUserID) ' Under COM on NT, the ServerUserID will always report the same thing as the ClientUserID, ' even though they may be different. This is fixed by Windows2000.
Here are a few additional points to consider when developing client applications:
Windows Client Development |