Chris PeBenito c8d5b3
Chris PeBenito 141cff
policy_module(rhgb,1.0.1)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
########################################
Chris PeBenito c8d5b3
#
Chris PeBenito c8d5b3
# Declarations
Chris PeBenito c8d5b3
#
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
type rhgb_t;
Chris PeBenito c8d5b3
type rhgb_exec_t;
Chris PeBenito c8d5b3
init_daemon_domain(rhgb_t,rhgb_exec_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
type rhgb_devpts_t;
Chris PeBenito c8d5b3
term_pty(rhgb_devpts_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
type rhgb_tmpfs_t;
Chris PeBenito c8d5b3
files_tmpfs_file(rhgb_tmpfs_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
########################################
Chris PeBenito c8d5b3
#
Chris PeBenito c8d5b3
# Local policy
Chris PeBenito c8d5b3
#
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
allow rhgb_t self:capability { sys_admin sys_tty_config };
Chris PeBenito c8d5b3
dontaudit rhgb_t self:capability sys_tty_config;
Chris PeBenito c8d5b3
allow rhgb_t self:process signal_perms;
Chris PeBenito c8d5b3
allow rhgb_t self:shm create_shm_perms;
Chris PeBenito c8d5b3
allow rhgb_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito c8d5b3
allow rhgb_t self:fifo_file rw_file_perms;
Chris PeBenito c8d5b3
allow rhgb_t self:tcp_socket create_socket_perms;
Chris PeBenito c8d5b3
allow rhgb_t self:udp_socket create_socket_perms;
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
allow rhgb_t rhgb_devpts_t:chr_file { rw_file_perms setattr };
Chris PeBenito c8d5b3
term_create_pty(rhgb_t,rhgb_devpts_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
allow rhgb_t rhgb_tmpfs_t:dir manage_dir_perms;
Chris PeBenito c8d5b3
allow rhgb_t rhgb_tmpfs_t:file manage_file_perms;
Chris PeBenito c8d5b3
allow rhgb_t rhgb_tmpfs_t:lnk_file create_lnk_perms;
Chris PeBenito c8d5b3
allow rhgb_t rhgb_tmpfs_t:sock_file manage_file_perms;
Chris PeBenito c8d5b3
allow rhgb_t rhgb_tmpfs_t:fifo_file manage_file_perms;
Chris PeBenito c8d5b3
fs_tmpfs_filetrans(rhgb_t,rhgb_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
kernel_read_kernel_sysctls(rhgb_t)
Chris PeBenito c8d5b3
kernel_read_system_state(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
corecmd_exec_bin(rhgb_t)
Chris PeBenito c8d5b3
corecmd_exec_sbin(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito 141cff
corenet_non_ipsec_sendrecv(rhgb_t)
Chris PeBenito c8d5b3
corenet_tcp_sendrecv_generic_if(rhgb_t)
Chris PeBenito c8d5b3
corenet_udp_sendrecv_generic_if(rhgb_t)
Chris PeBenito c8d5b3
corenet_tcp_sendrecv_all_nodes(rhgb_t)
Chris PeBenito c8d5b3
corenet_udp_sendrecv_all_nodes(rhgb_t)
Chris PeBenito c8d5b3
corenet_tcp_sendrecv_all_ports(rhgb_t)
Chris PeBenito c8d5b3
corenet_udp_sendrecv_all_ports(rhgb_t)
Chris PeBenito c8d5b3
corenet_tcp_connect_all_ports(rhgb_t)
Chris PeBenito 141cff
corenet_sendrecv_all_client_packets(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
dev_read_sysfs(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
domain_use_interactive_fds(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
files_read_etc_files(rhgb_t)
Chris PeBenito c8d5b3
files_read_etc_runtime_files(rhgb_t)
Chris PeBenito c8d5b3
files_search_tmp(rhgb_t)
Chris PeBenito c8d5b3
files_read_usr_files(rhgb_t)
Chris PeBenito c8d5b3
files_mounton_mnt(rhgb_t)
Chris PeBenito c8d5b3
files_dontaudit_read_default_files(rhgb_t)
Chris PeBenito c8d5b3
files_dontaudit_search_pids(rhgb_t)
Chris PeBenito c8d5b3
# for nscd
Chris PeBenito c8d5b3
files_dontaudit_search_var(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
fs_search_auto_mountpoints(rhgb_t)
Chris PeBenito c8d5b3
fs_mount_ramfs(rhgb_t)
Chris PeBenito c8d5b3
fs_unmount_ramfs(rhgb_t)
Chris PeBenito c8d5b3
# for ramfs file systems
Chris PeBenito c8d5b3
fs_manage_ramfs_files(rhgb_t)
Chris PeBenito c8d5b3
fs_manage_ramfs_pipes(rhgb_t)
Chris PeBenito c8d5b3
fs_manage_ramfs_sockets(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
term_dontaudit_use_console(rhgb_t)
Chris PeBenito c8d5b3
term_use_unallocated_ttys(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
init_use_fds(rhgb_t)
Chris PeBenito c8d5b3
init_use_script_ptys(rhgb_t)
Chris PeBenito c8d5b3
init_write_initctl(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
libs_use_ld_so(rhgb_t)
Chris PeBenito c8d5b3
libs_use_shared_libs(rhgb_t)
Chris PeBenito c8d5b3
# for localization
Chris PeBenito c8d5b3
libs_read_lib_files(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
logging_send_syslog_msg(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
miscfiles_read_localization(rhgb_t)
Chris PeBenito c8d5b3
miscfiles_read_fonts(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
sysnet_read_config(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
userdom_dontaudit_use_unpriv_user_fds(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
xserver_read_xdm_xserver_tmp_files(rhgb_t)
Chris PeBenito c8d5b3
xserver_kill_xdm_xserver(rhgb_t)
Chris PeBenito c8d5b3
# for running setxkbmap
Chris PeBenito c8d5b3
xserver_read_xkb_libs(rhgb_t)
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
ifdef(`targeted_policy',`
Chris PeBenito c8d5b3
	term_dontaudit_use_generic_ptys(rhgb_t)
Chris PeBenito c8d5b3
	files_dontaudit_read_root_files(rhgb_t)
Chris PeBenito c8d5b3
')
Chris PeBenito c8d5b3
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito c8d5b3
	firstboot_read_rw_files(rhgb_t)
Chris PeBenito c8d5b3
')
Chris PeBenito c8d5b3
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito c8d5b3
	nis_use_ypbind(rhgb_t)
Chris PeBenito c8d5b3
')
Chris PeBenito c8d5b3
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito c8d5b3
	seutil_sigchld_newrole(rhgb_t)
Chris PeBenito c8d5b3
')
Chris PeBenito c8d5b3
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito c8d5b3
	udev_read_db(rhgb_t)
Chris PeBenito c8d5b3
')
Chris PeBenito c8d5b3
Chris PeBenito c8d5b3
ifdef(`TODO',`
Chris PeBenito c8d5b3
	#TODO
Chris PeBenito c8d5b3
	ifdef(`hide_broken_symptoms', `
Chris PeBenito c8d5b3
		# for a bug in the X server
Chris PeBenito c8d5b3
		dontaudit mount_t rhgb_gph_t:fd use;
Chris PeBenito c8d5b3
	')
Chris PeBenito c8d5b3
	#TODO this seems a bit much
Chris PeBenito c8d5b3
	allow domain rhgb_devpts_t:chr_file { read write };
Chris PeBenito c8d5b3
	#TODO this (ie files_dontaudit_read_default_files(rhgb_t))doesn't make sense with the following
Chris PeBenito c8d5b3
	allow rhgb_t default_t:file { getattr read };
Chris PeBenito c8d5b3
	#TODO
Chris PeBenito c8d5b3
	# for gnome-pty-helper
Chris PeBenito c8d5b3
	gph_domain(rhgb, system)
Chris PeBenito c8d5b3
	allow initrc_t rhgb_gph_t:fd use;
Chris PeBenito c8d5b3
	ifdef(`hide_broken_symptoms', `
Chris PeBenito c8d5b3
		# it should not do this
Chris PeBenito c8d5b3
		dontaudit rhgb_t { staff_home_dir_t sysadm_home_dir_t }:dir search;
Chris PeBenito c8d5b3
	')
Chris PeBenito c8d5b3
')