All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy3 RFC] Split broad file contexts
@ 2023-03-23 15:06 Dominick Grift
  0 siblings, 0 replies; 3+ messages in thread
From: Dominick Grift @ 2023-03-23 15:06 UTC (permalink / raw)
  To: selinux-refpolicy


I agree with Metthew.

In dssp5-debian I take this even further and I generally prefer to use
extend over optional where possible.

I only use optional if both module do not depend on eachother.

I do this for various reasons (aside from what Matthew mentioned)

* Keeps the output of semodule -vvv cleaner if you disable modules
* I try to avoid optional because of its limitations
* Keeps the policy and file_contexts cleaner/more efficient when you disable modules

-- 
gpg --locate-keys dominick.grift@defensec.nl
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6  E0FF DA7E 521F 10F6 4098
Dominick Grift

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [refpolicy3 RFC] Split broad file contexts
@ 2022-12-09 16:09 Chris PeBenito
  2022-12-09 16:29 ` Matthew Sheets
  0 siblings, 1 reply; 3+ messages in thread
From: Chris PeBenito @ 2022-12-09 16:09 UTC (permalink / raw)
  To: SELinux Reference Policy mailing list

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?


-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-23 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-23 15:06 [refpolicy3 RFC] Split broad file contexts Dominick Grift
  -- strict thread matches above, loose matches on Subject: below --
2022-12-09 16:09 Chris PeBenito
2022-12-09 16:29 ` Matthew Sheets

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.