[refpolicy] [PATCH 0/33] description

Sven Vermeulen sven.vermeulen at siphos.be
Sun May 7 08:29:57 UTC 2017

On Sat, May 6, 2017 at 7:00 PM, Guido Trentalancia via refpolicy
<refpolicy at oss.tresys.com> wrote:
> Conceptually the patch that I submitted can be synthesised as follows:
> - never allow any domain to read or write user home directories' content unless a specific "enable_homedir" boolean is set to true (default value is false, for all daemons and applications);

In our setup, we use four booleans:

*_read_generic_user_content (read rights on user_home_t)
*_manage_generic_user_content (manage rights on user_home_t)
*_read_all_user_content (read rights on not only user_home_t but on
all content types that a regular user domain has access to, handled
through the user_home_content_type attribute)
*_manage_all_user_content (manage rights on all content types that a
regular user domain has access to)

We even try to automatically set those on each domain, but we needed
to hack it a bit for the boolean documentation: we use a template to
automatically generate the booleans and its underlying code, but the
order in which things are done makes it that the in-line documentation
for those booleans (you know, the <desc><p>...</p></desc> stuff) isn't
taken up. We haven't put more effort in changing this order (also to
ensure compatibility) so we just add the missing documentation into
its own gentoo_tunables.xml file in the doc/ subfolder.

Automatically creating the booleans and the various tunable_policy()
statements makes it very easy to include it, which is something I
favor. Perhaps the documentation generation can be automated as well.
I don't like having to include the same set of rules in every user
domain that wants to access user content (or even daemons). By using a
single template, it can be adapted as the user privileges adapt with
new initiatives or innovations in the SELinux policy area.

> - always allow all domains that were previously allowed to read and/or write user home directories' content to read and/or write the "Download" subdirectory *only* (this is treated as a shared parking area);

We only do this for domains where the download directory is intuitive
(like browsers). For instance, image viewers we use the Pictures/
directory for (xdg_pictures_home_t) while media players are for the
Music (xdg_music_home_t) and Videos (xdg_videos_home_t) locations.

However, I'm personally less concerned about what default we should
pick in the reference policy itself, and leave that up to the
distributions (as you mentioned in the other post). Let's focus first
on the content before we make the final choices on the defaults.


More information about the refpolicy mailing list