Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Protection

Status
Not open for further replies.

ps1881

Technical User
Oct 9, 2006
2
US
Hello all,

I was wondering if anyone knew of a way to password protect a SAS program. I know that there are ways that you can protect a data set, but cannot find any way to protect a written program. It is needed as a quality control so that only those qualified in the company can edit that particular program. Kind of how you can protect an Excel spreadsheet.

I greatly appreciate any help that you could provide.

Thanks.
 
ps1881 - Sorry, as far as I'm aware there is no foolproof way to password protect a SAS program. There are ways to use passwords within a program and protect them with PROC PWENCODE, however that doesn't sound like what you're after. Your best (and possibly only) solution is to speak to your sysadmins about setting up access privileges to the file to prevent unauthorised access via the OS.
Security of SAS programs has always been an issue, particularly programs accessing remote databases with usernames and passwords.
In the SAS program itself, you could code in some macro code to check the identity of the user running the program, however this is easy to circumvent as the code is all out in the open and can easily be copied elsewhere, edited and re-run. Your best bet I think is using the operating system to restrict access to the files themselves.
For extra security I would also include some reporting in the program which logs when it was run and by whom, this can be concealed in a macro call so that it's not obvious what is happening, and can be set up to e-mail someone responible if there's an unauthorised user running the program.
 
Why not use SourceSafe to manage your code? There are free equiv. programs as well. These applications manage versions of your code and can even lock them so that only you or a 'known' person could view them.

As I wrote this suggestion I thought of another way that you could secure your code. You could save them in SAS catalogs as compiled macros.
They can be run from your system by adding their path to the sasautos option.

The easiest way to do this would be to put the code in a macro wrapper.
Code:
%macro your_macro_name /store;

  SAS code here;
%mend your_macro_name;

you must set your library up and set the mstored option to work.
Code:
 libname mylib 'SAS-data-library';
 options mstored sasmstore=mylib;

You need to save your SAS program code (somewhere) or you will not be able to change the macro if it needs modification.
Klaz
 
Hi Klaz,
The only issue with that is that the code is hidden rather than protected (unless you could then password protect that library?) which is OK, but won't stand up to a capable programmer that wants to be naughty, so it depends on the rigour that the powers that be need in order to consider the code "safe". I had numerous discussions at a previous place I worked and we were never able to come up with a nethod that couldn't then be defeated some way. Even password protecting the dataset doesn't guarantee security as the password needs to be put into a program somewhere in order for it to be used, thus opening it back up again...
Have you managed to come up with something foolproof?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top