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 02-23-2011, 02:07 PM   #1
linux_evangelist
LQ Newbie
 
Registered: Oct 2010
Posts: 14

Rep: Reputation: 0
linux chroot safe to use for sandbox?


I've read a lot of articles suggesting that you use chroot to create a sandboxed environment for users. Then I came across this discussion, and this article.

Is this still a valid security concern? (These are pretty old articles.) If so, here's why I'm struggling with the concepts presented:

If a user's chroot directory is actually /home/sam/jail, and the user creates a subdirectory of that, say /home/sam/jail/break then from the user's perspective, the following:

chroot ./break
cd ..
cd ..
cd ..
...

should only get the user as far as /home/sam/jail, right?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-23-2011, 04:13 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 linux_evangelist View Post
If a user's chroot directory (..) right?
As the first document stated (and as you can test yourself) breaking out of a chroot means getting or keeping the capability ('man capabilities') that allow one to call chroot. CAP_SYS_CHROOT is not something an unprivileged user has, ergo he can not break out of the chroot using this method. What you will frequently see a system service do is start as root, initialize the process like binding to a network port et cetera, change directory and then drop root rights running on as a lesser privileged user. As long as the daemon process drops root capabilities it can not break out of the chroot using this method too.
 
2 members found this post helpful.
  


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
Using Linux to sandbox USB drives in Windows ShanxT Linux - General 2 01-14-2009 03:23 AM
LXer: Entering A Safe Mirror When Logging In With Unionfs And Chroot LXer Syndicated Linux News 0 06-29-2007 11:01 AM
sandbox application for SUSE linux? izquierdista Linux - Software 1 02-10-2007 03:20 PM
[SOLVED] PHP safe mode, Chroot, Apache, Gallery gypsy_rabbi Linux - Security 2 10-06-2004 03:45 PM
sandbox execution (compare to: chroot)? prell Linux - Software 1 09-23-2004 02:03 PM

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

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