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

106 lines
2.7 KiB
Plaintext
Raw Normal View History

2005-05-09 13:26:33 +00:00
policy_module(hostname,1.0)
########################################
#
# Declarations
#
type hostname_t;
type hostname_exec_t;
init_make_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;
sysnetwork_read_network_config(hostname_t)
kernel_read_kernel_sysctl(hostname_t)
kernel_read_hardware_state(hostname_t)
kernel_ignore_use_file_descriptors(hostname_t)
files_read_general_system_config(hostname_t)
files_ignore_search_system_state_data_directory(hostname_t)
2005-06-08 13:12:00 +00:00
fs_get_persistent_fs_attributes(hostname_t)
2005-05-09 13:26:33 +00:00
terminal_ignore_use_console(hostname_t)
terminal_use_all_private_physical_terminals(hostname_t)
terminal_use_all_private_pseudoterminals(hostname_t)
2005-05-09 13:26:33 +00:00
init_use_file_descriptors(hostname_t)
init_script_use_pseudoterminal(hostname_t)
domain_use_widely_inheritable_file_descriptors(hostname_t)
# for when /usr is not mounted:
files_ignore_search_isid_type_dir(hostname_t)
2005-05-09 13:26:33 +00:00
libraries_use_dynamic_loader(hostname_t)
libraries_use_shared_libraries(hostname_t)
2005-05-09 13:26:33 +00:00
logging_send_system_log_message(hostname_t)
miscfiles_read_localization(hostname_t)
2005-05-30 21:17:20 +00:00
userdomain_use_all_users_file_descriptors(hostname_t)
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
')
ifdef(`targeted_policy', `
terminal_ignore_use_general_physical_terminal(hostname_t)
terminal_ignore_use_general_pseudoterminal(hostname_t)
files_ignore_read_rootfs_file(hostname_t)
')
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;
corenetwork_sendrecv_udp_on_all_interfaces(hostname_t)
corenetwork_sendrecv_raw_on_all_interfaces(hostname_t)
corenetwork_sendrecv_udp_on_all_nodes(hostname_t)
corenetwork_sendrecv_raw_on_all_nodes(hostname_t)
corenetwork_bind_udp_on_all_nodes(hostname_t)
corenetwork_sendrecv_udp_on_dns_port(hostname_t)
sysnetwork_read_network_config(hostname_t)
2005-05-30 21:17:20 +00:00
')
2005-05-10 15:00:54 +00:00
optional_policy(`hotplug.te',`
hotplug_ignore_use_file_descriptors(hostname_t)
2005-05-09 13:26:33 +00:00
')
optional_policy(`selinux.te',`
selinux_newrole_sigchld(hostname_t)
2005-05-09 13:26:33 +00:00
')
2005-05-09 21:07:53 +00:00
optional_policy(`udev.te', `
udev_read_database(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