From: Tracy Reed <treed@ultraviolet.org>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov
Subject: Re: MCS error
Date: Thu, 19 Feb 2015 11:58:44 -0800 [thread overview]
Message-ID: <20150219195844.GD12937@tracyreed.org> (raw)
In-Reply-To: <54E60CF9.2090006@tycho.nsa.gov>
[-- Attachment #1: Type: text/plain, Size: 4493 bytes --]
On Thu, Feb 19, 2015 at 08:19:05AM PST, Stephen Smalley spake thusly:
> As Dominick pointed out, Fedora and RHEL migrated away from trying to
> using MCS on users to using it for specific use cases, e.g. sandbox,
> sVirt (KVM+SELinux), openshift, etc. So the MCS constraints may not be
> applied to anything in that policy except for the domains used for those
> specific applications.
We intend to use it to sandbox web apps. This sounds like what RHEL is trying
to use it for, right?
Will it simply not work at all for users in RHEL6 as it used to for RHEL5? That
seemed a very simple way to set it up and would work perfectly for our needs.
If it won't work for users do we now have to assign a specific type/domain to
our app? The app always runs under a specific user so we could actually
associate that user with a domain instead of unconfined, correct?
Here is our current setup, which is all messed up. I'm not sure how we arrived at this:
# semanage login -l
Login Name SELinux User MLS/MCS Range
__default__ unconfined_u SystemLow-SystemHigh
p16001 p16001_u p16001
p16002 appuser_u AppAdmin-p16002
p16003 appuser_u AppAdmin-p16003
p16004 unconfined_u s0-s0:c0.c1023,c4
p16005 unconfined_u s0-s0:c0.c1023,c4,c5
p16006 unconfined_u s0-s0:c0.c1023,c6
p16007 unconfined_u s0-s0:c0.c1023,c7
p16008 unconfined_u s0-s0:c0.c1023,c8
p16009 unconfined_u s0-s0:c0.c1023,c9
root unconfined_u SystemLow-SystemHigh
system_u system_u SystemLow-SystemHigh
So the first problem I see is that the login names p16004-16009 are assigned to
unconfined_u so they will never be denied anything except DAC and MCS will not
be enforced, correct?
Is the user p16001 setup correctly in that it has its own assigned SELinux user
and one specific category assigned to it?
Then we need to fix the MLS/MCS ranges for the other users. Currently
unconfined_u has s0-s0:c0.c1023 plus a seemingly redundant ,c4,c5 etc. Just as
a test I am trying to use:
chcat -l -- -c4 p16005
to remove the c4 category from p16005 but that didn't work for some reason. We
need to remove all of the categories except one which should be unique to each
user since each instance of our web app runs under each user p16001 or p16002
etc. respectively.
Currently I have the above setup and can login as p16001 and see files like this:
-bash-4.1$ id
uid=16001(p16001) gid=16001(p16001) groups=16001(p16001) context=p16001_u:user_r:user_t:p16001
-bash-4.1$
-bash-4.1$ ls -laZ
drwxr-xr-x. root root system_u:object_r:default_t:SystemLow .
drwxrwxr-x. root root system_u:object_r:default_t:SystemLow ..
drwxr-xr-x. p16001 p16001 unconfined_u:object_r:default_t:p16001 p16001
drwxr-xr-x. p16002 p16002 unconfined_u:object_r:default_t:p16002 p16002
drwxr-xr-x. p16003 p16003 unconfined_u:object_r:default_t:p16003 p16003
-bash-4.1$ id
uid=16001(p16001) gid=16001(p16001) groups=16001(p16001) context=p16001_u:user_r:user_t:p16001
-bash-4.1$ cd p16002/
-bash-4.1$ ls -laZ
drwxr-xr-x. p16002 p16002 unconfined_u:object_r:default_t:p16002 .
drwxr-xr-x. root root system_u:object_r:default_t:SystemLow ..
-rw-r--r--. p16002 p16002 unconfined_u:object_r:default_t:p16002 testfile
-bash-4.1$ cat testfile
I am 16002
Why can I cat that file? User p16001 has category p16001 and the file I cat'd
id category p16002. Seems like enforcement is not working here. Is this what
Dominick was referring to in that I need to do something else to "opt-in" to
the enforcement?
What are the best resources for learning how to use MCS in RHEL6?
> The -mls policy might be a better fit if you want to apply it system-wide.
Isn't MLS even less used/supported than MCS? From my description of our use
would you say that MCS is the right fit as opposed to MLS? It seems like the
standard targeted policy for most stuff on the box plus MCS to confine/sandbox
our apps would be the way to go.
Thanks!
--
Tracy Reed
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2015-02-19 19:58 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
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 [this message]
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=20150219195844.GD12937@tracyreed.org \
--to=treed@ultraviolet.org \
--cc=sds@tycho.nsa.gov \
--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.