All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ken YANG <spng.yang@gmail.com>
To: Stefan Schulze Frielinghaus <stefan@sf-net.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	SELinux List <selinux@tycho.nsa.gov>
Subject: Re: SELinux user root
Date: Tue, 10 Jul 2007 17:17:23 +0800	[thread overview]
Message-ID: <46934EA3.2050500@gmail.com> (raw)
In-Reply-To: <ABA6C50B-476A-4775-BCAC-DD4ECD98B610@sf-net.com>

Stefan Schulze Frielinghaus wrote:
> 
> On 09.07.2007, at 20:07, Stephen Smalley wrote:
> 
>>> But if I try to modify the login context of root to use user_u I get
>>> the following error:
>>>
>>> $ semanage login -m -s user_u root
>>>
>>> libsemanage.validate_handler: MLS range s0-s15:c0.c1023 for Unix user
>>> root exceeds allowed range s0 for SELinux user user_u
>>> libsemanage.validate_handler: seuser mapping [root -> (user_u, s0-
>>> s15:c0.c1023)] is invalid
>>> libsemanage.dbase_llist_iterate: could not iterate over records
>>> /usr/sbin/semanage: Could not modify login mapping for root
>>>
>>> I'm not really sure how to interprete this message. I would guess
>>> it's because user_u has only a valid MLS range SystemLow and root has
>>> a SystemLow-SystemHigh range. But why could this be a problem?
>>
>> Because, as you said, user_u isn't authorized for that range.  The Linux
>> user is limited by the permissions of the SELinux user to which he is
>> mapped.
>>
>> Also, the above semanage command would not actually remove the "root"
>> SELinux user from the kernel policy; it would only remove the mapping
>> from the seusers file.  The seusers file was introduced as a way to
>> allow Linux users to be added/modified/removed without needing to change
>> the kernel policy each time, by letting you map each Linux user to one
>> of the predefined SELinux users.
>>
>> It would make more sense to map "root" to "staff_u" than to "user_u".
>> But you aren't achieving much by doing so, you still need "root" in the
>> kernel policy for compatibility with your on-disk file contexts.
> 
> But how to limit the linux user root to not switch to sysadm_r? I would
> change his SELinux user to user_u (but that's not working like we
> pointed out). Or would you change the SELinux user root to not include
> the sysadm_r role?

IMHO, you can use semanage to make "root" not have sysadm_r mapping

> 
> 
> -- 
> 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.
> 


--
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:[~2007-07-10  9:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08  8:35 SELinux user root Stefan Schulze Frielinghaus
2007-07-09 18:07 ` Stephen Smalley
2007-07-10  8:17   ` Stefan Schulze Frielinghaus
2007-07-10  9:17     ` Ken YANG [this message]
2007-07-10 13:10     ` Stephen Smalley
2007-07-11 12:52       ` Stefan Schulze Frielinghaus

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=46934EA3.2050500@gmail.com \
    --to=spng.yang@gmail.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=stefan@sf-net.com \
    /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.