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

Backport additional SELinux rules for NFS and linear storage backend #974

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/selinux/swtpm.te
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ require {
type virt_var_lib_t;
type virtqemud_t;
type virtqemud_tmp_t;
class file map;
tunable virt_use_nfs;
}

attribute_role swtpm_roles;
Expand All @@ -31,7 +33,7 @@ allow swtpm_t qemu_var_run_t:dir { add_name remove_name write };
allow swtpm_t qemu_var_run_t:sock_file { create setattr unlink };
allow swtpm_t var_log_t:file open;
allow swtpm_t virt_var_lib_t:dir { add_name remove_name write };
allow swtpm_t virt_var_lib_t:file { create rename setattr unlink write };
allow swtpm_t virt_var_lib_t:file { create rename setattr unlink write map };
allow swtpm_t virtqemud_t:unix_stream_socket { read write getattr };
allow swtpm_t virtqemud_tmp_t:file { open write };
allow swtpm_t svirt_image_t:file { open append }; # BZ2306817
Expand All @@ -44,3 +46,10 @@ files_read_etc_files(swtpm_t)
auth_use_nsswitch(swtpm_t)

miscfiles_read_localization(swtpm_t)

tunable_policy(`virt_use_nfs',`
fs_manage_nfs_dirs(swtpm_t)
fs_manage_nfs_files(swtpm_t)
fs_read_nfs_symlinks(swtpm_t)
fs_mmap_nfs_files(swtpm_t)
')