All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominick Grift <dac.override@gmail.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@vger.kernel.org
Subject: Re: [RFC 0/3] Second phase of UserPrefix to UserRBACSEPRole transition
Date: Mon, 25 Nov 2019 14:50:03 +0100	[thread overview]
Message-ID: <20191125135003.GA441967@brutus.lan> (raw)
In-Reply-To: <7f62f389-f531-f1dd-cb38-3a5b75e40731@tycho.nsa.gov>

[-- Attachment #1: Type: text/plain, Size: 3823 bytes --]

On Mon, Nov 25, 2019 at 08:24:21AM -0500, Stephen Smalley wrote:
> On 11/23/19 9:42 AM, Dominick Grift wrote:
> > In 2008 support for UserPrefix was removed from Reference policy.
> > The code to support this functionality in libsepol and libsemanage however remained albeit slightly modified.
> > I am not sure why it was not fully removed.
> > 
> > DefaultRole replaces UserPrefix functionality but the code in libsepol and libsemanage was only slighty adjusted to accomodate my use-case.
> > This was done in 88e334f1923396d5ace56b8439c731dcde0d1f3b (2016).
> > I do not use semanage and I do not mind using the old UserPrefix statement, but there is some confusion.
> > For example there was a report recently about how semanage does not document UserPrefix.
> > The documentation was likely removed from view because UserPrefix is no longer supported as such.
> > 
> > I want to make the situation better and this proposal is the next phase.
> > This proposal causes some disruption as Reference policy based policy often calls the gen_user() macro with the "user" prefix.
> > 
> > Example: gen_user(user_u, user, user_r, s0, s0)
> > 
> > This will no longer be valid, and the userprefix parameter in gen_user() can be left empty (or needs a valid role if RBACSEP DefaultRole is leveraged).
> > 
> > Example: gen_user(user_u,, user_r, s0, s0)
> > 
> > UserPrefix will now default to object_r. This should not affect common policy implementations.
> > 
> > The next phases will be:
> > 
> > Renaming the UserPrefix statement to UserRBACSEPRole, and renaming references to (user)?prefix to (user)?rbacseprole.
> > Adjusting semanage to expose UserRBACSEPRole.
> > Removing legacy UserPrefix (ROLE/USER_TEMPLATE) references from libsemanage.
> > 
> > After this the UserPrefix to UserRBACSEPRole transition should be completed.
> > 
> > This should get us by until someone decides to rewrite libsemanage to take advantage of CIL, simplify the code, and to make the code more robust.
> 
> I guess my only question with regard to this phase and the next ones is with
> regard to backward compatibility.  Even if no one is using this facility, we
> have to make sure we do not break existing installs upon upgrade.

I believe that Reference policy and derivatives can and probably should already omit the "user" prefix from their gen_user() calls.
They probably can and probably should remove any UserPrefix statements altogether without any issues.

If there are no UserPrefixes present in the policy then genhomedircon should fall back to object_r.
Any upgrades will then just add specified userrbacseproles and other existing users should fall back to object_r via genhomedircon.

I might have overlooked aspects, and truth be told this is a little above my pay grade.
Then again this functionality is already broken, and it has been for a long time.

If Reference policy ever were to implement separation based on roles then this needs to be addressed first I believe.

> 
> > 
> > Dominick Grift (3):
> >    libsemanage: fall back to valid "object_r" role instead of "user"
> >      prefix string
> >    semanage: do not default prefix to "user"
> >    cil: qualify roles from symtable when resolving userprefix
> > 
> >   libsemanage/src/genhomedircon.c    |  2 +-
> >   libsemanage/src/user_record.c      |  4 ++--
> >   libsepol/cil/src/cil.c             |  7 +++++--
> >   libsepol/cil/src/cil_internal.h    |  1 +
> >   libsepol/cil/src/cil_resolve_ast.c | 10 ++++------
> >   python/semanage/semanage           |  2 +-
> >   6 files changed, 14 insertions(+), 12 deletions(-)
> > 
> 

-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2019-11-25 13:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 14:42 [RFC 0/3] Second phase of UserPrefix to UserRBACSEPRole transition Dominick Grift
2019-11-23 14:42 ` [RFC 1/3] libsemanage: fall back to valid "object_r" role instead of "user" prefix string Dominick Grift
2019-11-23 14:42 ` [RFC 2/3] semanage: do not default prefix to "user" Dominick Grift
2019-11-23 14:42 ` [RFC 3/3] cil: qualify roles from symtable when resolving userprefix Dominick Grift
2019-11-25 13:24 ` [RFC 0/3] Second phase of UserPrefix to UserRBACSEPRole transition Stephen Smalley
2019-11-25 13:50   ` Dominick Grift [this message]
2019-11-25 14:10   ` Dominick Grift
2019-11-26 18:27     ` Stephen Smalley
2019-11-27 11:22       ` Dominick Grift
2019-11-27 15:03         ` Stephen Smalley
2019-11-27 15:25           ` Dominick Grift

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=20191125135003.GA441967@brutus.lan \
    --to=dac.override@gmail.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.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.