SAS/IntrNet 1.2: Application Dispatcher |
SecurityAs you begin to work with the Application Dispatcher, you can enhance the security of your applications using the following tips:
Use a secure Web serverOne security risk involves the network between the Web browser and the Web server. You can improve security by using a secure Web server. A secure Web server uses an HTTPS protocol, which is HTTP with secure sockets. This protocol encrypts all the data flowing back and forth between the browser and the Web server. Unauthorized users are not able to decipher the secure packets of data as they pass through the various computers between browser and server. Use Web server password authenticationBoth secure and nonsecure Web servers can prompt users for their username and password, referred to as authenticating the user. You can set up your Web server so that the Broker CGI requires users to authenticate themselves. Successful authentication causes the Web server to set the environment variable REMOTE_USER to the username entered in the browser authentication dialog window. Depending on your configuration file settings, the Broker passes REMOTE_USER with a name of _RMTUSER to the Application Server, which makes the name available to your Dispatcher program. If your Dispatcher program requires additional security, it can check the value against an observation in a security data set (created by the developer of the Dispatcher program) to determine whether this authenticated user is allowed to use the application. Additionally, you can use REMOTE_ADDR to check for access privileges based on the client's IP number. Restrict access to Application Server control filesThe server control files srvauto.sas, permdata.sas, and reset.sas could pose potential security gaps. To maintain security, you should restrict access to these files. You can restrict access to the server root directory containing these files, restrict access to the files themselves, or both. If you allow unlimited access to the srvauto.sas file, anyone could define a new application library and execute any Dispatcher program. All three control files contain SAS code that is executed sometime during the life of the server. You should secure all three files. Restrict access to application librariesDo not permit unlimited access to existing application libraries. To achieve a high security level, restrict access to the Dispatcher application libraries only to those developers who should copy applications into these areas. Review new or modified code for security risksTo prevent security holes that could be created inadvertently, review any new code or code that has been changed in any way. Look for potential problems described on this page. Avoid using the ampersand reference to macro variablesSAS macro variables contain the data used by Dispatcher programs. Unfortunately, the simplest way to extract this information is the most insecure. If possible, avoid using the ampersand reference to a macro variable, such as color = "&color"; If your application has restricted access so that only a small set of trusted individuals use it, you may be able to ignore this precaution. However, to be on the safe side, you should always attempt to write secure code. In general, data contained in these macro variables can be categorized two ways:
In the case of pure data, values are almost always transferred immediately from macro variables to DATA step variables. The following sample illustrates two ways you could do this: color = "&color"; color = symget('color'); Although these two statements produce equivalent results, the latter is much safer than the former. Using However, you may want to use the value of a macro variable to dynamically create variable names, code statements, or conditional logic. In these situations, take extra care in evaluating your program for security gaps. You could scan macro variable values for unwanted characters and refuse to create and execute the dynamic code if such characters exist. Alternatively, and even safer, you could check the value of a macro variable against a list of valid values before actually using it. Either way, to prevent unwanted macro resolution of embedded code, we suggest using the
proc print data=&dsname; run; However, it is safer to do the following: proc print data=%superq(dsname); run; And even safer to do the following:
%macro checkit; %if %upcase(%superq(dsname))=SASUSER.CRIME or %upcase(%superq(dsname))=SASUSER.ORANGES %then %do; proc print data=%superq(dsname); run; %end; %else %do; /*print an error message*/ %end; %mend checkit; %checkit Use password protected data setsAs an added level of security, you can protect access to your data by using password-protected data sets. This feature of SAS software lets you assign
a password to a data set and then requires you to supply the password to access or modify the data set. You can choose to code the password to the data set in your application or require the user to supply it. If you code the password into your application, ensure that the user cannot view that password by returning the SAS log to the browser. To prevent this, see the following sections describing the use of SCL or
Use SCL or compiled macro codeOne feature of the Application Dispatcher lets you view the SAS log. This helps when developing an application; however, it creates a potential security risk in a production level application. Programs of type .SAS, .SOURCE, and .MACRO all submit statements that appear in the log. SCL (SAS Screen Control Language available with SAS/AF software) statements do not appear in the log. You can accomplish many of the same tasks in SCL that you can by using these other program types. SCL is the most secure program type. If you create your Dispatcher program with SCL and the user attempts to return the SAS log, your program statements do not appear. Additionally, SCL is more secure because it is a compiled language. Compiled macros (.MACRO program types) share this feature. Using SCL lets you compile the program and actually delete the readable source, preventing someone from reading the program statements even if they gained access to the SAS catalog on the Application Server machine. Note that running the .MACRO entry prints the original source to the SAS log if the
For information on other ways to protect your source, see the following section that describes Use
|
SAS/IntrNet 1.2: Application Dispatcher |