Hide/Encrypt DB Passwords in Scripts

Everything about Control-M Enterprise Manager Server installation or setup.
Post Reply
User avatar
DocGoo
Nouveau
Nouveau
Posts: 73
Joined: 08 Sep 2010 12:00

Hide/Encrypt DB Passwords in Scripts

Post by DocGoo » 23 Oct 2012 8:43

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

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 26 Oct 2012 10:50

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

User avatar
Sommi
Nouveau
Nouveau
Posts: 7
Joined: 13 Jan 2011 12:00
Location: India

Post by Sommi » 26 Oct 2012 1:18

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.

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 26 Oct 2012 2:52

at the beginin of the script write:

@echo off
or

set +x

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 23 Nov 2012 1:49

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

Post Reply