Bug#248122: nobody-owned files

2006-07-05 Thread Tollef Fog Heen
* Peter Moulder 

| I believe that the reason for this is so that no `nobody'-owned process
| can read/write non-world-accessible files other than its own.  The above
| approach does achieve this result even though it does literally create a
| file as `nobody': no other non-root process can access the file.

That's not strictly true.  Another process running as nobody could
ptrace the wget process and do harm.

I'm going to make it download as nobody and check the md5sums as root
and throw a big warning if the md5sum doesn't match.  This should make
everybody happy, I just need the get a round tuit first.

-- 
Tollef Fog Heen,''`.
UNIX is user friendly, it's just picky about who its friends are  : :' :
  `. `' 
`-  


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#248122: nobody-owned files

2006-07-04 Thread Peter Moulder
On Fri, Jun 30, 2006 at 02:39:01PM -0400, Justin Pryzby wrote:
 On Fri, Jun 30, 2006 at 03:16:27PM +1000, Peter Moulder wrote:
  As root (assuming running with set -e):
  
d=`mktemp -d`
install -d -m 700 -o nobody $d/writable
(cd $d/writable  su nobody -c 'wget ...')
  
  User `nobody' can write into this `writable' directory, but only for a
  process that has already cd'd into it as root before becoming nobody:
  the $d directory is executable only by root.

 I think it is intended that nobody never owns any files.

I believe that the reason for this is so that no `nobody'-owned process
can read/write non-world-accessible files other than its own.  The above
approach does achieve this result even though it does literally create a
file as `nobody': no other non-root process can access the file.

 So the right way to do it probably involves dynamically creating a
 user

I believe that many things would benefit at least slightly in security
from such a facility: even things that don't need to read/write files
would still be less exposed to denial of service by being killed by
other nobody-owned processes.

However, in the short term, I suggest using the only-root-readable
directory approach: it already gets us most of the way there, avoiding
giving the wget executable privileges of an important user like
root (or sys or operator).

pjrm.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]