> I'm writing an SSL daemon that for security reasons does a chroot(2) to its own > little root. When chrooted, it obviously cannot open /dev/random or /dev/urandom > when I do SSL operations. Is there a way I can open these for OpenSSL before > chrooting, or do I have to recreate them under my root directory?
I strongly suggest either * creating /dev/*random devices inside your chroot area s.t. you can chroot immediately and still have access to the randomness, or * opening /dev/*random, chrooting, and keeping open the file descriptor to be used by RAND_add as needed. The general theory of privilege separation and chrooting is to do as little with extra privs or outside the chrooted area, so get what you need and chroot as fast as possible. Calling RAND_add(), which is probably safe because it's not that much code, is still something you'd be better off doing after you've already restricted your process as much as possible. -- Brian Hatch What do you want? Systems and Who are you? Security Engineer Why are you here? http://www.ifokr.org/bri/ Every message PGP signed
pgp00000.pgp
Description: PGP signature