Chris PeBenito e0d57f
Chris PeBenito fb63d0
policy_module(pcmcia,1.0.1)
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 da4fc9
allow cardmgr_t self:process signal_perms;
Chris PeBenito da4fc9
allow cardmgr_t self:fifo_file rw_file_perms;
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
Chris PeBenito e0d57f
allow cardmgr_t cardmgr_lnk_t:lnk_file create_lnk_perms;
Chris PeBenito 103fe2
dev_filetrans(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 33acca
allow cardmgr_t cardmgr_var_lib_t:dir rw_dir_perms;
Chris PeBenito 1c1ac6
files_var_lib_filetrans(cardmgr_t,cardmgr_var_lib_t,file)
Chris PeBenito d9fd8e
Chris PeBenito e0d57f
allow cardmgr_t cardmgr_var_run_t:file create_file_perms;
Chris PeBenito 1c1ac6
files_pid_filetrans(cardmgr_t,cardmgr_var_run_t,file)
Chris PeBenito e0d57f
Chris PeBenito e0d57f
kernel_read_system_state(cardmgr_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(cardmgr_t)
Chris PeBenito 50f650
kernel_dontaudit_getattr_message_if(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito 1c1ac6
files_search_kernel_modules(cardmgr_t)
Chris PeBenito 681c9a
Chris PeBenito e0d57f
dev_read_sysfs(cardmgr_t)
Chris PeBenito 207c47
dev_manage_cardmgr_dev(cardmgr_t)
Chris PeBenito 207c47
dev_create_cardmgr_dev(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 1815ba
term_use_unallocated_ttys(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 fb63d0
corecmd_exec_all_executables(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito 15722e
domain_use_interactive_fds(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 09741b
domain_dontaudit_getattr_all_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 1c1ac6
init_use_fds(cardmgr_t)
Chris PeBenito 1815ba
init_use_script_ptys(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 103fe2
sysnet_etc_filetrans_config(cardmgr_t)
Chris PeBenito e0d57f
sysnet_manage_config(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito 15722e
userdom_dontaudit_use_unpriv_user_fds(cardmgr_t)
Chris PeBenito 103fe2
userdom_dontaudit_search_sysadm_home_dirs(cardmgr_t)
Chris PeBenito e0d57f
Chris PeBenito e6a2ea
ifdef(`targeted_policy',`
Chris PeBenito 1815ba
	term_use_unallocated_ttys(cardmgr_t)
Chris PeBenito 1815ba
	term_use_generic_ptys(cardmgr_t)
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(cardmgr_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(cardmgr_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(cardmgr_t)
Chris PeBenito e0d57f
')
Chris PeBenito e0d57f
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito da4fc9
	seutil_dontaudit_read_config(cardmgr_t)
Chris PeBenito e0d57f
	seutil_sigchld_newrole(cardmgr_t)
Chris PeBenito e0d57f
')
Chris PeBenito e0d57f
Chris PeBenito bb7170
optional_policy(`
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 bb7170
optional_policy(`
Chris PeBenito e0d57f
	udev_read_db(cardmgr_t)
Chris PeBenito e0d57f
')
Chris PeBenito e0d57f
Chris PeBenito 9bbc75
# Create device files in /tmp.
Chris PeBenito 9bbc75
# cjp: why is this created all over the place?
Chris PeBenito 9fd4b8
allow cardmgr_t { var_run_t cardmgr_var_run_t tmp_t }:dir rw_dir_perms;
Chris PeBenito 9fd4b8
type_transition cardmgr_t { var_run_t cardmgr_var_run_t tmp_t }:{ chr_file blk_file } cardmgr_dev_t;