Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
policy_module(hostname,1.0)
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
########################################
Chris PeBenito 15e3d8
#
Chris PeBenito 15e3d8
# Declarations
Chris PeBenito 15e3d8
#
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
type hostname_t;
Chris PeBenito 15e3d8
type hostname_exec_t;
Chris PeBenito c9428d
init_system_domain(hostname_t,hostname_exec_t)
Chris PeBenito 15e3d8
role system_r types hostname_t;
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
########################################
Chris PeBenito 15e3d8
#
Chris PeBenito 15e3d8
# Local policy
Chris PeBenito 15e3d8
#
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
# for setting the hostname
Chris PeBenito 15e3d8
allow hostname_t self:process { sigchld sigkill sigstop signull signal };
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
allow hostname_t self:capability sys_admin;
Chris PeBenito 15e3d8
dontaudit hostname_t self:capability sys_tty_config;
Chris PeBenito 15e3d8
Chris PeBenito c9428d
sysnet_read_config(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
kernel_read_kernel_sysctl(hostname_t)
Chris PeBenito 0fd9dc
kernel_dontaudit_use_fd(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito d35c62
dev_read_sysfs(hostname_t)
Chris PeBenito d35c62
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito 0fd9dc
term_dontaudit_use_console(hostname_t)
Chris PeBenito 0fd9dc
term_use_all_user_ttys(hostname_t)
Chris PeBenito 0fd9dc
term_use_all_user_ptys(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito c9428d
init_use_fd(hostname_t)
Chris PeBenito c9428d
init_use_script_pty(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito c9428d
domain_use_wide_inherit_fd(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito 31908b
files_read_generic_etc_files(hostname_t)
Chris PeBenito 31908b
files_dontaudit_search_var(hostname_t)
Chris PeBenito 3b857e
# for when /usr is not mounted:
Chris PeBenito c9428d
files_dontaudit_search_isid_type_dir(hostname_t)
Chris PeBenito 3b857e
Chris PeBenito c9428d
libs_use_ld_so(hostname_t)
Chris PeBenito c9428d
libs_use_shared_libs(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito c9428d
logging_send_syslog_msg(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
miscfiles_read_localization(hostname_t)
Chris PeBenito 15e3d8
Chris PeBenito c9428d
userdom_use_all_user_fd(hostname_t)
Chris PeBenito f5c42b
Chris PeBenito 254bbc
ifdef(`distro_redhat', `
Chris PeBenito 763c44
	fs_use_tmpfs_character_devices(hostname_t)
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito 254bbc
ifdef(`targeted_policy', `
Chris PeBenito 0fd9dc
	term_dontaudit_use_unallocated_tty(hostname_t)
Chris PeBenito 31908b
	term_dontaudit_use_generic_pty(hostname_t)
Chris PeBenito c9428d
	files_dontaudit_read_root_file(hostname_t)
Chris PeBenito 0c73cd
')
Chris PeBenito 15e3d8
Chris PeBenito f5c42b
tunable_policy(`use_dns',`
Chris PeBenito dd8229
	allow hostname_t self:udp_socket create_socket_perms;
Chris PeBenito 0fd9dc
	corenet_udp_sendrecv_all_if(hostname_t)
Chris PeBenito 0fd9dc
	corenet_raw_sendrecv_all_if(hostname_t)
Chris PeBenito 0fd9dc
	corenet_udp_sendrecv_all_nodes(hostname_t)
Chris PeBenito 0fd9dc
	corenet_raw_sendrecv_all_nodes(hostname_t)
Chris PeBenito 0fd9dc
	corenet_udp_bind_all_nodes(hostname_t)
Chris PeBenito 0fd9dc
	corenet_udp_sendrecv_dns_port(hostname_t)
Chris PeBenito c9428d
	sysnet_read_config(hostname_t)
Chris PeBenito f5c42b
')
Chris PeBenito f5c42b
Chris PeBenito 2812bf
optional_policy(`hotplug.te',`
Chris PeBenito c9428d
	hotplug_dontaudit_use_fd(hostname_t)
Chris PeBenito 15e3d8
')
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
optional_policy(`selinux.te',`
Chris PeBenito 5e0da6
	seutil_newrole_sigchld(hostname_t)
Chris PeBenito 15e3d8
')
Chris PeBenito 15e3d8
Chris PeBenito 13e94c
optional_policy(`udev.te', `
Chris PeBenito c9428d
	udev_read_db(hostname_t)
Chris PeBenito 13e94c
')
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
ifdef(`TODO',`
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
##daemon_base_domain(hostname, , nosysadm)
Chris PeBenito 15e3d8
##must remembe to go back and take care of the nosysadm part
Chris PeBenito 15e3d8
allow hostname_t proc_t:dir { read getattr lock search ioctl };
Chris PeBenito 15e3d8
allow hostname_t proc_t:lnk_file read;
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
optional_policy(`rhgb.te', `
Chris PeBenito 15e3d8
allow hostname_t rhgb_t:process sigchld;
Chris PeBenito 15e3d8
allow hostname_t rhgb_t:fd use;
Chris PeBenito 15e3d8
allow hostname_t rhgb_t:fifo_file { read write };
Chris PeBenito 15e3d8
')
Chris PeBenito 15e3d8
Chris PeBenito 15e3d8
allow hostname_t autofs_t:dir { search getattr };
Chris PeBenito 15e3d8
##end daemon_base_domain
Chris PeBenito 15e3d8
') dnl end TODO