LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-09-2010, 04:48 PM   #1
QuantSuff
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Rep: Reputation: 0
Question Howto? limited, secure, interactive shell (with sudo on RHEL). Impossible?


You don't have to tell me - I already know trying to do sudo in a chrooted environment is a bad idea.
But is it even possible? I don't have a choice.

Requirement:
A (commercial) inventorying script needs to interactively log in to a number of RHEL4 and RHEL5 servers and run these three commands
  • sudo /usr/sbin/lsof
  • sudo /usr/sbin/dmidecode
  • /sbin/ifconfig

We are not going to enable SELinux on all these servers.

Is there any other way to do this securely? would suid be better/worse than sudo?

I need to secure this as much as possible. rbash is trivially defeated: http://www.symantec.com/connect/arti...ing-unix-users

I tried to avoid manually building a chrooted environment by trying jailkit http://olivier.sessink.nl/jailkit but I couldn't get it to work.

So I guess my only option is to try to manually hack together a chroot. Any favorite cookbooks? Anyone do this supporting sudo?

Any suggestions?
Any suggestions on another approach?
Anybody gotten jailkit to work on RHEL/Centos to provide an interactive shell?

Thanks,
QuantSuff
 
Old 08-09-2010, 05:45 PM   #2
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 QuantSuff View Post
Any suggestions on another approach?
SNMP could provide the data as could Xinetd as could a CGI. Xinetd example:
Code:
# description: Xinetd output of 'lsof'. 
service lsof
{
        disable         = no
        type            = UNLISTED
        protocol        = tcp
        port            = 10000
        socket_type     = stream
        wait            = no
        user            = root
        log_on_failure  += HOST 
        server          = /usr/sbin/lsof
        server_args     = -P -w -n
        only_from       = 1.2.3.0/24
}
So if the inventory script isn't configurable wrt usable methods then the problem isn't getting the data but how the script demands input. IMHO.
 
  


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
How to use SSH (Secure Shell Host) in RHEL. RMLinux Linux - Newbie 9 12-01-2008 08:02 PM
Limited 'sudo' commands Casket Linux - Security 1 10-23-2007 02:05 AM
Cannot get into Interactive Mode on RHEL-Itanium Marc Thoelen Linux - Enterprise 1 04-02-2007 09:45 PM
interactive and non-interactive shell linuxjamil Programming 3 09-03-2006 08:42 PM
getting rid of interactive mode in MDK 10 howto? Lleb_KCir Linux - Software 10 04-21-2004 02:58 PM

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

All times are GMT -5. The time now is 08:08 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