Chris PeBenito 57a96c
Chris PeBenito 57a96c
policy_module(firstboot,1.0)
Chris PeBenito 57a96c
Chris PeBenito 41c480
gen_require(`
Chris PeBenito 41c480
	class passwd rootok;
Chris PeBenito 41c480
')
Chris PeBenito 41c480
Chris PeBenito 57a96c
########################################
Chris PeBenito 57a96c
#
Chris PeBenito 57a96c
# Declarations
Chris PeBenito 57a96c
#
Chris PeBenito 57a96c
Chris PeBenito 57a96c
type firstboot_t;
Chris PeBenito 57a96c
type firstboot_exec_t;
Chris PeBenito 57a96c
init_system_domain(firstboot_t,firstboot_exec_t)
Chris PeBenito 57a96c
domain_obj_id_change_exempt(firstboot_t)
Chris PeBenito 605ba2
domain_subj_id_change_exempt(firstboot_t)
Chris PeBenito 57a96c
role system_r types firstboot_t;
Chris PeBenito 57a96c
Chris PeBenito 9bbc75
type firstboot_etc_t;
Chris PeBenito 9bbc75
files_config_file(firstboot_etc_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
type firstboot_rw_t;
Chris PeBenito 57a96c
files_type(firstboot_rw_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
########################################
Chris PeBenito 57a96c
#
Chris PeBenito 57a96c
# Local policy
Chris PeBenito 57a96c
#
Chris PeBenito 57a96c
Chris PeBenito 57a96c
allow firstboot_t self:capability { dac_override setgid };
Chris PeBenito 57a96c
allow firstboot_t self:process setfscreate;
Chris PeBenito 57a96c
allow firstboot_t self:file { read write };
Chris PeBenito 57a96c
allow firstboot_t self:fifo_file { getattr read write };
Chris PeBenito 57a96c
allow firstboot_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 57a96c
allow firstboot_t self:unix_stream_socket { connect create };
Chris PeBenito 57a96c
allow firstboot_t self:passwd rootok;
Chris PeBenito 57a96c
Chris PeBenito 57a96c
allow firstboot_t firstboot_etc_t:file { getattr read };
Chris PeBenito 57a96c
Chris PeBenito 57a96c
allow firstboot_t firstboot_rw_t:dir create_dir_perms;
Chris PeBenito 57a96c
allow firstboot_t firstboot_rw_t:file create_file_perms;
Chris PeBenito 57a96c
files_create_etc_config(firstboot_t,firstboot_rw_t,file)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
# The big hammer
Chris PeBenito 57a96c
unconfined_domain_template(firstboot_t) 
Chris PeBenito 57a96c
Chris PeBenito 57a96c
kernel_read_system_state(firstboot_t)
Chris PeBenito 57a96c
kernel_read_kernel_sysctl(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
corenet_tcp_sendrecv_all_if(firstboot_t)
Chris PeBenito 57a96c
corenet_raw_sendrecv_all_if(firstboot_t)
Chris PeBenito 57a96c
corenet_tcp_sendrecv_all_nodes(firstboot_t)
Chris PeBenito 57a96c
corenet_raw_sendrecv_all_nodes(firstboot_t)
Chris PeBenito 57a96c
corenet_tcp_sendrecv_all_ports(firstboot_t)
Chris PeBenito 57a96c
corenet_tcp_bind_all_nodes(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
dev_read_urand(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
selinux_get_fs_mount(firstboot_t)
Chris PeBenito 57a96c
selinux_validate_context(firstboot_t)
Chris PeBenito 57a96c
selinux_compute_access_vector(firstboot_t)
Chris PeBenito 57a96c
selinux_compute_create_context(firstboot_t)
Chris PeBenito 57a96c
selinux_compute_relabel_context(firstboot_t)
Chris PeBenito 57a96c
selinux_compute_user_contexts(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
auth_dontaudit_getattr_shadow(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
corecmd_exec_bin(firstboot_t)
Chris PeBenito 57a96c
corecmd_exec_sbin(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
domain_exec_all_entry_files(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
files_exec_etc_files(firstboot_t)
Chris PeBenito 57a96c
files_manage_etc_files(firstboot_t)
Chris PeBenito 57a96c
files_read_etc_runtime_files(firstboot_t)
Chris PeBenito 57a96c
files_read_usr_files(firstboot_t)
Chris PeBenito 57a96c
files_manage_var_dirs(firstboot_t)
Chris PeBenito 57a96c
files_manage_var_files(firstboot_t)
Chris PeBenito 57a96c
files_manage_var_symlinks(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 33acca
init_domtrans_script(firstboot_t)
Chris PeBenito 57a96c
init_rw_script_pid(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
libs_use_ld_so(firstboot_t)
Chris PeBenito 57a96c
libs_use_shared_libs(firstboot_t)
Chris PeBenito 57a96c
libs_exec_ld_so(firstboot_t)
Chris PeBenito 57a96c
libs_exec_lib_files(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
locallogin_use_fd(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
logging_send_syslog_msg(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
miscfiles_read_localization(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
modutils_domtrans_insmod(firstboot_t)
Chris PeBenito 57a96c
modutils_read_module_conf(firstboot_t)
Chris PeBenito 57a96c
modutils_read_mods_deps(firstboot_t)
Chris PeBenito 57a96c
Chris PeBenito 57a96c
# Add/remove user home directories
Chris PeBenito 671673
userdom_create_generic_user_home_dir(firstboot_t)
Chris PeBenito 671673
userdom_manage_generic_user_home_dir(firstboot_t)
Chris PeBenito 671673
userdom_create_generic_user_home(firstboot_t,{ dir file lnk_file fifo_file sock_file })
Chris PeBenito 671673
userdom_manage_generic_user_home_dirs(firstboot_t)
Chris PeBenito 671673
userdom_manage_generic_user_home_files(firstboot_t)
Chris PeBenito 671673
userdom_manage_generic_user_home_symlinks(firstboot_t)
Chris PeBenito 671673
userdom_manage_generic_user_home_pipes(firstboot_t)
Chris PeBenito 671673
userdom_manage_generic_user_home_sockets(firstboot_t)
Chris PeBenito 605ba2
Chris PeBenito 605ba2
ifdef(`targeted_policy',`
Chris PeBenito 605ba2
	unconfined_domtrans(firstboot_t)
Chris PeBenito 605ba2
')
Chris PeBenito 57a96c
Chris PeBenito 57a96c
optional_policy(`nis.te',`
Chris PeBenito 57a96c
	nis_use_ypbind(firstboot_t)
Chris PeBenito 57a96c
')
Chris PeBenito 57a96c
Chris PeBenito 41c480
optional_policy(`samba.te',`
Chris PeBenito 41c480
	samba_rw_config(firstboot_t)
Chris PeBenito 41c480
')
Chris PeBenito 41c480
Chris PeBenito 605ba2
optional_policy(`usermanage.te',`
Chris PeBenito 3774e4
	usermanage_domtrans_chfn(firstboot_t)
Chris PeBenito 605ba2
	usermanage_domtrans_groupadd(firstboot_t)
Chris PeBenito 3774e4
	usermanage_domtrans_passwd(firstboot_t)
Chris PeBenito 3774e4
	usermanage_domtrans_useradd(firstboot_t)
Chris PeBenito 605ba2
')
Chris PeBenito 605ba2
Chris PeBenito 57a96c
ifdef(`TODO',`
Chris PeBenito 57a96c
allow firstboot_t proc_t:file write;
Chris PeBenito 57a96c
Chris PeBenito 57a96c
ifdef(`printconf.te', `
Chris PeBenito 57a96c
	can_exec(firstboot_t, printconf_t)
Chris PeBenito 57a96c
')
Chris PeBenito 57a96c
Chris PeBenito 57a96c
ifdef(`userhelper.te', `
Chris PeBenito 57a96c
	role system_r types sysadm_userhelper_t;
Chris PeBenito 57a96c
	domain_auto_trans(firstboot_t, userhelper_exec_t, sysadm_userhelper_t)
Chris PeBenito 57a96c
')
Chris PeBenito 57a96c
Chris PeBenito 57a96c
ifdef(`xserver.te', `
Chris PeBenito 57a96c
	domain_auto_trans(firstboot_t, xserver_exec_t, xdm_xserver_t)
Chris PeBenito 57a96c
')
Chris PeBenito 57a96c
') dnl end TODO