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

dracut: various fixes #19

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

dracut: various fixes #19

wants to merge 16 commits into from

Conversation

jpds
Copy link

@jpds jpds commented May 13, 2021

Rules required to make dracut run on an enforcing system.

Signed-off-by: Jonathan Davies <[email protected]>
@github-actions
Copy link

github-actions bot commented Sep 6, 2021

This PR has not had any recent activity. It will be closed in 7 days if it makes no further progress.

@github-actions github-actions bot added the stale label Sep 6, 2021
@github-actions
Copy link

Closing stale PR.

@github-actions github-actions bot closed this Sep 14, 2021
@perfinion perfinion reopened this Nov 11, 2021
Comment on lines +40 to +45
auth_manage_shadow(dracut_t)
auth_relabelto_shadow(dracut_t)

domain_obj_id_change_exemption(dracut_t)
domain_role_change_exemption(dracut_t)
domain_system_change_exemption(dracut_t)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh these are dangerous permissions. Why does dracut need to manage shadow?

Also I'd need a pretty strong justification if things need the foo_change_exemption() rules, those are usually for things like login managers that need to switch to different users or security levels etc.

sometimes those rules showing up means PAM or chk_passwd stuff. does this instead need auth_use_pam(dracut_t) or maybe auth_use_nsswitch?

I see this line: modules.d/99base/module-setup.sh:33: [[ $hostonly ]] && grep '^root:' "$dracutsysrootdir"/etc/shadow >> "$initdir/etc/shadow" but at the most that should need read_shadow not manage_shadow right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are needed because dracut does this:

#!!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access.
#Constraint rule:
#       constrain file { create relabelfrom relabelto } ((u1 == u2 -Fail-)  or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED

#       Possible cause is the source user (staff_u) and target user (system_u) are different.
allow dracut_t modules_object_t:file relabelto;

Also needs manage_shadow as otherwise it hits a neverallow rule with the files_unconfined permission.

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

Successfully merging this pull request may close these issues.

2 participants