Chris PeBenito 17de1b
Chris PeBenito 6b19be
policy_module(rhgb,1.2.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type rhgb_t;
Chris PeBenito 17de1b
type rhgb_exec_t;
Chris PeBenito 17de1b
init_daemon_domain(rhgb_t,rhgb_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type rhgb_tmpfs_t;
Chris PeBenito 17de1b
files_tmpfs_file(rhgb_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito d9845a
type rhgb_devpts_t;
Chris PeBenito d9845a
term_pty(rhgb_devpts_t)
Chris PeBenito 75beb9
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 75beb9
allow rhgb_t self:capability { fsetid setgid setuid sys_admin sys_tty_config };
Chris PeBenito 17de1b
dontaudit rhgb_t self:capability sys_tty_config;
Chris PeBenito d9845a
allow rhgb_t self:process { setpgid signal_perms };
Chris PeBenito 17de1b
allow rhgb_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow rhgb_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito c0868a
allow rhgb_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow rhgb_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
allow rhgb_t self:udp_socket create_socket_perms;
Chris PeBenito 75beb9
allow rhgb_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
manage_dirs_pattern(rhgb_t,rhgb_tmpfs_t,rhgb_tmpfs_t)
Chris PeBenito c0868a
manage_files_pattern(rhgb_t,rhgb_tmpfs_t,rhgb_tmpfs_t)
Chris PeBenito c0868a
manage_lnk_files_pattern(rhgb_t,rhgb_tmpfs_t,rhgb_tmpfs_t)
Chris PeBenito c0868a
manage_fifo_files_pattern(rhgb_t,rhgb_tmpfs_t,rhgb_tmpfs_t)
Chris PeBenito c0868a
manage_sock_files_pattern(rhgb_t,rhgb_tmpfs_t,rhgb_tmpfs_t)
Chris PeBenito 17de1b
fs_tmpfs_filetrans(rhgb_t,rhgb_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(rhgb_t)
Chris PeBenito 17de1b
kernel_read_system_state(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_bin(rhgb_t)
Chris PeBenito 17de1b
corecmd_exec_sbin(rhgb_t)
Chris PeBenito 75beb9
corecmd_exec_shell(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(rhgb_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(rhgb_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(rhgb_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(rhgb_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(rhgb_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(rhgb_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(rhgb_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(rhgb_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(rhgb_t)
Chris PeBenito 75beb9
files_read_var_files(rhgb_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(rhgb_t)
Chris PeBenito 17de1b
files_search_tmp(rhgb_t)
Chris PeBenito 17de1b
files_read_usr_files(rhgb_t)
Chris PeBenito 17de1b
files_mounton_mnt(rhgb_t)
Chris PeBenito 17de1b
files_dontaudit_read_default_files(rhgb_t)
Chris PeBenito 17de1b
files_dontaudit_search_pids(rhgb_t)
Chris PeBenito 17de1b
# for nscd
Chris PeBenito 17de1b
files_dontaudit_search_var(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_search_auto_mountpoints(rhgb_t)
Chris PeBenito 17de1b
fs_mount_ramfs(rhgb_t)
Chris PeBenito 17de1b
fs_unmount_ramfs(rhgb_t)
Chris PeBenito 75beb9
fs_getattr_tmpfs(rhgb_t)
Chris PeBenito 17de1b
# for ramfs file systems
Chris PeBenito 75beb9
fs_manage_ramfs_dirs(rhgb_t)
Chris PeBenito 17de1b
fs_manage_ramfs_files(rhgb_t)
Chris PeBenito 17de1b
fs_manage_ramfs_pipes(rhgb_t)
Chris PeBenito 17de1b
fs_manage_ramfs_sockets(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito d9845a
selinux_dontaudit_read_fs(rhgb_t)
Chris PeBenito d9845a
Chris PeBenito 17de1b
term_dontaudit_use_console(rhgb_t)
Chris PeBenito 17de1b
term_use_unallocated_ttys(rhgb_t)
Chris PeBenito 75beb9
term_use_ptmx(rhgb_t)
Chris PeBenito 75beb9
term_getattr_pty_fs(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(rhgb_t)
Chris PeBenito 17de1b
init_use_script_ptys(rhgb_t)
Chris PeBenito 17de1b
init_write_initctl(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(rhgb_t)
Chris PeBenito 17de1b
libs_use_shared_libs(rhgb_t)
Chris PeBenito 17de1b
# for localization
Chris PeBenito 17de1b
libs_read_lib_files(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(rhgb_t)
Chris PeBenito 17de1b
miscfiles_read_fonts(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito d9845a
seutil_search_default_contexts(rhgb_t)
Chris PeBenito d9845a
seutil_read_config(rhgb_t)
Chris PeBenito d9845a
Chris PeBenito 17de1b
sysnet_read_config(rhgb_t)
Chris PeBenito 75beb9
sysnet_domtrans_ifconfig(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(rhgb_t)
Chris PeBenito 75beb9
userdom_dontaudit_search_sysadm_home_dirs(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
xserver_read_xdm_xserver_tmp_files(rhgb_t)
Chris PeBenito 17de1b
xserver_kill_xdm_xserver(rhgb_t)
Chris PeBenito 17de1b
# for running setxkbmap
Chris PeBenito 17de1b
xserver_read_xkb_libs(rhgb_t)
Chris PeBenito 6b19be
xserver_domtrans_xdm_xserver(rhgb_t)
Chris PeBenito 6b19be
xserver_signal_xdm_xserver(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 75beb9
ifdef(`strict_policy',`
Chris PeBenito c0868a
	allow rhgb_t rhgb_devpts_t:chr_file { rw_chr_file_perms setattr };
Chris PeBenito 75beb9
	term_create_pty(rhgb_t,rhgb_devpts_t)
Chris PeBenito 75beb9
', `
Chris PeBenito 75beb9
	files_dontaudit_read_root_files(rhgb_t)
Chris PeBenito 75beb9
Chris PeBenito d9845a
	term_use_generic_ptys(rhgb_t)
Chris PeBenito d9845a
	term_setattr_generic_ptys(rhgb_t)
Chris PeBenito eac818
	term_dontaudit_use_unallocated_ttys(rhgb_t)
Chris PeBenito 17de1b
Chris PeBenito 75beb9
	xserver_domtrans_xdm_xserver(rhgb_t)
Chris PeBenito 75beb9
	xserver_read_xdm_tmp_files(rhgb_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito d9845a
	consoletype_exec(rhgb_t)
Chris PeBenito d9845a
')
Chris PeBenito d9845a
Chris PeBenito d9845a
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(rhgb_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(rhgb_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(rhgb_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`TODO',`
Chris PeBenito 75beb9
	#this seems a bit much
Chris PeBenito 17de1b
	allow domain rhgb_devpts_t:chr_file { read write };
Chris PeBenito 17de1b
	allow initrc_t rhgb_gph_t:fd use;
Chris PeBenito 17de1b
')