From: Joshua Brindle <brindle@quarksecurity.com>
To: Tracy Reed <treed@ultraviolet.org>
Cc: selinux@tycho.nsa.gov
Subject: Re: MCS error
Date: Fri, 20 Feb 2015 18:38:28 -0500 [thread overview]
Message-ID: <54E7C574.6020605@quarksecurity.com> (raw)
In-Reply-To: <20150220232749.GM12937@tracyreed.org>
Tracy Reed wrote:
> On Thu, Feb 19, 2015 at 11:33:03PM PST, Dominick Grift spake thusly:
>> Right, this table (login table) shows the associations of selinux
>> identities
>> and selinux securtity levels with linux users, whereas the "user
>> table" shows
>> associations of selinux roles and security levels with selinux users.
>
> Ok, I think I understand that now... Looks like they both can associate
> security levels with their respective kinds of users. Seems odd now to
> be able
> to associate security levels with Linux users instead of just SELinux
> users.
>
> Now I am wondering which one takes precedence. For example, in the MCS
> setup I
> am attempting do I need to have the security category defined in the
> login
> table or the user table or both?
>
SELinux users have a strict superset of the levels that Linux users do.
The SELinux kernel policy does not know or care about Linux users. It
only knows SELinux users, they are defined in the policy and have a set
of levels associated with them. The tools below adjust those levels as
they are defined in the kernel binary policy.
Originally there was no Linux user->SELinux user mapping at all, that
was added so that Linux users didn't need to be added to the SELinux
binary policy, before these management tools existed.
Nowadays, in the managed policy case, you can associate a subset of the
levels of an SELinux user to a Linux user. This is enforced by the login
program and not by the kernel. The kernel will only enforce the SELinux
user does not gain more levels than assigned in the policy.
Does that make sense?
>> You are misunderstanding the concept of associating things with "selinux
>> users" (user table) versus the concept of associating things with "linux
>> users" (login table), and how the two relate.
>
> Indeed.
>
>> You cannot associate something with a Linux user if that something is
>> not
>> associated with the SELinux user first.
>
> Ok...
>
>> For example the error message above complains that you have a
>> "appuser_u"
>> identity associated with some "linux user(s)" (p16002, p16003).
>> Howver that
>> identity (appuser_u) does not exist in your "user table".
>>
>> So to fix that error: re-add the appuser_u selinux user to the "user
>> table" ,
>> then remove the references to "appuser_u" from the "login table"
>> *first* ,
>> and then finally remove the appuser_u association from the "user table"
>> again.
>
> Your use of "*first*" in the second step is confusing to me but it
> looks like
> the order of operations here is:
>
> 1. re-add the appuser_u selinux user to the "user table"
>
> 2. remove the references to "appuser_u" from the "login table"
>
> 3. remove the appuser_u association from the "user table"
>
>
> So to do step 1 and re-add appuser_u selinux user to the "user table"
> I should do this and get this result:
>
> # semanage user -a -R user_r appuser_u
> libsemanage.validate_handler: selinux user appuser_u does not exist
> (No such file or directory).
> libsemanage.validate_handler: seuser mapping [p16002 -> (appuser_u,
> s0:c1.c499-s0:c2)] is invalid (No such file or directory).
> libsemanage.dbase_llist_iterate: could not iterate over records (No
> such file or directory).
> /usr/sbin/semanage: Could not commit semanage transaction
>
> Even if I try step 2 first (in case that's what you meant by *first) I
> get this:
>
> # semanage login -d p16002
> libsemanage.validate_handler: selinux user appuser_u does not exist
> (No such file or directory).
> libsemanage.validate_handler: seuser mapping [p16003 -> (appuser_u,
> s0:c1.c499-s0:c3)] is invalid (No such file or directory).
> libsemanage.dbase_llist_iterate: could not iterate over records (No
> such file or directory).
> /usr/sbin/semanage: Could not commit semanage transaction
>
> What am I missing here? Thanks!
>
>
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to
> Selinux-request@tycho.nsa.gov.
next prev parent reply other threads:[~2015-02-20 23:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-19 1:48 MCS error Tracy Reed
2015-02-19 13:23 ` Stephen Smalley
2015-02-19 15:40 ` Dominick Grift
2015-02-19 19:33 ` Tracy Reed
2015-02-19 19:46 ` Stephen Smalley
2015-02-19 20:17 ` Tracy Reed
2015-02-19 20:27 ` Stephen Smalley
2015-02-19 21:14 ` Dominick Grift
2015-02-19 20:48 ` Dominick Grift
2015-02-19 21:26 ` Thomas Hurd
2015-02-20 0:34 ` Tracy Reed
2015-02-20 2:02 ` Tracy Reed
2015-02-20 7:33 ` Dominick Grift
2015-02-20 23:27 ` Tracy Reed
2015-02-20 23:38 ` Joshua Brindle [this message]
2015-02-21 13:07 ` Dominick Grift
2015-02-20 17:44 ` Stephen Smalley
2015-02-20 13:38 ` Stephen Smalley
2015-02-20 16:56 ` Tracy Reed
2015-02-20 17:08 ` Stephen Smalley
2015-02-20 17:33 ` Stephen Smalley
2015-02-20 22:10 ` Tracy Reed
2015-02-23 14:43 ` Stephen Smalley
2015-02-20 22:07 ` Tracy Reed
2015-02-19 16:19 ` Stephen Smalley
2015-02-19 19:58 ` Tracy Reed
2015-02-19 20:24 ` 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=54E7C574.6020605@quarksecurity.com \
--to=brindle@quarksecurity.com \
--cc=selinux@tycho.nsa.gov \
--cc=treed@ultraviolet.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 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.