-
Notifications
You must be signed in to change notification settings - Fork 29
Description
I am following https://wiki.archlinux.org/title/SELinux to install SELinux on my Arch environment.
I installed all selinux tools by installing selinux
pkg group. By following Arch Wiki, at https://wiki.archlinux.org/title/SELinux#Installing_a_policy , it explains how to build and deploy the default policies (/etc/selinux/refpolicy/policy
).
My 1st question: when I install selinux
pkg group, the default SELinux policies stored in /etc/selinux/refpolicy/src/policy/
are already automatically deployed or I need to build and install them after selinux
pkg group install?
My 2nd question: on /etc/selinux/config
I see SELINUXTYPE=refpolicy-arch
and in /etc/selinux/
I see:
/etc/selinux/refpolicy/policy
/etc/selinux/refpolicy-arch/policy
refpolicy
has a src
directory where I build, install and load by make
the default policies. Once loaded, if I have SELINUXTYPE=refpolicy-arch
in my config
and I reboot the system and I run restorecon -r /
, are refpolicy
removed and refpolicy-arch
automatically applied?
My 3rd question: in https://wiki.archlinux.org/title/SELinux#Installing_a_policy when deal with the creation of requiredmod.te
file with the following content:
module requiredmod 1.0;
require {
type devpts_t;
type kernel_t;
type device_t;
type var_run_t;
type udev_t;
type hugetlbfs_t;
type udev_tbl_t;
type tmpfs_t;
class sock_file write;
class unix_stream_socket { read write ioctl };
class capability2 block_suspend;
class dir { write add_name };
class filesystem associate;
}
#============= devpts_t ==============
allow devpts_t device_t:filesystem associate;
#============= hugetlbfs_t ==============
allow hugetlbfs_t device_t:filesystem associate;
#============= kernel_t ==============
allow kernel_t self:capability2 block_suspend;
#============= tmpfs_t ==============
allow tmpfs_t device_t:filesystem associate;
#============= udev_t ==============
allow udev_t kernel_t:unix_stream_socket { read write ioctl };
allow udev_t udev_tbl_t:dir { write add_name };
allow udev_t var_run_t:sock_file write;
and run the commands:
checkmodule -m -o requiredmod.mod requiredmod.te
semodule_package -o requiredmod.pp -m requiredmod.mod
semodule -i requiredmod.pp
"to remove a few messages from /var/log/audit/audit.log which are a nuisance to deal with in the reference policy", is it already done by these refpolicy-arch (so we don't need to do this hacky stuff) or not?
My 4th question: after the install of selinux
pkg group, do I still need to label the entire filesystem by restorecon -r /
or it is already automatically done?