2010-05-24 19:32:01 +00:00
|
|
|
policy_module(cobbler, 1.1.0)
|
2010-01-05 15:26:14 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Cobbler personal declarations.
|
|
|
|
#
|
|
|
|
|
|
|
|
## <desc>
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-22 10:07:37 +00:00
|
|
|
## <p>
|
|
|
|
## Allow Cobbler to modify public files
|
|
|
|
## used for public file transfer services.
|
|
|
|
## </p>
|
2010-01-05 15:26:14 +00:00
|
|
|
## </desc>
|
|
|
|
gen_tunable(cobbler_anon_write, false)
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-22 10:07:37 +00:00
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
## <desc>
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-22 10:07:37 +00:00
|
|
|
## <p>
|
|
|
|
## Allow Cobbler to connect to the
|
|
|
|
## network using TCP.
|
|
|
|
## </p>
|
2010-08-26 13:41:21 +00:00
|
|
|
## </desc>
|
|
|
|
gen_tunable(cobbler_can_network_connect, false)
|
|
|
|
|
|
|
|
## <desc>
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-22 10:07:37 +00:00
|
|
|
## <p>
|
|
|
|
## Allow Cobbler to access cifs file systems.
|
|
|
|
## </p>
|
2010-08-26 13:41:21 +00:00
|
|
|
## </desc>
|
|
|
|
gen_tunable(cobbler_use_cifs, false)
|
|
|
|
|
|
|
|
## <desc>
|
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
Whitespace, newline and tab fixes.
2010-09-22 10:07:37 +00:00
|
|
|
## <p>
|
|
|
|
## Allow Cobbler to access nfs file systems.
|
|
|
|
## </p>
|
2010-08-26 13:41:21 +00:00
|
|
|
## </desc>
|
|
|
|
gen_tunable(cobbler_use_nfs, false)
|
2010-01-05 15:26:14 +00:00
|
|
|
|
|
|
|
type cobblerd_t;
|
|
|
|
type cobblerd_exec_t;
|
|
|
|
init_daemon_domain(cobblerd_t, cobblerd_exec_t)
|
|
|
|
|
|
|
|
type cobblerd_initrc_exec_t;
|
|
|
|
init_script_file(cobblerd_initrc_exec_t)
|
|
|
|
|
|
|
|
type cobbler_etc_t;
|
|
|
|
files_config_file(cobbler_etc_t)
|
|
|
|
|
|
|
|
type cobbler_var_log_t;
|
|
|
|
logging_log_file(cobbler_var_log_t)
|
|
|
|
|
2010-08-26 16:55:57 +00:00
|
|
|
type cobbler_var_lib_t alias cobbler_content_t;
|
|
|
|
files_type(cobbler_var_lib_t)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
type cobbler_tmp_t;
|
|
|
|
files_tmp_file(cobbler_tmp_t)
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
########################################
|
|
|
|
#
|
2010-08-26 16:55:57 +00:00
|
|
|
# Cobbler personal policy.
|
2010-01-05 15:26:14 +00:00
|
|
|
#
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
allow cobblerd_t self:capability { chown dac_override fowner fsetid sys_nice };
|
|
|
|
dontaudit cobblerd_t self:capability { sys_ptrace sys_tty_config };
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
allow cobblerd_t self:process { getsched setsched signal };
|
|
|
|
allow cobblerd_t self:fifo_file rw_fifo_file_perms;
|
2010-08-26 13:41:21 +00:00
|
|
|
allow cobblerd_t self:netlink_route_socket create_netlink_socket_perms;
|
2010-01-05 15:26:14 +00:00
|
|
|
allow cobblerd_t self:tcp_socket create_stream_socket_perms;
|
2010-08-26 13:41:21 +00:00
|
|
|
allow cobblerd_t self:udp_socket create_socket_perms;
|
|
|
|
allow cobblerd_t self:unix_dgram_socket create_socket_perms;
|
2010-01-05 15:26:14 +00:00
|
|
|
|
2010-05-07 14:09:07 +00:00
|
|
|
list_dirs_pattern(cobblerd_t, cobbler_etc_t, cobbler_etc_t)
|
2010-01-05 15:26:14 +00:00
|
|
|
read_files_pattern(cobblerd_t, cobbler_etc_t, cobbler_etc_t)
|
|
|
|
|
2010-08-26 16:55:57 +00:00
|
|
|
# Something that runs in the cobberd_t domain tries to relabelfrom cobbler_var_lib_t dir to httpd_sys_content_t.
|
|
|
|
dontaudit cobblerd_t cobbler_var_lib_t:dir relabel_dir_perms;
|
2010-08-26 13:41:21 +00:00
|
|
|
|
2010-08-26 16:55:57 +00:00
|
|
|
manage_dirs_pattern(cobblerd_t, cobbler_var_lib_t, cobbler_var_lib_t)
|
|
|
|
manage_files_pattern(cobblerd_t, cobbler_var_lib_t, cobbler_var_lib_t)
|
|
|
|
manage_lnk_files_pattern(cobblerd_t, cobbler_var_lib_t, cobbler_var_lib_t)
|
|
|
|
files_var_lib_filetrans(cobblerd_t, cobbler_var_lib_t, { dir file lnk_file })
|
2010-08-26 13:41:21 +00:00
|
|
|
|
|
|
|
# Something really needs to write to cobbler.log. Ideally this should not be happening.
|
|
|
|
allow cobblerd_t cobbler_var_log_t:file write;
|
2010-01-05 15:26:14 +00:00
|
|
|
|
|
|
|
append_files_pattern(cobblerd_t, cobbler_var_log_t, cobbler_var_log_t)
|
|
|
|
create_files_pattern(cobblerd_t, cobbler_var_log_t, cobbler_var_log_t)
|
|
|
|
read_files_pattern(cobblerd_t, cobbler_var_log_t, cobbler_var_log_t)
|
|
|
|
setattr_files_pattern(cobblerd_t, cobbler_var_log_t, cobbler_var_log_t)
|
|
|
|
logging_log_filetrans(cobblerd_t, cobbler_var_log_t, file)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
manage_dirs_pattern(cobblerd_t, cobbler_tmp_t, cobbler_tmp_t)
|
|
|
|
manage_files_pattern(cobblerd_t, cobbler_tmp_t, cobbler_tmp_t)
|
|
|
|
files_tmp_filetrans(cobblerd_t, cobbler_tmp_t, { dir file })
|
|
|
|
|
2010-02-08 18:38:48 +00:00
|
|
|
kernel_read_system_state(cobblerd_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
kernel_dontaudit_search_network_state(cobblerd_t)
|
2010-02-08 18:38:48 +00:00
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
corecmd_exec_bin(cobblerd_t)
|
|
|
|
corecmd_exec_shell(cobblerd_t)
|
|
|
|
|
|
|
|
corenet_all_recvfrom_netlabel(cobblerd_t)
|
|
|
|
corenet_all_recvfrom_unlabeled(cobblerd_t)
|
2010-08-26 16:55:57 +00:00
|
|
|
corenet_sendrecv_cobbler_server_packets(cobblerd_t)
|
|
|
|
corenet_tcp_bind_cobbler_port(cobblerd_t)
|
2010-01-05 15:26:14 +00:00
|
|
|
corenet_tcp_bind_generic_node(cobblerd_t)
|
|
|
|
corenet_tcp_sendrecv_generic_if(cobblerd_t)
|
|
|
|
corenet_tcp_sendrecv_generic_node(cobblerd_t)
|
|
|
|
corenet_tcp_sendrecv_generic_port(cobblerd_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
corenet_tcp_sendrecv_cobbler_port(cobblerd_t)
|
|
|
|
# sync and rsync to ftp and http are permitted by default, for any other media use cobbler_can_network_connect.
|
|
|
|
corenet_tcp_connect_ftp_port(cobblerd_t)
|
|
|
|
corenet_tcp_sendrecv_ftp_port(cobblerd_t)
|
|
|
|
corenet_sendrecv_ftp_client_packets(cobblerd_t)
|
|
|
|
corenet_tcp_connect_http_port(cobblerd_t)
|
|
|
|
corenet_tcp_sendrecv_http_port(cobblerd_t)
|
|
|
|
corenet_sendrecv_http_client_packets(cobblerd_t)
|
2010-01-05 15:26:14 +00:00
|
|
|
|
|
|
|
dev_read_urand(cobblerd_t)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
domain_dontaudit_exec_all_entry_files(cobblerd_t)
|
|
|
|
domain_dontaudit_read_all_domains_state(cobblerd_t)
|
|
|
|
|
|
|
|
files_read_etc_files(cobblerd_t)
|
|
|
|
# mtab
|
|
|
|
files_read_etc_runtime_files(cobblerd_t)
|
2010-01-05 15:26:14 +00:00
|
|
|
files_read_usr_files(cobblerd_t)
|
|
|
|
files_list_boot(cobblerd_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
files_read_boot_files(cobblerd_t)
|
2010-01-05 15:26:14 +00:00
|
|
|
files_list_tmp(cobblerd_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
|
|
|
|
# read from mounted images (install media)
|
|
|
|
fs_read_iso9660_files(cobblerd_t)
|
|
|
|
|
|
|
|
init_dontaudit_read_all_script_files(cobblerd_t)
|
|
|
|
|
|
|
|
term_use_console(cobblerd_t)
|
2010-01-05 15:26:14 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(cobblerd_t)
|
|
|
|
miscfiles_read_public_files(cobblerd_t)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
selinux_dontaudit_read_fs(cobblerd_t)
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
sysnet_read_config(cobblerd_t)
|
|
|
|
sysnet_rw_dhcp_config(cobblerd_t)
|
|
|
|
sysnet_write_config(cobblerd_t)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
userdom_dontaudit_use_user_terminals(cobblerd_t)
|
|
|
|
userdom_dontaudit_search_user_home_dirs(cobblerd_t)
|
|
|
|
userdom_dontaudit_search_admin_dir(cobblerd_t)
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
tunable_policy(`cobbler_anon_write',`
|
|
|
|
miscfiles_manage_public_files(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
tunable_policy(`cobbler_can_network_connect',`
|
|
|
|
corenet_tcp_connect_all_ports(cobblerd_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(cobblerd_t)
|
|
|
|
corenet_sendrecv_all_client_packets(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`cobbler_use_cifs',`
|
|
|
|
fs_manage_cifs_dirs(cobblerd_t)
|
|
|
|
fs_manage_cifs_files(cobblerd_t)
|
|
|
|
fs_manage_cifs_symlinks(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`cobbler_use_nfs',`
|
|
|
|
fs_manage_nfs_dirs(cobblerd_t)
|
|
|
|
fs_manage_nfs_files(cobblerd_t)
|
|
|
|
fs_manage_nfs_symlinks(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
# Cobbler traverses /var/www to get to /var/www/cobbler/*
|
|
|
|
apache_search_sys_content(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
optional_policy(`
|
|
|
|
bind_read_config(cobblerd_t)
|
|
|
|
bind_write_config(cobblerd_t)
|
|
|
|
bind_domtrans_ndc(cobblerd_t)
|
|
|
|
bind_domtrans(cobblerd_t)
|
|
|
|
bind_initrc_domtrans(cobblerd_t)
|
|
|
|
bind_manage_zone(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
optional_policy(`
|
|
|
|
certmaster_exec(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
optional_policy(`
|
|
|
|
dhcpd_domtrans(cobblerd_t)
|
|
|
|
dhcpd_initrc_domtrans(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
dnsmasq_domtrans(cobblerd_t)
|
|
|
|
dnsmasq_initrc_domtrans(cobblerd_t)
|
|
|
|
dnsmasq_write_config(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
optional_policy(`
|
|
|
|
gnome_dontaudit_search_config(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
2010-01-05 15:26:14 +00:00
|
|
|
optional_policy(`
|
|
|
|
rpm_exec(cobblerd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2010-08-26 13:41:21 +00:00
|
|
|
rsync_exec(cobblerd_t)
|
|
|
|
rsync_manage_config(cobblerd_t)
|
|
|
|
# cobbler creates /etc/rsync.conf if its not there.
|
|
|
|
rsync_filetrans_config(cobblerd_t, file)
|
2010-01-05 15:26:14 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2010-08-26 13:41:21 +00:00
|
|
|
# Cobbler puts objects in both /var/lib/tftpdir as well as /var/lib/tftpdir/images.
|
|
|
|
# tftp_manage_rw_content(cobblerd_t) can be used instead if:
|
|
|
|
# 1. cobbler package installs /var/lib/tftpdir/images.
|
|
|
|
# 2. no FILES in /var/lib/TFTPDIR are hard linked.
|
|
|
|
# Cobbler also creates other directories in /var/lib/tftpdir (etc, s390x, ppc, pxelinux.cfg)
|
|
|
|
# are any of those hard linked?
|
2010-08-26 16:55:57 +00:00
|
|
|
tftp_filetrans_tftpdir(cobblerd_t, cobbler_var_lib_t, { dir file })
|
2010-01-05 15:26:14 +00:00
|
|
|
')
|
2010-05-07 14:09:07 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Cobbler web local policy.
|
|
|
|
#
|
|
|
|
|
2010-08-26 16:55:57 +00:00
|
|
|
apache_content_template(cobbler)
|
|
|
|
manage_dirs_pattern(cobblerd_t, httpd_cobbler_content_rw_t, httpd_cobbler_content_rw_t)
|
|
|
|
manage_files_pattern(cobblerd_t, httpd_cobbler_content_rw_t, httpd_cobbler_content_rw_t)
|