Hi Bill,

My understanding was that the "user" range was the possible range and the "login" range was what was allowed for a user.

I think this is actually wrong, as in CentOS6/RHEL6 you seem to be restricted to the context you login with and get a "process.transition" denial if a user_t tries to change their context, e.g. with runcon:

[jack@centos6 ~]$ runcon -l s0:c1 bash
runcon: bash: Permission denied

This doesn't seem to be the case for later versions, specifically Fedora 25 that I've tried with. In this case you seem to need different SELinux users:

[root@laptop ~]# semanage user -a -R user_r -r s0:c0 jack_u
[root@laptop ~]# semanage user -a -R user_r -r s0:c1 mary_u

[root@laptop ~]# semanage login -a -s jack_u -r s0:c0 jack
[root@laptop ~]# semanage login -a -s mary_u -r s0:c1 mary

Then you can't change the context due to it being invalid:

[jack@centos6 ~]$ id
uid=500(jack) gid=500(jack) groups=500(jack) context=jack_u:user_r:user_t:s0:c0
[jack@centos6 ~]$ runcon -l s0:c1 bash
runcon: invalid context: jack_u:user_r:user_t:s0:c1: Invalid argument

This latter approach worked for me on all versions of the OS and I would say is the more correct approach.

Hope that helps.

Phil


Inactive hide details for Bill D ---31/05/2017 09:50:15---Hello Phil: Thank you for the information and the explanation of the Bill D ---31/05/2017 09:50:15---Hello Phil: Thank you for the information and the explanation of the "+" option--it

From: Bill D <littus@icloud.com>
To: Philip Seeley <pseeley@au1.ibm.com>
Cc: littus@icloud.com, selinux@lists.fedoraproject.org
Date: 31/05/2017 09:50
Subject: Re: Controlling execution of Java JAR files with SELinux RBAC





Hello Phil:

Thank you for the information and the explanation of the "+" option--it makes sense.

I have one concern... Notice that initially user_u's MCS settings is s0 which I believe it is the lowest category.

But in order to set up new categories for constraining access to JAR files, we must change user_u's MCS settings to s0-s0:c0.c1023 with the following command:

# semanage user -m -r s0-s0:c0.c1023 user_u

Doesn't it mean that we are elevating user_u's category privileges? 

Is it possible to attain the desired effect without having to elevate user_u's category privileges?

Thank you & Best Regards,

Bill

On 05/29/2017 08:27 PM, Philip Seeley wrote: