Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
I'm somewhat new to this, and I'm setting up apache to run in a chroot jail. It runs as user apache, and most files in the chroot directory were of course owned by root when I first created them. So I have three questions:
Does chowning the chroot directory's files to user nobody, as opposed to root, buy me any security (bearing in mind again that I run as user apache, not as nobody)?
If I forward ports 80 and 443 to some other ports (above 1024), and then start apache as user nobody instead of root (which would then fork as user apache), would that buy me any extra security?
If someone has a few minutes, could you please look at the following permissions lists (these are the files inside my chroot directory, pared down with wildcards to save any kind soul who might look at them for me) and tell me if I can cut down the permissions any further?
i don't see why you'd want to cut them down, theirs nothing in there .... i don't think you can cut em down further anyways, I'm surprised its not already to cut down actually
anyways:
1) no - owning files is only important to judge permissions, if you have them setup right anyways this doesn't make a bit of difference who owns the file
2)no , wouldn't it break the web sites, or at least be confusing .. plus at most it would only obscure things, running a secure apache is whats important if its for the public
3) no
1. It does matter a little bit: you wouldn't, for instance, want the httpd executable to be owned by the apache user. An intruder would be able to overwrite it and the next time you run the parent httpd (which runs as root unless you do what I'm talking about in (2)) you'll be running broken code as root. My question was whether root (the default owner of all these files including httpd) v. nobody makes a difference.
2. No, it doesn't break the websites (because the port forwarding goes through iptables's nat and is transparent to web clients: http://en.tldp.org/HOWTO/TransparentProxy-5.html). So the point isn't obscurity, it's being able to run the parent apache process as a non-root user (which you can't do if you're binding to ports below 1024).
Are you providing symlinks out of the chroot jail? I heard that was the way to get out of chroot, but I have never seen it done, so...
Is it possible to take the setuid bit from the executables? Because than even if for some reason you would get bufferoverflowed it wouldn't be possible to change back to root.
Or isn't it a concern, because it forks and it loses the setuid bit in the child processes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.