From: "Bostjan Skufca (at) domenca.com" <bostjan.skufca@domenca.com>
To: Joao Schim <j.schim@netmaniacs.nl>
Cc: linux-admin@vger.kernel.org
Subject: Re: chroot of apache's cgi execution
Date: Mon, 19 Jan 2004 15:02:24 +0100 [thread overview]
Message-ID: <200401191502.24458.bostjan.skufca@domenca.com> (raw)
In-Reply-To: <20040119104503.68480edc.j.schim@netmaniacs.nl>
To clarify what i would like to achieve i paste post i sent to modperl mlist:
--------------------------------------------------------------------
Hello all,
is there a way to chroot execution of perl script within apache?
Basically what I would like to achieve is like this:
There are users on the system and these users have their homedirs - as usual.
Within these homedirs they have domain directories which hold files for
assigned domains and every domain dir has it's own cgi-bin directory, eg:
/home
/home/user01
/home/user01/domain01.com
/home/user01/domain01.com/cgi-bin
/home/user01/domain02.com
/home/user01/domain02.com/cgi-bin
/home/user01/domain03.com
/home/user01/domain03.com/cgi-bin
/home/user02
/home/user02/domain04.com
/home/user02/domain04.com/cgi-bin
/home/user02/domain05.com
/home/user02/domain05.com/cgi-bin
/home/user02/domain06.com
/home/user02/domain06.com/cgi-bin
/home/user02/domain07.com
/home/user02/domain07.com/cgi-bin
etc.
Now i would like to chroot execution of cgi's for domain01, domain02 and
domain03 to /home/user01 and likewise for domain04, domain05, domain06 and
domain07 to /home/user02.
Therefore apache's srm.conf entries should look somewhat like this (note the
CGIChroot directive):
<VirtualHost *>
CGIChroot /home/user01
DocumentRoot /home/user01/domain01.com
ServerName domain01.com
CustomLog logs/domain01.com.access.log combined
</VirtualHost>
<VirtualHost *>
CGIChroot /home/user02
DocumentRoot /home/user02/domain04.com
ServerName domain04.com
CustomLog logs/domain04.com.access.log combined
</VirtualHost>
Now my question: is this by any means possible to achieve? Could invocation of
perl be done through some setuid root program which would chroot to given
directory first (assuming perl and neccesary libraries are installed in every
user's homedir), drop privileges back to apache-default or whatever specified
and execute the cgi script?
--------------------------------------------------------------------
On Monday 19 of January 2004 10:45, Joao Schim wrote:
> No, of course it doesn't,
>
> We don't want to run all httpd children as root do we ?
> Then the safety level gained with chroot() is lost by the
> fact you run as root. chroot() is easily broken by root
> anyway, so you end up with a really false sense of security.
>
> Regards,
>
> Joao
>
> On Mon, 19 Jan 2004 03:09:33 +0100
>
> "Bostjan Skufca (at) domenca.com" <bostjan.skufca@domenca.com> wrote:
> > it doesn't fit per-vhost requirement
> >
> > On Saturday 17 of January 2004 13:33, Joao Schim wrote:
> > > Maybe this can help you ?
> > >
> > > http://www.devet.org/apache/chroot/
> > >
> > > Kind regards,
> > >
> > > Joao Schim
> > >
> > > On Sat, 17 Jan 2004 04:45:24 +0100
> > >
> > > "Bostjan Skufca (at) domenca.com" <bostjan.skufca@domenca.com> wrote:
> > > > Hello all,
> > > >
> > > > can anybody give me some hint about chrooting execution of cgi script
> > > > invoked through apache?
> > > > I would like to achieve this on per-virtual-host basis so every
> > > > virtual host would have different root dir to which it would chroot
> > > > execution of it's cgi scripts. If the price is perl installation in
> > > > every chroot jail so be it.
> > > >
> > > > Best regards,
> > > >
> > > > Bostjan Skufca
> > > >
> > > > -
> > > > To unsubscribe from this list: send the line "unsubscribe
> > > > linux-admin" in the body of a message to majordomo@vger.kernel.org
> > > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> > --
> > Best regards,
> >
> > Bostjan Skufca
> > system administrator
> >
> > Domenca d.o.o.
> > Phone: +386 4 5835444
> > Fax: +386 4 5831999
> > http://www.domenca.com
--
Best regards,
Bostjan Skufca
system administrator
Domenca d.o.o.
Phone: +386 4 5835444
Fax: +386 4 5831999
http://www.domenca.com
next prev parent reply other threads:[~2004-01-19 14:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-17 3:45 chroot of apache's cgi execution Bostjan Skufca (at) domenca.com
2004-01-17 4:27 ` asterr
2004-01-19 2:11 ` Bostjan Skufca (at) domenca.com
2004-01-17 12:33 ` Joao Schim
2004-01-19 2:09 ` Bostjan Skufca (at) domenca.com
2004-01-19 9:45 ` Joao Schim
2004-01-19 14:02 ` Bostjan Skufca (at) domenca.com [this message]
2004-01-20 5:53 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200401191502.24458.bostjan.skufca@domenca.com \
--to=bostjan.skufca@domenca.com \
--cc=j.schim@netmaniacs.nl \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).