News for hackers. Stuff that matters.
Re:Securing Ubuntu by StavrosK on Sunday January 20, 2013 @11:37AM (#5087313)
And why a chroot instead of just a dedicated user? If they can get root, it's game over anyway, isn't it?
Re:Securing Ubuntu by maaku on Sunday January 20, 2013 @12:08PM (#5087392)
I don't think chroot does what you think it does.
Re:Securing Ubuntu by StavrosK on Sunday January 20, 2013 @12:10PM (#5087398)
What do you think it does?
Re:Securing Ubuntu by rjbond3rd on Sunday January 20, 2013 @02:03PM (#5087747)
Changes the filesystem root to be inside a certain folder.
Re:Securing Ubuntu by StavrosK on Sunday January 20, 2013 @02:17PM (#5087792)
Yeah, so what's the point? If you have a separate user, you can't access other users' files anyway, unless you have root. You can access the system files, but there should be nothing of much interest in there anyway.
Re:Securing Ubuntu by gvb on Sunday January 20, 2013 @02:59PM (#5087961)
You should have only the minimum necessary commands and libraries in your chroot jail which minimizes the attack surface. For instance, I use chroot with rssh to only allow sFTP/scp/rsync and not allowing chroot users to get to a shell prompt.

In my chroot /usr/bin, there are only two files (rssh, scp). In my chroot /lib there are only 16 files.

Compare to:

1670 in /bin /usr/bin /sbin

50507 in /lib /usr/lib /usr/lib64

Re:Securing Ubuntu by munin on Sunday January 20, 2013 @04:29PM (#5088325)
Unless some of those files are setuid root ... what does it matter? Your chroot jail is still going to have a very rich attack surface - the kernel.
Re:Securing Ubuntu by jiggy2011 on Sunday January 20, 2013 @05:21PM (#5088496)
I guess to prevent an application (e.g a web server running as a non root user) from easily reaching outside and running arbitrary shell commands or reading files.

For example if you have something horrible like a PHP script that does: echo system($_POST['whatever']) you at least should try and prevent it from doing "ls" and "cat" to start exploring the filesystem.

Re:Securing Ubuntu by perlgeek on Sunday January 20, 2013 @03:00PM (#5087967)
You're correct. chroot works on a per-process basis by adding a relative fs root into the process (or process table? dunno) memory. If you're root, you can change it back to /.
Re:Securing Ubuntu by throwaway2048 on Sunday January 20, 2013 @12:52PM (#5087536)
why not both? After chrooting use setuid()/setguid() for an individual user.
Re:Securing Ubuntu by StavrosK on Sunday January 20, 2013 @12:54PM (#5087544)
Because of the added complexity.