Skip to contentSkip to conversation

homedir file context definitions

DISCUSSION Vit Mojzis 3 participants 3 messages Nov 2, 2020 – Nov 5, 2020 SELinux security module

lore
Share & tools
lore

Vit Mojzis

author
#0 lore raw

Hello everyone,
when investigating a bug report [1], I found that homedir context definitions (specified in .fc file) are changed based on the corresponding user (selinux user, role and mls level from the context definition are replaced - [2]). While replacing the selinux user and role makes sense, I'm wondering if the mls level from each homedir context definition should instead be compared to corresponding user's mls range (and either kept or replaced to ensure given user has access to it).

I have no problem with writing the patch, but I could use help understanding what the correct behaviour should be (and why).

Any pointers would be apprecited.

Thank you.

[1] - https://bugzilla.redhat.com/show_bug.cgi?id=1818472
[2] - https://github.com/SELinuxProject/selinux/blob/master/libsemanage/src/genhomedircon.c#L638

--

Vit Mojzis
Software Engineer, Platform Security - SELinux userspace Red Hat, Inc.

#1 lore raw
Quoted 4 lines · Vit Mojzis

when investigating a bug report [1], I found that homedir context definitions (specified in .fc file) are changed based on the corresponding user (selinux user, role and mls level from the context definition are replaced - [2]). While replacing the selinux user and role makes sense, I'm wondering if the mls level from each homedir context definition should instead be compared to corresponding user's mls range (and either kept or replaced to ensure given user has access to it).

I have no problem with writing the patch, but I could use help understanding what the correct behaviour should be (and why).

I would also be interested in a patch that allows specifying the "user level" i.e. the mls part of home directory file contexts as a range.
In my policy objects can also have a range where low specifies the confidentiality level and high the integrity level of a file, and it would be quite useful to have user directories default to low-high. I might have already posted something about this to the mailing list but I'm not sure.

Signature · 2 lines
bauen1
https://dn42.bauen1.xyz/
#2 lore raw
In reply to Vit Mojzis
Quoted 7 lines · Vit Mojzis

Hello everyone,
when investigating a bug report [1], I found that homedir context definitions (specified in .fc file) are changed based on the corresponding user (selinux user, role and mls level from the context definition are replaced - [2]). While replacing the selinux user and role makes sense, I'm wondering if the mls level from each homedir context definition should instead be compared to corresponding user's mls range (and either kept or replaced to ensure given user has access to it).

I have no problem with writing the patch, but I could use help understanding what the correct behaviour should be (and why).

Any pointers would be apprecited.

I think the behavior should be that it replaces the level with the default level of the user (from the user policy statement) and that possibly should be overridden by the bottom level of whatever range is specified for that login user (from the seusers file).

Signature · 1 line
Chris PeBenito