Chris PeBenito 842859
Chris PeBenito 842859
policy_module(kudzu,1.0)
Chris PeBenito 842859
Chris PeBenito 842859
########################################
Chris PeBenito 842859
#
Chris PeBenito 842859
# Declarations
Chris PeBenito 842859
#
Chris PeBenito 842859
Chris PeBenito 842859
type kudzu_t;
Chris PeBenito 842859
type kudzu_exec_t;
Chris PeBenito 842859
init_system_domain(kudzu_t,kudzu_exec_t)
Chris PeBenito 842859
Chris PeBenito 842859
type kudzu_tmp_t;
Chris PeBenito 842859
files_tmp_file(kudzu_tmp_t)
Chris PeBenito 842859
Chris PeBenito 842859
type kudzu_var_run_t;
Chris PeBenito 842859
files_pid_file(kudzu_var_run_t)
Chris PeBenito 842859
Chris PeBenito 842859
########################################
Chris PeBenito 842859
#
Chris PeBenito 842859
# Local policy
Chris PeBenito 842859
#
Chris PeBenito 842859
Chris PeBenito 842859
allow kudzu_t self:capability { dac_override sys_admin sys_rawio net_admin sys_tty_config mknod };
Chris PeBenito 842859
dontaudit kudzu_t self:capability sys_tty_config;
Chris PeBenito 842859
allow kudzu_t self:process signal_perms;
Chris PeBenito 842859
allow kudzu_t self:fifo_file rw_file_perms;
Chris PeBenito 842859
allow kudzu_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 842859
allow kudzu_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 842859
allow kudzu_t self:udp_socket { create ioctl };
Chris PeBenito 842859
Chris PeBenito fa6757
allow kudzu_t kudzu_tmp_t:dir create_file_perms;
Chris PeBenito 842859
allow kudzu_t kudzu_tmp_t:{ file chr_file } create_file_perms;
Chris PeBenito 842859
files_create_tmp_files(kudzu_t, kudzu_tmp_t, { file dir chr_file })
Chris PeBenito 842859
Chris PeBenito 842859
allow kudzu_t kudzu_var_run_t:file create_file_perms;
Chris PeBenito 842859
allow kudzu_t kudzu_var_run_t:dir create_dir_perms;
Chris PeBenito 842859
files_create_pid(kudzu_t,kudzu_var_run_t)
Chris PeBenito 842859
Chris PeBenito 842859
kernel_change_ring_buffer_level(kudzu_t)
Chris PeBenito 842859
kernel_list_proc(kudzu_t)
Chris PeBenito 842859
kernel_read_device_sysctl(kudzu_t)
Chris PeBenito 842859
kernel_read_kernel_sysctl(kudzu_t)
Chris PeBenito 842859
kernel_read_proc_symlinks(kudzu_t)
Chris PeBenito 842859
kernel_read_network_state(kudzu_t)
Chris PeBenito 842859
kernel_read_system_state(kudzu_t)
Chris PeBenito 842859
kernel_rw_hotplug_sysctl(kudzu_t)
Chris PeBenito 842859
kernel_rw_kernel_sysctl(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
bootloader_read_kernel_modules(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
dev_list_sysfs(kudzu_t)
Chris PeBenito 842859
dev_read_usbfs(kudzu_t)
Chris PeBenito 842859
dev_read_sysfs(kudzu_t)
Chris PeBenito 842859
dev_rx_raw_memory(kudzu_t)
Chris PeBenito 842859
dev_wx_raw_memory(kudzu_t)
Chris PeBenito 842859
dev_rw_mouse(kudzu_t)
Chris PeBenito 842859
dev_rwx_zero_dev(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
fs_search_auto_mountpoints(kudzu_t)
Chris PeBenito 842859
fs_search_ramfs(kudzu_t)
Chris PeBenito 842859
fs_write_ramfs_socket(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
modutils_read_mods_deps(kudzu_t)
Chris PeBenito fe9d17
modutils_read_module_conf(kudzu_t)
Chris PeBenito fe9d17
modutils_rename_module_conf(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
storage_read_scsi_generic(kudzu_t)
Chris PeBenito 842859
storage_read_tape_device(kudzu_t)
Chris PeBenito 842859
storage_raw_write_fixed_disk(kudzu_t)
Chris PeBenito 842859
storage_raw_read_fixed_disk(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
term_search_ptys(kudzu_t)
Chris PeBenito 842859
term_dontaudit_use_console(kudzu_t)
Chris PeBenito 842859
# so it can write messages to the console
Chris PeBenito 842859
term_use_unallocated_tty(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
corecmd_exec_sbin(kudzu_t)
Chris PeBenito 842859
corecmd_exec_bin(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
domain_exec_all_entry_files(kudzu_t)
Chris PeBenito 842859
domain_use_wide_inherit_fd(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
files_search_var(kudzu_t)
Chris PeBenito 842859
files_search_locks(kudzu_t)
Chris PeBenito 842859
files_manage_etc_files(kudzu_t)
Chris PeBenito 842859
files_manage_etc_runtime_files(kudzu_t)
Chris PeBenito 842859
files_manage_mnt_files(kudzu_t)
Chris PeBenito 842859
files_manage_mnt_symlinks(kudzu_t)
Chris PeBenito 842859
files_dontaudit_search_src(kudzu_t)
Chris PeBenito 842859
# Read /usr/share/hwdata/.* and /usr/share/terminfo/l/linux
Chris PeBenito 842859
files_read_usr_files(kudzu_t)
Chris PeBenito 842859
# for /etc/sysconfig/hwconf - probably need a new type
Chris PeBenito 842859
files_rw_etc_runtime_files(kudzu_t)
Chris PeBenito 842859
# for file systems that are not yet mounted
Chris PeBenito 842859
files_dontaudit_search_isid_type_dir(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
init_use_fd(kudzu_t)
Chris PeBenito 842859
init_use_script_pty(kudzu_t)
Chris PeBenito 842859
init_unix_connect_script(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
libs_use_ld_so(kudzu_t)
Chris PeBenito 842859
libs_use_shared_libs(kudzu_t)
Chris PeBenito 842859
# Read /usr/lib/gconv/gconv-modules.*
Chris PeBenito 842859
libs_read_lib(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
logging_send_syslog_msg(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 77f6e2
miscfiles_read_hwdata(kudzu_t)
Chris PeBenito 842859
miscfiles_read_localization(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
modutils_read_module_conf(kudzu_t)
Chris PeBenito fa6757
modutils_domtrans_insmod(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
sysnet_read_config(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
userdom_search_sysadm_home_dir(kudzu_t)
Chris PeBenito 842859
userdom_dontaudit_use_unpriv_user_fd(kudzu_t)
Chris PeBenito 842859
Chris PeBenito 842859
ifdef(`targeted_policy',`
Chris PeBenito 842859
        term_dontaudit_use_unallocated_tty(kudzu_t)
Chris PeBenito 842859
        term_dontaudit_use_generic_pty(kudzu_t)
Chris PeBenito 842859
        files_dontaudit_read_root_file(kudzu_t)
Chris PeBenito e64b33
Chris PeBenito e64b33
	# cjp: this was originally in the else block
Chris PeBenito e64b33
	# of ifdef userhelper.te, but it seems to
Chris PeBenito e64b33
	# make more sense here.  also, require
Chris PeBenito e64b33
	# blocks curently do not work in the
Chris PeBenito e64b33
	# else block of optionals
Chris PeBenito e64b33
	unconfined_domain_template(kudzu_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
Chris PeBenito 842859
tunable_policy(`allow_execmem',`
Chris PeBenito 842859
	allow kudzu_t self:process execmem;
Chris PeBenito 842859
')
Chris PeBenito 842859
Chris PeBenito 842859
optional_policy(`gpm.te',`
Chris PeBenito 842859
	gpm_getattr_gpmctl(kudzu_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
Chris PeBenito fa6757
optional_policy(`nscd.te',`
Chris PeBenito fa6757
	nscd_use_socket(kudzu_t)
Chris PeBenito fa6757
')
Chris PeBenito fa6757
Chris PeBenito 842859
optional_policy(`selinuxutil.te',`
Chris PeBenito 842859
        seutil_sigchld_newrole(kudzu_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
Chris PeBenito 842859
optional_policy(`udev.te',`
Chris PeBenito 842859
        udev_read_db(kudzu_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
Chris PeBenito 842859
ifdef(`TODO',`
Chris PeBenito fa6757
allow kudzu_t modules_conf_t:file unlink;
Chris PeBenito 842859
optional_policy(`rhgb.te',`
Chris PeBenito 842859
        rhgb_domain(kudzu_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
optional_policy(`anaconda.te', `
Chris PeBenito 842859
	domain_auto_trans(anaconda_t, kudzu_exec_t, kudzu_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
optional_policy(`lpd.te',`
Chris PeBenito 842859
	allow kudzu_t printconf_t:file { getattr read };
Chris PeBenito 842859
')
Chris PeBenito 842859
optional_policy(`xserver.te',`
Chris PeBenito 842859
	allow kudzu_t xserver_exec_t:file getattr;
Chris PeBenito 842859
')
Chris PeBenito 842859
optional_policy(`rhgb.te',`
Chris PeBenito 842859
	allow kudzu_t rhgb_t:unix_stream_socket connectto;
Chris PeBenito 842859
')
Chris PeBenito 842859
optional_policy(`userhelper.te',`
Chris PeBenito 842859
	role system_r types sysadm_userhelper_t;
Chris PeBenito 842859
	domain_auto_trans(kudzu_t, userhelper_exec_t, sysadm_userhelper_t)
Chris PeBenito 842859
')
Chris PeBenito 842859
allow kudzu_t cupsd_rw_etc_t:dir r_dir_perms;
Chris PeBenito 842859
')