How to Prompt for a Cassandra password during its reset on Management Server

As per Edge documentation, http://docs.apigee.com/private-cloud/latest/resetting-passwords#resettingcassandrapassword,

to change Management Server’s Cassandra password on a Management Server node, we either use an apigee-server command-line options:

apigee-service edge-management-server store_cassandra_credentials -u CASS_USERNAME -p CASS_PASSWORD

or use config file containing user name and password:

configFile.cfg:

CASS_USERNAME=CASS_USERNAME
CASS_PASSWORD=CASS_PASSWROD

Using the following command:

apigee-service edge-management-server store_cassandra_credentials -f configFile.cfg

In security-conscious environments, especially when working with production installations, there is a minor but important security problem, as in each case, the password is passed to a program as a clear text. If the password is stored in a clear text in a file, there is a danger of a malicious user opening it and seeing the password. If the password is used in a command line, there is a danger of it being logged in a shell history or glimpsed over administrator’s shoulder.

In cases like this, every password changing utility has a switch or option or mode to interactively ask a password from our administrator.

The way to do it in our scenario is to set the contents of the configFile file to:

CASS_USERNAME=cassandra	
echo -n Password:	
read -s CASS_PASSWORD


Then when executing configfile version of the apigee-service,apigee-service will ask for a password without displaying it on your screen.

Version history
Last update:
‎05-03-2017 12:50 PM
Updated by: