LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-14-2007, 01:51 PM   #1
vm_devadas
Member
 
Registered: Sep 2006
Location: India
Distribution: Redhat and Suse
Posts: 75

Rep: Reputation: 15
password and ps command


We have some Linux ETL DataStage servers
There is a dsjob api that is built in the tool to run the ETL jobs.

The dsjob api gets the parameters passed to it as an option and we are passing the decrypted passwords as parameters to it.

The passwords are showing up when we grep for the process using the ps.

The command we run is ps -ef |grep dsjob.

SLES-9 Linux instance output:

dstage@eccas703:/ford/thishost/u/dstage
$ps -ef |grep dsjob
dstage 2847 6705 0 09:42 pts/5 00:00:00 bin/dsjob -run -mode NORMAL -param t_ora_tablename a -param t_ora_cpm_uid b -param t_ora_cpm_pwd abc -param t_ora_cpm_sid d -wait sandbox HeapAllocError

dstage 2896 2784 0 09:42 pts/8 00:00:00 grep dsjob


We would like to know if there is a setting at the os level that prevents this scenario?
 
Old 09-14-2007, 02:19 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by vm_devadas View Post
We would like to know if there is a setting at the os level that prevents this scenario?
Unfortunately, the passing of command-line parameters is, by the fundamental design of the operating system, available to all processes (it lives in the /proc filesystem). Incidentally, one might try to circumvent this by passing important information in environment variables, but this info is also available in /proc. The only way (with linux) to circumvent this is to disable the mounting of /proc at boot. Alternately, you might make it available to a select group. Then, only that special group will get any information from ps.
 
Old 09-22-2007, 02:40 AM   #3
jdiggitydogg
Member
 
Registered: Sep 2007
Posts: 42

Rep: Reputation: 15
yeah, like stated above, passing in as a environment variable won't work. the shell will resolve environment variables prior to executing your application...so the password will still show up on the ps listing...

example:
export TEST=100
sleep $TEST &
ps -ef


what do you see?

to use environment variables, the application would need to be written to use them. and eventhough they can be found in the proc filesystem, they are a little more hidden than your ps listing.

another long-shot is to see if your application will accept something from standard input. then you could put your password into a file and redirect it to the application.

can your application use a config file instead of command line arguments? if so, use a config file and lock down the file's permissions good.

another option is to change the permissions on the ps (& related commands) themselves. by default those apps are world executable, but you could make them so only owner and/or group can execute them. however, users could still go through the process ids in /proc and find the command line used...but that requires more work.

finally, you could change the permissions on /proc. its just a directory (or so it seems) & you could modify permissions so only root can enter. however, this will affect other apps that require information from /proc. for example, this will break ps.

Last edited by jdiggitydogg; 09-22-2007 at 02:42 AM.
 
Old 09-22-2007, 02:56 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by vm_devadas View Post
We would like to know if there is a setting at the os level that prevents this scenario?
Not by default, but the GRSecurity kernel patch allows for process separation, meaning only root and the user will have access to the user's process details, not other unprivileged users. It's not the only thing GRSecurity fortifies, see their website docs for details.
 
  


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
specifying password in the ssh command alix123 Linux - Software 2 06-03-2007 04:00 AM
Changing Usernames/password command? wardialer Linux - Security 7 02-26-2005 12:15 AM
How to include password with su-command? Ollir Mandriva 2 08-16-2004 05:17 AM
Pass password with ssh command BruceC Linux - Newbie 2 05-12-2004 08:55 AM
going to root without password thru command line amanjsingh Linux - Newbie 6 03-29-2004 11:38 PM

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

All times are GMT -5. The time now is 12:51 AM.

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