Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow init_t to manage the dhcp client state files #1838

Open
wants to merge 1 commit into
base: rawhide
Choose a base branch
from

Conversation

naokitnk
Copy link
Contributor

Need to allow init_t to manage the dhcp client state files as the process of import-state service runs in that domain when mls is used while it runs in unconfined_service_t domain with targeted policy.

FYI, below is the denial this commit addresses.

audit(1615330079.292:7): avc: denied { add_name } for pid=1168 comm="cp" name="dhclient-c9935e25-13d2-42b8-adb3-63d628e36e48-ens3.lease" scontext=system_u:system_r:init_t:s0-s15:c0.c1023 tcontext=system_u:object_r:dhcpc_state_t:s0 tclass=dir permissive=0

Need to allow init_t to manage the dhcp client state files as the process of
import-state service runs in that domain when mls is used while it runs in
unconfined_service_t domain with targeted policy.

Signed-off-by: Naoki Tanaka <[email protected]>
@naokitnk
Copy link
Contributor Author

Please let me know if you need additional clarifications from my side.

@zpytela
Copy link
Contributor

zpytela commented Aug 28, 2023

No information is needed, I just considered enabling the dhcp module in mls as an alternative.

@naokitnk
Copy link
Contributor Author

OK, but I understand dhcp policy module is already enabled with mls as you can confirm in modules-mls-contrib.conf below:

https://src.fedoraproject.org/rpms/selinux-policy/blob/rawhide/f/modules-mls-contrib.conf

# Layer: services
# Module: dhcp
#
# Dynamic host configuration protocol (DHCP) server
# 
dhcp = module

Moreover, the cause here is rather in the source domain side. Specifically, I understand import-state service provided by initscripts package needs this permission to execute the following line in init_t domain with mls policy while it's allowed with targeted policy since the process runs in unconfined_service_t domain instead as I wrote:

https://github.com/fedora-sysv/initscripts/blob/main/usr/libexec/import-state#L27

find . -mindepth 1 -maxdepth 1 -not -type d -exec cp -av -t "$dest_dir" {} \; > /dev/null

@naokitnk
Copy link
Contributor Author

naokitnk commented Nov 1, 2023

Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants