LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-20-2017, 01:02 AM   #1
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Question Suppressing Password Value from Command Line while Keeping Other Output Visible


Hi,


Here is an XML that is parsed to execute the commands (on the console) shown below.

My to-the-point question is: When password is passed as an argument to the command vmmanager, it is shown up in plain text format ( or as it is passed) in the deployment tool that uses the XML to execute the commands on the remote console. To suppress the password data, I am using stty -echo just before it and then re-enabling it.

However, the reviewer is not looking happy with this approach to suppress the password. There is a point in his comment that disabling echo also suppresses output from the command and if there is anything that needs attention for troubleshooting purpose, will be missed altogetherly.

I did check the vmmanager command which is a script and is calling a Java program. There is no help document to suggest if a file containing the password can be passed to it and the other parameters cane be passed at the command line as they are currently.

So, is there a way to suppress the vale of only one parameter while other parameters' values are okay to be shown up at the command-line?



Code:
 stty -echo
      /opt/vmmanager/bin/vmmanager --url "https://@{set_variable_vchost}/sdk" --username "@{set_variable_vcuser}" --password "@{set_variable_vcpass}" --operation "ovfImport" --hostIp "@{set_variable_vcblade}"  --ovf "@{select_file_ovffile}" --vmName "@{set_variable_vmname}" --properties "@{select_file_deployfile}" --datastore "@{set_variable_vcdatastore}" --network "@{set_variable_vcpgmain}" --vmFolder "@{set_variable_vcpath}";
      stty echo
 
Old 04-20-2017, 07:42 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by devUnix View Post
Hi,
Here is an XML that is parsed to execute the commands (on the console) shown below.

My to-the-point question is: When password is passed as an argument to the command vmmanager, it is shown up in plain text format ( or as it is passed) in the deployment tool that uses the XML to execute the commands on the remote console. To suppress the password data, I am using stty -echo just before it and then re-enabling it.

However, the reviewer is not looking happy with this approach to suppress the password.
Not surprised one bit there.
Quote:
There is a point in his comment that disabling echo also suppresses output from the command and if there is anything that needs attention for troubleshooting purpose, will be missed altogetherly.
...and that anyone who looks at the script can see the password to do whatever they want with the virtual machines...
Quote:
I did check the vmmanager command which is a script and is calling a Java program. There is no help document to suggest if a file containing the password can be passed to it and the other parameters cane be passed at the command line as they are currently.

So, is there a way to suppress the vale of only one parameter while other parameters' values are okay to be shown up at the command-line?
No, there isn't. Just because this uses some different variables/values as input, doesn't make the scripting different. Apply what you've been told/shown after asking about scripting here for the past seven years.

Basic system security says you don't put user names/passwords in scripts, ever. But you mention this vmmanager script and don't tell us where you got it (is this the IBM one? Oracle? Some other?). You say it's calling a Java program....what is the name of that program?
 
Old 04-27-2017, 01:36 AM   #3
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Original Poster
Rep: Reputation: 59
The XML tool they use has a feature that can hide the stdout wherever required. Just before running the actual command, I am echoing the command with the password being masked as "???" so that we can check later what we might have run (the command line) and run it later to reproduce any issue. Besides, using the XML tool that command line is being written to a separate script on the fly and being executed. Well, I have been able to achieve what was needed. However, it is not clear yet how their XML tool works or does things.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppressing password echo is harmful zagam Linux - Security 8 10-06-2013 10:49 PM
help suppressing output from external execution in Ruby hedpe Programming 1 12-03-2007 03:32 PM
Suppressing the output from tar marri Programming 2 05-03-2005 03:19 AM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
suppressing boot output to terminal aethereal Linux - Newbie 2 12-23-2001 08:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration