From: Daniel J Walsh <dwalsh@redhat.com>
To: Stefan Schulze Frielinghaus <stefan@seekline.net>
Cc: selinux@tycho.nsa.gov
Subject: Re: transition policy/logic for shell-, perl- and python-scripts
Date: Sat, 27 Dec 2008 06:19:18 -0500 [thread overview]
Message-ID: <49560F36.20303@redhat.com> (raw)
In-Reply-To: <1230370454.2932.11.camel@localhost.localdomain>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stefan Schulze Frielinghaus wrote:
> Hello everyone,
>
> I would like to know the policy/logic for transition of e.g. a
> Perl-Script. If I write a daemon in Perl, label the file as
> daemon_exec_t and execute it using the initrc_t, then the daemon runs
> under the daemon_t domain. This SELinux behavior is very convenient.
>
> I would like to know when and how does a transition for such a script
> occur?
>
> For example, create a /tmp/test.pl and run it. The file is labeled as
>
> unconfined_u:object_r:user_tmp_t:s0
>
> but runs as
>
> unconfined_u:unconfined_r:unconfined_t:s0
>
> Therefore, no type transition occurred. Can someone give me a hind?
>
> cheers,
> Stefan
>
>
> --
> 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.
The default policy for unconfined_t is that it can execute any file type
without a transition. So a unconfined_t executing a user_tmp_t would
stay unconfined_t. Similarly initrc_t can execute most bin_t files
without a transition, so initrc_t executing files in a bin directory
with the default labeling will stay bin_t. Now if you define a file
context for a daemon, daemon_exec_t. And you define a domain type for
this daemon daemon_t. You can call an interface
init_daemon_domain(daemon_t, daemon_exec_t)
Which will cause initrc_t to transition to daemon_t when it executes
files labeled daemon_exec_t. This transition happens when the
executable starts.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAklWDzYACgkQrlYvE4MpobMgXACeKGec0qzW2D/W2a2FfTtk2MMG
Fm4AnisJ+7w97Q6eepCyGdUc+cOContp
=Zsgr
-----END PGP SIGNATURE-----
--
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.
next prev parent reply other threads:[~2008-12-27 11:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-27 9:34 transition policy/logic for shell-, perl- and python-scripts Stefan Schulze Frielinghaus
2008-12-27 11:19 ` Daniel J Walsh [this message]
[not found] ` <5aebb9fb0812270301n5dacfe0dr73a71650e1a3c3a0@mail.gmail.com>
2008-12-27 19:04 ` Stefan Schulze Frielinghaus
2009-01-05 15:47 ` Stephen Smalley
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=49560F36.20303@redhat.com \
--to=dwalsh@redhat.com \
--cc=selinux@tycho.nsa.gov \
--cc=stefan@seekline.net \
/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.