Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
02-21-2013, 12:59 PM
|
#16
|
|
Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 651
Rep: 
|
You also have a problem with shell metacharacters.
consider your "sudo chmod <arbitrary file>"...
What if that arbitrary file is/or contains '`rm -rf /`'.....
When that gets evaluated it will be reprocessed... with privileges.
|
|
|
|
02-21-2013, 01:26 PM
|
#17
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,822
|
Quote:
Originally Posted by jpollard
You also have a problem with shell metacharacters.
consider your "sudo chmod <arbitrary file>"...
What if that arbitrary file is/or contains '`rm -rf /`'.....When that gets evaluated it will be reprocessed... with privileges.
|
It *COULD*...but again, if the shell script is written to look for/reject such things, it will kick out and die. You've got control of what goes in, and how it's tested.
And there are no perfect solutions to anything like this. There will ALWAYS be holes, as long as there are users. At least in this case, they can only run one shell script, and since it's preceded by sudo, the exact string/command will be logged. If someone does something wrong, it'll be VERY easy to spot, which will be a deterrent. And, if that user can't be trusted with sudo rights, they shouldn't be able to run anything as sudo. There's also a bit of security-through-obfuscation, since the user won't know what's in that shell script, what it looks for/logs, or how it works. Just that it DOES.
|
|
|
|
02-21-2013, 07:06 PM
|
#18
|
|
Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 651
Rep: 
|
None of that is relevant if the user account gets compromised.
BTW, it is nearly impossible to get a shell script to validate strings properly...
Last edited by jpollard; 02-21-2013 at 07:08 PM.
|
|
|
|
02-22-2013, 08:55 AM
|
#19
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,822
|
Quote:
Originally Posted by jpollard
None of that is relevant if the user account gets compromised.
BTW, it is nearly impossible to get a shell script to validate strings properly...
|
Right. Again, this isn't a perfect solution, just the simplest for what the user needs to do.
As far as I know, there ARE no perfect solutions to security, other than locking your computer in a bank-vault, that only YOU can open, and never connecting it to a network or running any software that you, yourself didn't write.
And if a user account gets compromised, you have problems anyway, no matter which account it is.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:57 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|