On Mon, 15 May 2000 [EMAIL PROTECTED] wrote:

> On Sun, 14 May 2000, Charlie Brady wrote:
> 
> > 
> > On Fri, 12 May 2000 [EMAIL PROTECTED] wrote:
> > 
> > > This would likely include:
> > > 
> > > 1. A Daemon re-written in 'C' rather then perl. (primarily for security
> > >    reasons)
> > 
> > Really? Your C compiler does automated taint checking for you? You see a
> > much higher proportion of security problems with perl programs cf C
> > programs?
> 
> 
> It is more a case of what a well coded daemon should do, that is difficult
> in Perl.  In this case I would expect the daemon to take the following
> measures on startup:
> 
> 1. Dissasociate from the controlling terminal. (2 * fork)

No problem.

> 2. Close *ALL* open handles. (call to sysopt, multiple calls to close)

This I'm not sure about.  Unless you've started the program with
redirections:

close STDOUT; close STDERR; close STDIN;

> 3. Destroy the runtime environment && Re-create what is needed.
>       (To stop bad/unwanted environment vars being passed to called
>        programs - namely the virus scanners.)

%ENV = ();

> 4. Open a channel to Syslog.

use Sys::Syslog;
# etc.

> 5. SU to a non-privileged user.

$< = $> = $newuid; # or $UID = $EUID = $newuid; # if you like use English
$( = $) = $newgid;

> 6. chroot with a minimal runtime environment.

chroot $foo; # perl builtin

> 
> Most of these can be done to some degree with perl, barring the chroot
> (and possibly the suid - anybody know how to do this in perl ?).
> 
> The problem here being a complete perl runtime would be needed in the
> chroot environment.  As the entire purpose of a chroot prison is to
> provide a restrictive environment without any of the tools a hacker would
> find useful - this defeats the purpose of it.

Once the perl script has been compiled into the internal form there
shouldn't been any need to access any external files.

> Security is always a concern and MUST be designed in from day 1.  It can
> not be retrofitted into a package - as people have found time and time
> again.

This is true, and programs built with that in mind have still had security
problems.  Perl provides some protection against some mistakes (though you
should still be careful.)


--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to