selinux-policy/refpolicy/policy/modules/system/hostname.te

98 lines
2.1 KiB
Plaintext

policy_module(hostname,1.0)
########################################
#
# Declarations
#
type hostname_t;
type hostname_exec_t;
init_system_domain(hostname_t,hostname_exec_t)
role system_r types hostname_t;
########################################
#
# Local policy
#
# for setting the hostname
allow hostname_t self:process { sigchld sigkill sigstop signull signal };
allow hostname_t self:capability sys_admin;
dontaudit hostname_t self:capability sys_tty_config;
sysnet_read_config(hostname_t)
kernel_read_kernel_sysctl(hostname_t)
kernel_dontaudit_use_fd(hostname_t)
kernel_list_proc(hostname_t)
kernel_read_proc_symlinks(hostname_t)
dev_read_sysfs(hostname_t)
fs_getattr_xattr_fs(hostname_t)
fs_search_auto_mountpoints(hostname_t)
term_dontaudit_use_console(hostname_t)
term_use_all_user_ttys(hostname_t)
term_use_all_user_ptys(hostname_t)
init_use_fd(hostname_t)
init_use_script_pty(hostname_t)
domain_use_wide_inherit_fd(hostname_t)
files_read_etc_files(hostname_t)
files_dontaudit_search_var(hostname_t)
# for when /usr is not mounted:
files_dontaudit_search_isid_type_dir(hostname_t)
libs_use_ld_so(hostname_t)
libs_use_shared_libs(hostname_t)
logging_send_syslog_msg(hostname_t)
miscfiles_read_localization(hostname_t)
userdom_use_all_user_fd(hostname_t)
ifdef(`distro_redhat', `
fs_use_tmpfs_chr_dev(hostname_t)
')
ifdef(`targeted_policy', `
term_dontaudit_use_unallocated_tty(hostname_t)
term_dontaudit_use_generic_pty(hostname_t)
files_dontaudit_read_root_file(hostname_t)
')
tunable_policy(`use_dns',`
allow hostname_t self:udp_socket create_socket_perms;
corenet_udp_sendrecv_all_if(hostname_t)
corenet_raw_sendrecv_all_if(hostname_t)
corenet_udp_sendrecv_all_nodes(hostname_t)
corenet_raw_sendrecv_all_nodes(hostname_t)
corenet_udp_bind_all_nodes(hostname_t)
corenet_udp_sendrecv_dns_port(hostname_t)
sysnet_read_config(hostname_t)
')
optional_policy(`hotplug.te',`
hotplug_dontaudit_use_fd(hostname_t)
')
optional_policy(`selinuxutil.te',`
seutil_sigchld_newrole(hostname_t)
')
optional_policy(`udev.te', `
udev_read_db(hostname_t)
')
ifdef(`TODO',`
optional_policy(`rhgb.te', `
rhgb_domain(hostname_t)
')
') dnl end TODO