2005-05-09 13:26:33 +00:00
|
|
|
|
|
|
|
policy_module(hostname,1.0)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type hostname_t;
|
|
|
|
type hostname_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_system_domain(hostname_t,hostname_exec_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
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;
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_read_config(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
|
|
|
kernel_read_kernel_sysctl(hostname_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_dontaudit_use_fd(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
dev_read_sysfs(hostname_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_dontaudit_use_console(hostname_t)
|
|
|
|
term_use_all_user_ttys(hostname_t)
|
|
|
|
term_use_all_user_ptys(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_use_fd(hostname_t)
|
|
|
|
init_use_script_pty(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_use_wide_inherit_fd(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-06-13 20:27:32 +00:00
|
|
|
files_read_generic_etc_files(hostname_t)
|
|
|
|
files_dontaudit_search_var(hostname_t)
|
2005-05-31 21:25:45 +00:00
|
|
|
# for when /usr is not mounted:
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_search_isid_type_dir(hostname_t)
|
2005-05-31 21:25:45 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(hostname_t)
|
|
|
|
libs_use_shared_libs(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(hostname_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_use_all_user_fd(hostname_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat', `
|
2005-06-08 13:12:00 +00:00
|
|
|
fs_use_tmpfs_character_devices(hostname_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
')
|
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`targeted_policy', `
|
2005-06-10 01:01:13 +00:00
|
|
|
term_dontaudit_use_unallocated_tty(hostname_t)
|
2005-06-13 20:27:32 +00:00
|
|
|
term_dontaudit_use_generic_pty(hostname_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_read_root_file(hostname_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-05-09 13:26:33 +00:00
|
|
|
|
2005-05-30 21:17:20 +00:00
|
|
|
tunable_policy(`use_dns',`
|
2005-06-09 14:50:48 +00:00
|
|
|
allow hostname_t self:udp_socket create_socket_perms;
|
2005-06-10 01:01:13 +00:00
|
|
|
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)
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_read_config(hostname_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
')
|
|
|
|
|
2005-05-10 15:00:54 +00:00
|
|
|
optional_policy(`hotplug.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
hotplug_dontaudit_use_fd(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`selinux.te',`
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_newrole_sigchld(hostname_t)
|
2005-05-09 13:26:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-09 21:07:53 +00:00
|
|
|
optional_policy(`udev.te', `
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_read_db(hostname_t)
|
2005-05-09 21:07:53 +00:00
|
|
|
')
|
2005-05-09 13:26:33 +00:00
|
|
|
|
|
|
|
ifdef(`TODO',`
|
|
|
|
|
|
|
|
##daemon_base_domain(hostname, , nosysadm)
|
|
|
|
##must remembe to go back and take care of the nosysadm part
|
|
|
|
allow hostname_t proc_t:dir { read getattr lock search ioctl };
|
|
|
|
allow hostname_t proc_t:lnk_file read;
|
|
|
|
|
|
|
|
optional_policy(`rhgb.te', `
|
|
|
|
allow hostname_t rhgb_t:process sigchld;
|
|
|
|
allow hostname_t rhgb_t:fd use;
|
|
|
|
allow hostname_t rhgb_t:fifo_file { read write };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow hostname_t autofs_t:dir { search getattr };
|
|
|
|
##end daemon_base_domain
|
|
|
|
') dnl end TODO
|