Page 1 of 1

Hide/Encrypt DB Passwords in Scripts

Posted: 23 Oct 2012 8:43
by DocGoo
Hello,

How can we set it up so that developers do not have to hard code logon and passwords in scripts. We bounce between Dev, UA, and Prod using Oracle and SQL Server.

Thank you,

Goo

CM V.6.4.01
Oracle
SQL server

Posted: 26 Oct 2012 10:50
by mauriziog
We do this:
1. in the script switch off the echo of the command so the passwords was not reported on the sysout:
@echo off on batch scripts
set +x on on shell scripts

2. put parameters on the scripts substituting user and passwords entry.
something like:
batch
SET USR=%1
SET PWD=%2

shell
Usr=$1
Pwd=$2

3. Put user and pwd in the set panel of the job USING THE LIBMEMSYM manner.

4. the file and directory in witch is saved the LIBMEMSYM that conten password are protected from users access.

I Advice also to use for the path of the LIBMEMSYM file to use a global variable so:
- is not see in the job definition the local of the file
- you can change it without redefining all jobs that use them

Have a good day

Posted: 26 Oct 2012 1:18
by Sommi
Can any one tell me what needs to be done to do the same if job is getting submitted on a remote host switch off the echo command for remote unix boxes.

Posted: 26 Oct 2012 2:52
by mauriziog
at the beginin of the script write:

@echo off
or

set +x

Posted: 23 Nov 2012 1:49
by philmalmaison
Hi,
Doesn't need it for Controlm server (SQL works), and you can use -pf file for Controlm/EM utilities.
Or
use a .<file> with user and password just in read for EM user and export that file to use them.
Regards,
Philmalmaison