All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Sheets <masheets@linux.microsoft.com>
To: Chris PeBenito <chpebeni@linux.microsoft.com>,
	SELinux Reference Policy mailing list 
	<selinux-refpolicy@vger.kernel.org>
Subject: Re: [refpolicy3 RFC] Split broad file contexts
Date: Fri, 9 Dec 2022 09:29:16 -0700	[thread overview]
Message-ID: <0397bf1e-415f-b045-5a6d-c12fde48a65a@linux.microsoft.com> (raw)
In-Reply-To: <d83ef10f-ae8b-08d2-55b7-66f2cf12ed9a@linux.microsoft.com>

On 12/9/2022 9:09 AM, Chris PeBenito wrote:
> In refpolicy2, we have several types, such as bin_t, that have file 
> contexts related to other modules, e.g.:
> 
> /etc/acpi/actions(/.*)?            gen_context(system_u:object_r:bin_t,s0)
> 
> /usr/lib/mailman/bin(/.*)?        gen_context(system_u:object_r:bin_t,s0)
> 
> /var/mailman/bin(/.*)?            gen_context(system_u:object_r:bin_t,s0)
> 
> 
> relate to acpi and mailman.
> 
> Should we continue to put all of the bin_t labeling in files.cas or 
> should we split it back to the individual modules?  This was originally 
> done in refpolicy2 so users could look in a single place for everything 
> about bin_t for encapsulation.  This is nice for users, but not so nice 
> for maintenance and version control.
> 
> Since cascade has the "extend" feature, we can split up the labeling 
> among relevant modules, and tooling can construct a single unified view 
> of the file contexts of bin_t and the like.
> 
> For example, instead of this in file.cas:
> 
> resource bin_t inherits executable {
>    ...many fcs...
>    file_context(/etc/acpi/actions(/.*)?, any);
> }
> 
> we have this in acpi.cas:
> 
> extend bin_t {
>    file_context(/etc/acpi/actions(/.*)?, any);
> }
> 
> 
> Thoughts?
> 
> 

If I turn of a module I want as little residue as possible in other modules.

I think using extend is the best option.  Keep all relative types and 
labeling in the singular module so if it is not used we heavily reduce 
the possibility of unexpected labeling/access.

The users should understand that a single cas file does not define the 
whole policy, so if they see something that may be "off" with labeling 
they may need to look further.  And with the new tooling, looking 
further should be easy.

  reply	other threads:[~2022-12-09 16:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 16:09 [refpolicy3 RFC] Split broad file contexts Chris PeBenito
2022-12-09 16:29 ` Matthew Sheets [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-03-23 15:06 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=0397bf1e-415f-b045-5a6d-c12fde48a65a@linux.microsoft.com \
    --to=masheets@linux.microsoft.com \
    --cc=chpebeni@linux.microsoft.com \
    --cc=selinux-refpolicy@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.