From: Tom <tom@lemuria.org>
To: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: policy question
Date: Thu, 18 Apr 2002 18:32:58 +0200 [thread overview]
Message-ID: <20020418183258.B7029@lemuria.org> (raw)
In-Reply-To: <20020418160829.1AF9F44D90@lyta.coker.com.au>; from russell@coker.com.au on Thu, Apr 18, 2002 at 06:08:28PM +0200
On Thu, Apr 18, 2002 at 06:08:28PM +0200, Russell Coker wrote:
> > In essence, it boils down to: "a script (php, cgi, whatever) that
> > belongs to user X can only access files of user X"
>
> Doing it for cgi is easy enough. I could easily hack something up if the NSA
> people don't release the MITRE code.
I guess so. The cgi gets executed in a new process, at which time a
domain transition is trivial to set up. I guess I can do that myself as
a learning excercise.
> > The sole problem being that the scripts aren't executed in the
> > unix-sense of execution, but by being loaded and interpreted by the
> > apache process.
>
> Which means that they can't be given a different UID and therefore they can't
> be given a different domain because domain transition can only occur at exec
> time (just like for SUID programs).
If that is so, then my question is answered. Is execution really the
only point for a domain transition? That would make sense, but I also
see reasons for doing transitions during other file access operations
(e.g. maybe you want to get a higher protection level while certain
files are open).
> The concept you have is wrong, nothing will make domain transitions on module
> load work.
Not on module load. The PHP module is loaded when apache starts. I want
to make a domain transition when it accesses a file. Here's a simple
flowchart:
* HTTP request incoming
* Apache main process hands request to a child or forks a new one
* Child parses request, finds URL, does URL to filename translation
* Child opens file
==> domain transition
* File is found to be a php file and is handled by the PHP module
* PHP module opens files, reads, writes, whatever
* Output sent to client
* Socket close
==> transition back to original domain
I see that this may not be possible with the current SELinux code. I'm
trying to point out that it may be useful. PHP is not the only thing
coming to mind.
Maybe apache can initiate the domain transition itself? A singular
patch in the URL parsing instance ("read target file's domain and make a
transition to it") should be feasable. As you pointed out, this would
be similiar to what suexec does.
Again, it may still be that I have a gross misunderstanding of what is
possible and what not and how things work. If so, please point my
errors out.
--
http://web.lemuria.org/pubkey.html
pub 1024D/D88D35A6 2001-11-14 Tom Vogt <tom@lemuria.org>
Key fingerprint = 276B B7BB E4D8 FCCE DB8F F965 310B 811A D88D 35A6
--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2002-04-18 16:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-18 9:22 policy question Tom
2002-04-18 10:44 ` Russell Coker
2002-04-18 12:25 ` Tom
2002-04-18 14:51 ` Russell Coker
2002-04-18 15:15 ` Tom
2002-04-18 15:32 ` Stephen Smalley
2002-04-18 16:21 ` Tom
2002-04-18 18:28 ` Russell Coker
2002-04-18 20:40 ` Tom
2002-04-18 21:47 ` Russell Coker
2002-04-19 6:30 ` Tom
2002-04-18 16:08 ` Russell Coker
2002-04-18 16:32 ` Tom [this message]
2002-04-18 18:47 ` Russell Coker
2002-04-18 20:49 ` Tom
2002-04-18 21:44 ` Russell Coker
2002-04-19 6:14 ` Tom
2002-04-19 9:10 ` Russell Coker
2002-04-19 12:27 ` Tom
2002-04-19 15:02 ` Stephen Smalley
2002-04-18 15:22 ` Stephen Smalley
-- strict thread matches above, loose matches on Subject: below --
2002-05-02 10:11 Policy question Reino Wallin
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=20020418183258.B7029@lemuria.org \
--to=tom@lemuria.org \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.