All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@gentoo.org>
To: jwcart2@epoch.ncsc.mil
Cc: SELinux <selinux@tycho.nsa.gov>
Subject: Re: running interpreted scripts in different domains
Date: Tue, 20 Jul 2004 14:14:44 -0400	[thread overview]
Message-ID: <40FD6114.3020808@gentoo.org> (raw)
In-Reply-To: <1090338174.25139.60.camel@moss-lions.epoch.ncsc.mil>

James Carter wrote:

>Why can't the kernel do the auto transition?  Maybe I don't understand
>what you are using for your source and target contexts.
>
>If you call security_compute_create with fastcgi's context as the
>source, the script's context as the target, and using the
>SECCLASS_PROCESS class, then you will get the same result as the kernel
>when it looks for the default transition in selinux_bprm_security.  So
>if you take the new context returned by security_compute_create and call
>setexec with it, you will end up with the same result that you would
>have if you had just let the kernel do the auto transition.
>
>  
>
Oh good, I was hoping I was just overlooking something obvious. I 
thought that security_compute_create() was just for automatic object 
type transitions but now that I think about it that doesn't make much 
sense to seperate those since they are the same thing in different classes.

The kernel can't do the auto transition because there is no execve() 
happening when the php interpreter reads the .php file and interprets 
it. The idea is to have the fastcgi wrapper running in some domain, 
fcgi_wrapper_t and have it able to do a security_compute_create() 
between it's own context and method_php_script_t and decide that it 
should run in method_php_t and then setexeccon() to method_php_t and 
execute the php interpreter for the user method. That way my scripts can 
be entirely isolated from system and other users and I can't use php to 
read other peoples php scripts that could contain passwords and so on.


>Again, why can't you use security_compute_create?
>
>>From selinux.h:
>/* Compute a labeling decision and set *newcon to refer to it.
>   Caller must free via freecon. */
>extern int security_compute_create(security_context_t scon,
>				   security_context_t tcon,
>				   security_class_t tclass,
>				   security_context_t *newcon);
>
>  
>
Yes, I looked at this and thought it was for file labeling decisions.. 
silly me ;)

Joshua Brindle

--
This message was distributed to subscribers of the selinux mailing 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.

  reply	other threads:[~2004-07-20 18:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-18 20:33 running interpreted scripts in different domains Joshua Brindle
2004-07-19  8:28 ` Luke Kenneth Casson Leighton
2004-07-19 11:56   ` Russell Coker
2004-07-19 12:01     ` Joshua Brindle
2004-07-20 15:42 ` James Carter
2004-07-20 18:14   ` Joshua Brindle [this message]
2004-07-20 20:27     ` James Carter
2004-07-20 20:32       ` Joshua Brindle
2004-07-20 23:22         ` Luke Kenneth Casson Leighton
2004-07-21  0:59           ` Joshua Brindle
2004-07-21 23:06         ` Thomas Bleher
2004-07-22  8:56           ` Luke Kenneth Casson Leighton
2004-07-22 13:19             ` Daniel J Walsh
2004-07-22 14:35             ` Luke Kenneth Casson Leighton

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=40FD6114.3020808@gentoo.org \
    --to=method@gentoo.org \
    --cc=jwcart2@epoch.ncsc.mil \
    --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.