2005-08-03 17:56:26 +00:00
|
|
|
|
2006-05-30 19:46:34 +00:00
|
|
|
policy_module(mysql,1.2.2)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type mysqld_t;
|
|
|
|
type mysqld_exec_t;
|
|
|
|
init_daemon_domain(mysqld_t,mysqld_exec_t)
|
|
|
|
|
|
|
|
type mysqld_var_run_t;
|
|
|
|
files_pid_file(mysqld_var_run_t)
|
|
|
|
|
|
|
|
type mysqld_db_t;
|
2005-09-05 18:17:17 +00:00
|
|
|
files_type(mysqld_db_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
type mysqld_etc_t alias etc_mysqld_t;
|
2005-10-24 18:40:24 +00:00
|
|
|
files_config_file(mysqld_etc_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
type mysqld_log_t;
|
|
|
|
logging_log_file(mysqld_log_t)
|
|
|
|
|
|
|
|
type mysqld_tmp_t;
|
|
|
|
files_tmp_file(mysqld_tmp_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2005-11-10 21:37:54 +00:00
|
|
|
allow mysqld_t self:capability { dac_override setgid setuid sys_resource net_bind_service };
|
2005-08-03 17:56:26 +00:00
|
|
|
dontaudit mysqld_t self:capability sys_tty_config;
|
2005-11-10 21:37:54 +00:00
|
|
|
allow mysqld_t self:process { setsched getsched setrlimit signal_perms };
|
2005-08-03 17:56:26 +00:00
|
|
|
allow mysqld_t self:fifo_file { read write };
|
2005-09-15 21:03:29 +00:00
|
|
|
allow mysqld_t self:netlink_route_socket r_netlink_socket_perms;
|
2005-08-03 17:56:26 +00:00
|
|
|
allow mysqld_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow mysqld_t self:tcp_socket create_stream_socket_perms;
|
2005-10-14 17:55:40 +00:00
|
|
|
allow mysqld_t self:udp_socket create_socket_perms;
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
allow mysqld_t mysqld_db_t:dir create_dir_perms;
|
|
|
|
allow mysqld_t mysqld_db_t:file create_file_perms;
|
|
|
|
allow mysqld_t mysqld_db_t:lnk_file create_lnk_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_var_lib_filetrans(mysqld_t,mysqld_db_t,{ dir file })
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
allow mysqld_t mysqld_etc_t:file { getattr read };
|
2005-10-26 18:07:20 +00:00
|
|
|
allow mysqld_t mysqld_etc_t:lnk_file { getattr read };
|
|
|
|
allow mysqld_t mysqld_etc_t:dir list_dir_perms;
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
allow mysqld_t mysqld_log_t:file create_file_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
logging_log_filetrans(mysqld_t,mysqld_log_t,file)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
allow mysqld_t mysqld_tmp_t:dir create_dir_perms;
|
|
|
|
allow mysqld_t mysqld_tmp_t:file create_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(mysqld_t, mysqld_tmp_t, { file dir })
|
2005-08-03 17:56:26 +00:00
|
|
|
|
2005-10-24 00:23:12 +00:00
|
|
|
allow mysqld_t mysqld_var_run_t:dir rw_dir_perms;
|
2005-08-03 17:56:26 +00:00
|
|
|
allow mysqld_t mysqld_var_run_t:sock_file create_file_perms;
|
|
|
|
allow mysqld_t mysqld_var_run_t:file create_file_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
files_pid_filetrans(mysqld_t,mysqld_var_run_t,file)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(mysqld_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
kernel_read_kernel_sysctls(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_non_ipsec_sendrecv(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(mysqld_t)
|
2005-10-14 17:55:40 +00:00
|
|
|
corenet_udp_sendrecv_all_if(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
corenet_tcp_sendrecv_all_nodes(mysqld_t)
|
2005-10-14 17:55:40 +00:00
|
|
|
corenet_udp_sendrecv_all_nodes(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(mysqld_t)
|
2005-10-14 17:55:40 +00:00
|
|
|
corenet_udp_sendrecv_all_ports(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
corenet_tcp_bind_all_nodes(mysqld_t)
|
|
|
|
corenet_tcp_bind_mysqld_port(mysqld_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
corenet_tcp_connect_mysqld_port(mysqld_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_mysqld_client_packets(mysqld_t)
|
|
|
|
corenet_sendrecv_mysqld_server_packets(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
dev_read_sysfs(mysqld_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(mysqld_t)
|
|
|
|
fs_search_auto_mountpoints(mysqld_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_console(mysqld_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
2006-01-31 19:21:01 +00:00
|
|
|
files_getattr_var_lib_dirs(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
files_read_etc_runtime_files(mysqld_t)
|
2005-10-24 00:23:12 +00:00
|
|
|
files_read_etc_files(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
files_read_usr_files(mysqld_t)
|
2005-10-24 00:23:12 +00:00
|
|
|
files_search_var_lib(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(mysqld_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(mysqld_t)
|
|
|
|
libs_use_shared_libs(mysqld_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(mysqld_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(mysqld_t)
|
|
|
|
|
2006-04-12 15:04:28 +00:00
|
|
|
sysnet_use_ldap(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
sysnet_read_config(mysqld_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
# for /root/.my.cnf - should not be needed:
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_read_sysadm_home_content_files(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
|
|
|
|
ifdef(`distro_redhat',`
|
|
|
|
# because Fedora has the sock_file in the database directory
|
|
|
|
type_transition mysqld_t mysqld_db_t:sock_file mysqld_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`targeted_policy',`
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(mysqld_t)
|
|
|
|
term_dontaudit_use_generic_ptys(mysqld_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(mysqld_t)
|
2005-08-03 17:56:26 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-16 18:30:14 +00:00
|
|
|
daemontools_service_domain(mysqld_t, mysqld_exec_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-14 17:55:40 +00:00
|
|
|
mount_send_nfs_client_request(mysqld_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-03 17:56:26 +00:00
|
|
|
nis_use_ypbind(mysqld_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(mysqld_t)
|
2005-09-15 21:03:29 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-03 17:56:26 +00:00
|
|
|
seutil_sigchld_newrole(mysqld_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-03 17:56:26 +00:00
|
|
|
udev_read_db(mysqld_t)
|
|
|
|
')
|