From: Stephen Smalley <sds@tycho.nsa.gov>
To: Harry Ciao <qingtao.cao@windriver.com>
Cc: cpebenito@tresys.com, selinux@tycho.nsa.gov
Subject: Re: [v2] [SELinux] Discussions about rbacsep
Date: Fri, 11 Mar 2011 09:11:08 -0500 [thread overview]
Message-ID: <1299852669.3432.22.camel@moss-pluto> (raw)
In-Reply-To: <1299828060-18411-1-git-send-email-qingtao.cao@windriver.com>
On Fri, 2011-03-11 at 15:20 +0800, Harry Ciao wrote:
> Hi Stephen and Chris,
>
> I have fixed the semantics of the role_transtion rule for the newly created files or dirs objects same as that for the process class. Since class-specific role_transition rules would be handled after TE rules, we could make use of checking if (newcontext.type == roletr->type) and (scontext->role == roletr->role) before setting newcontext.role = roletr->new_role;
>
> Then in the refpolicy we could adopt Stephen's suggestion for the role_transition rule such as:
> role_transition sysadm_r user_home_t sysadm_r;
>
> But I think we could omit class in above rule, since such role_transition semantics only takes place when filedir == true, that is, when the new object is of file or dir class.
If we omit the class, then the above statement has two possible
interpretations:
1) When a process in sysadm_r executes a program labeled user_home_t,
the process transitions to sysadm_r (no effect in this case, but it
would have an effect if the new role were something other than the old
one), or
2) When a process creates a file in a directory labeled user_home_t,
then the new file will be labeled with sysadm_r.
I'm concerned about that ambiguity in the meaning of the rule if we
don't explicitly specify the class. Also, by not specifying the class,
you keep us from re-using this mechanism for other object classes in a
general manner.
I don't think that it would be too hard to add an optional class field
to the role_transition statements; you can follow the model of what we
did for range_transitions when we added the class field to it. That
does require a policy version bump and an updated checkpolicy/libsepol.
What would also be desirable would be a new policy construct that would
allow us to specify the default labeling behavior for each component of
the security context on a per-class basis, e.g.
role_default file fromtarget;
role_default process fromsource;
user_default socket fromsource;
...
That would eliminate the need for the security_is_*_class functions and
the special handling in the kernel for particular classes, and migrate
all of this logic into the policy. That however may be more than you
are willing to take on at the present time.
--
Stephen Smalley
National Security Agency
--
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:[~2011-03-11 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-11 7:20 [v2] [SELinux] Discussions about rbacsep Harry Ciao
2011-03-11 7:20 ` [PATCH 1/1] Files and dirs objects could retain user role Harry Ciao
2011-03-14 12:23 ` Christopher J. PeBenito
2011-03-11 7:20 ` [v2 PATCH 1/2] Auto-generate security_is_filedir_class() Harry Ciao
2011-03-11 7:21 ` [v2 PATCH 2/2] role_transition for newly created files or dirs Harry Ciao
2011-03-11 14:11 ` Stephen Smalley [this message]
2011-03-11 19:04 ` [v2] [SELinux] Discussions about rbacsep James Carter
2011-03-12 12:26 ` HarryCiao
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=1299852669.3432.22.camel@moss-pluto \
--to=sds@tycho.nsa.gov \
--cc=cpebenito@tresys.com \
--cc=qingtao.cao@windriver.com \
--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.