Chris PeBenito e0d57f
Chris PeBenito e0d57f
policy_module(pcmcia,1.0)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
########################################
Chris PeBenito e0d57f
#
Chris PeBenito e0d57f
# Declarations
Chris PeBenito e0d57f
#
Chris PeBenito e0d57f
Chris PeBenito e0d57f
type cardmgr_t;
Chris PeBenito e0d57f
type cardmgr_exec_t;
Chris PeBenito e0d57f
init_daemon_domain(cardmgr_t,cardmgr_exec_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
# Create symbolic links in /dev.
Chris PeBenito e0d57f
# cjp: this should probably be eliminated
Chris PeBenito e0d57f
type cardmgr_lnk_t;
Chris PeBenito e0d57f
files_type(cardmgr_lnk_t)
Chris PeBenito e0d57f
Chris PeBenito d9fd8e
type cardmgr_var_lib_t;
Chris PeBenito d9fd8e
files_type(cardmgr_var_lib_t)
Chris PeBenito d9fd8e
Chris PeBenito e0d57f
type cardmgr_var_run_t;
Chris PeBenito e0d57f
files_pid_file(cardmgr_var_run_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
type cardctl_exec_t;
Chris PeBenito e0d57f
domain_entry_file(cardmgr_t,cardctl_exec_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
########################################
Chris PeBenito e0d57f
#
Chris PeBenito e0d57f
# Local policy
Chris PeBenito e0d57f
#
Chris PeBenito e0d57f
Chris PeBenito e0d57f
# Use capabilities (net_admin for route), setuid for cardctl
Chris PeBenito e0d57f
allow cardmgr_t self:capability { dac_read_search dac_override setuid net_admin sys_admin sys_nice sys_tty_config mknod };
Chris PeBenito e0d57f
dontaudit cardmgr_t self:capability sys_tty_config;
Chris PeBenito e0d57f
allow cardmgr_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito e0d57f
allow cardmgr_t self:unix_stream_socket create_socket_perms;
Chris PeBenito e0d57f
allow cardmgr_t self:fifo_file rw_file_perms;
Chris PeBenito e0d57f
Chris PeBenito e0d57f
allow cardmgr_t cardmgr_lnk_t:lnk_file create_lnk_perms;
Chris PeBenito e0d57f
dev_create_dev_node(cardmgr_t,cardmgr_lnk_t,lnk_file)
Chris PeBenito e0d57f
Chris PeBenito d9fd8e
# Create stab file
Chris PeBenito d9fd8e
allow cardmgr_t cardmgr_var_lib_t:file create_file_perms;
Chris PeBenito d9fd8e
files_create_var_lib(cardmgr_t,cardmgr_var_lib_t)
Chris PeBenito d9fd8e
Chris PeBenito e0d57f
allow cardmgr_t cardmgr_var_run_t:file create_file_perms;
Chris PeBenito e0d57f
files_create_pid(cardmgr_t,cardmgr_var_run_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
kernel_read_system_state(cardmgr_t)
Chris PeBenito e0d57f
kernel_read_kernel_sysctl(cardmgr_t)
Chris PeBenito e0d57f
kernel_list_proc(cardmgr_t)
Chris PeBenito e0d57f
kernel_read_proc_symlinks(cardmgr_t)
Chris PeBenito 50f650
kernel_dontaudit_getattr_message_if(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito 681c9a
bootloader_search_kernel_modules(cardmgr_t)
Chris PeBenito 681c9a
Chris PeBenito e0d57f
dev_read_sysfs(cardmgr_t)
Chris PeBenito 50f650
dev_getattr_all_chr_files(cardmgr_t)
Chris PeBenito 50f650
dev_getattr_all_blk_files(cardmgr_t)
Chris PeBenito e0d57f
# for SSP
Chris PeBenito e0d57f
dev_read_urand(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
fs_getattr_all_fs(cardmgr_t)
Chris PeBenito e0d57f
fs_search_auto_mountpoints(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
term_use_unallocated_tty(cardmgr_t)
Chris PeBenito 50f650
term_getattr_all_user_ttys(cardmgr_t)
Chris PeBenito e0d57f
term_dontaudit_use_console(cardmgr_t)
Chris PeBenito d9fd8e
term_dontaudit_getattr_all_user_ptys(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
corecmd_exec_bin(cardmgr_t)
Chris PeBenito e0d57f
corecmd_exec_sbin(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
domain_use_wide_inherit_fd(cardmgr_t)
Chris PeBenito e0d57f
domain_exec_all_entry_files(cardmgr_t)
Chris PeBenito 157c69
# Read /proc/PID directories for all domains (for fuser).
Chris PeBenito 605ba2
domain_read_confined_domains_state(cardmgr_t)
Chris PeBenito ccc597
domain_getattr_confined_domains(cardmgr_t)
Chris PeBenito ccc597
domain_dontaudit_ptrace_confined_domains(cardmgr_t)
Chris PeBenito 50f650
# cjp: these look excessive:
Chris PeBenito 50f650
domain_dontaudit_getattr_all_unnamed_pipes(cardmgr_t)
Chris PeBenito 157c69
domain_dontaudit_getattr_all_sockets(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito 681c9a
files_list_usr(cardmgr_t)
Chris PeBenito e0d57f
files_search_home(cardmgr_t)
Chris PeBenito e0d57f
files_read_etc_runtime_files(cardmgr_t)
Chris PeBenito e0d57f
files_exec_etc_files(cardmgr_t)
Chris PeBenito d9fd8e
# for /var/lib/misc/pcmcia-scheme
Chris PeBenito d9fd8e
# would be better to have it in a different type if I knew how it was created..
Chris PeBenito d9fd8e
files_read_var_lib_files(cardmgr_t)
Chris PeBenito 50f650
# cjp: these look excessive:
Chris PeBenito 50f650
files_dontaudit_getattr_all_dirs(cardmgr_t)
Chris PeBenito 50f650
files_dontaudit_getattr_all_files(cardmgr_t)
Chris PeBenito 50f650
files_dontaudit_getattr_all_symlinks(cardmgr_t)
Chris PeBenito 50f650
files_dontaudit_getattr_all_pipes(cardmgr_t)
Chris PeBenito 50f650
files_dontaudit_getattr_all_sockets(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
init_use_fd(cardmgr_t)
Chris PeBenito e0d57f
init_use_script_pty(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
libs_use_ld_so(cardmgr_t)
Chris PeBenito e0d57f
libs_use_shared_libs(cardmgr_t)
Chris PeBenito e0d57f
libs_exec_ld_so(cardmgr_t)
Chris PeBenito e0d57f
libs_exec_lib_files(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
logging_send_syslog_msg(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
miscfiles_read_localization(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito 681c9a
modutils_domtrans_insmod(cardmgr_t)
Chris PeBenito 681c9a
Chris PeBenito e0d57f
sysnet_domtrans_ifconfig(cardmgr_t)
Chris PeBenito e0d57f
# for /etc/resolv.conf
Chris PeBenito 57a96c
sysnet_create_config(cardmgr_t)
Chris PeBenito e0d57f
sysnet_manage_config(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
userdom_dontaudit_use_unpriv_user_fd(cardmgr_t)
Chris PeBenito e0d57f
userdom_dontaudit_search_sysadm_home_dir(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
ifdef(`targeted_policy', `
Chris PeBenito e0d57f
	term_dontaudit_use_unallocated_tty(cardmgr_t)
Chris PeBenito e0d57f
	term_dontaudit_use_generic_pty(cardmgr_t)
Chris PeBenito e0d57f
	files_dontaudit_read_root_file(cardmgr_t)
Chris PeBenito e0d57f
')
Chris PeBenito e0d57f
Chris PeBenito e0d57f
optional_policy(`selinuxutils.te',`
Chris PeBenito e0d57f
	seutil_sigchld_newrole(cardmgr_t)
Chris PeBenito e0d57f
')
Chris PeBenito e0d57f
Chris PeBenito 3fd833
optional_policy(`sysnetwork.te',`
Chris PeBenito 3fd833
	sysnet_domtrans_dhcpc(cardmgr_t)
Chris PeBenito 3fd833
Chris PeBenito 3fd833
	sysnet_read_dhcpc_pid(cardmgr_t)
Chris PeBenito 681c9a
	sysnet_delete_dhcpc_pid(cardmgr_t)
Chris PeBenito 3fd833
	sysnet_kill_dhcpc(cardmgr_t)
Chris PeBenito 3fd833
	sysnet_sigchld_dhcpc(cardmgr_t)
Chris PeBenito 3fd833
	sysnet_signal_dhcpc(cardmgr_t)
Chris PeBenito 3fd833
	sysnet_signull_dhcpc(cardmgr_t)
Chris PeBenito 3fd833
	sysnet_sigstop_dhcpc(cardmgr_t)
Chris PeBenito 3fd833
')
Chris PeBenito 3fd833
Chris PeBenito e0d57f
optional_policy(`udev.te', `
Chris PeBenito e0d57f
	udev_read_db(cardmgr_t)
Chris PeBenito e0d57f
')
Chris PeBenito e0d57f
Chris PeBenito e0d57f
ifdef(`TODO',`
Chris PeBenito e0d57f
# Create device files in /tmp.
Chris PeBenito d9fd8e
# cjp: why is this created all over the place?
Chris PeBenito e0d57f
file_type_auto_trans(cardmgr_t, { var_run_t cardmgr_var_run_t device_t tmp_t }, cardmgr_dev_t, { blk_file chr_file })
Chris PeBenito e0d57f
Chris PeBenito c0d156
optional_policy(`rhgb.te',`
Chris PeBenito c0d156
	rhgb_domain(cardmgr_t)
Chris PeBenito c0d156
')
Chris PeBenito e0d57f
') dnl end TODO