Chris PeBenito 42be7c
Chris PeBenito d3d270
policy_module(mysql,1.2.0)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
########################################
Chris PeBenito 42be7c
#
Chris PeBenito 42be7c
# Declarations
Chris PeBenito 42be7c
#
Chris PeBenito 42be7c
Chris PeBenito 42be7c
type mysqld_t;
Chris PeBenito 42be7c
type mysqld_exec_t;
Chris PeBenito 42be7c
init_daemon_domain(mysqld_t,mysqld_exec_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
type mysqld_var_run_t;
Chris PeBenito 42be7c
files_pid_file(mysqld_var_run_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
type mysqld_db_t;
Chris PeBenito 603f90
files_type(mysqld_db_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
type mysqld_etc_t alias etc_mysqld_t;
Chris PeBenito 9bbc75
files_config_file(mysqld_etc_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
type mysqld_log_t;
Chris PeBenito 42be7c
logging_log_file(mysqld_log_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
type mysqld_tmp_t;
Chris PeBenito 42be7c
files_tmp_file(mysqld_tmp_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
########################################
Chris PeBenito 42be7c
#
Chris PeBenito 42be7c
# Local policy
Chris PeBenito 42be7c
#
Chris PeBenito 42be7c
Chris PeBenito 2e0a88
allow mysqld_t self:capability { dac_override setgid setuid sys_resource net_bind_service };
Chris PeBenito 42be7c
dontaudit mysqld_t self:capability sys_tty_config;
Chris PeBenito 2e0a88
allow mysqld_t self:process { setsched getsched setrlimit signal_perms };
Chris PeBenito 42be7c
allow mysqld_t self:fifo_file { read write };
Chris PeBenito 98a8ea
allow mysqld_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 42be7c
allow mysqld_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 42be7c
allow mysqld_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito d8636f
allow mysqld_t self:udp_socket create_socket_perms;
Chris PeBenito 42be7c
Chris PeBenito 42be7c
allow mysqld_t mysqld_db_t:dir create_dir_perms;
Chris PeBenito 42be7c
allow mysqld_t mysqld_db_t:file create_file_perms;
Chris PeBenito 42be7c
allow mysqld_t mysqld_db_t:lnk_file create_lnk_perms;
Chris PeBenito 103fe2
files_var_lib_filetrans(mysqld_t,mysqld_db_t,{ dir file })
Chris PeBenito 42be7c
Chris PeBenito 42be7c
allow mysqld_t mysqld_etc_t:file { getattr read };
Chris PeBenito d1b9d9
allow mysqld_t mysqld_etc_t:lnk_file { getattr read };
Chris PeBenito d1b9d9
allow mysqld_t mysqld_etc_t:dir list_dir_perms;
Chris PeBenito 42be7c
Chris PeBenito 42be7c
allow mysqld_t mysqld_log_t:file create_file_perms;
Chris PeBenito 1c1ac6
logging_log_filetrans(mysqld_t,mysqld_log_t,file)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
allow mysqld_t mysqld_tmp_t:dir create_dir_perms;
Chris PeBenito 42be7c
allow mysqld_t mysqld_tmp_t:file create_file_perms;
Chris PeBenito 103fe2
files_tmp_filetrans(mysqld_t, mysqld_tmp_t, { file dir })
Chris PeBenito 42be7c
Don Miner f8964c
allow mysqld_t mysqld_var_run_t:dir rw_dir_perms;
Chris PeBenito 42be7c
allow mysqld_t mysqld_var_run_t:sock_file create_file_perms;
Chris PeBenito 42be7c
allow mysqld_t mysqld_var_run_t:file create_file_perms;
Chris PeBenito 1c1ac6
files_pid_filetrans(mysqld_t,mysqld_var_run_t,file)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
kernel_list_proc(mysqld_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(mysqld_t)
Chris PeBenito 42be7c
kernel_read_proc_symlinks(mysqld_t)
Chris PeBenito 42be7c
kernel_read_system_state(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
corenet_tcp_sendrecv_all_if(mysqld_t)
Chris PeBenito d8636f
corenet_udp_sendrecv_all_if(mysqld_t)
Chris PeBenito 42be7c
corenet_raw_sendrecv_all_if(mysqld_t)
Chris PeBenito 42be7c
corenet_tcp_sendrecv_all_nodes(mysqld_t)
Chris PeBenito d8636f
corenet_udp_sendrecv_all_nodes(mysqld_t)
Chris PeBenito 42be7c
corenet_raw_sendrecv_all_nodes(mysqld_t)
Chris PeBenito 42be7c
corenet_tcp_sendrecv_all_ports(mysqld_t)
Chris PeBenito d8636f
corenet_udp_sendrecv_all_ports(mysqld_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(mysqld_t)
Chris PeBenito 42be7c
corenet_tcp_bind_all_nodes(mysqld_t)
Chris PeBenito d8636f
corenet_udp_bind_all_nodes(mysqld_t)
Chris PeBenito 42be7c
corenet_tcp_bind_mysqld_port(mysqld_t)
Chris PeBenito 77f6e2
corenet_tcp_connect_mysqld_port(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
dev_read_sysfs(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
fs_getattr_all_fs(mysqld_t)
Chris PeBenito 42be7c
fs_search_auto_mountpoints(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
term_dontaudit_use_console(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 15722e
domain_use_interactive_fds(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 9e04f5
files_getattr_var_lib_dirs(mysqld_t)
Chris PeBenito 42be7c
files_read_etc_runtime_files(mysqld_t)
Don Miner f8964c
files_read_etc_files(mysqld_t)
Chris PeBenito 42be7c
files_read_usr_files(mysqld_t)
Don Miner f8964c
files_search_var_lib(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 1c1ac6
init_use_fds(mysqld_t)
Chris PeBenito 1815ba
init_use_script_ptys(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
libs_use_ld_so(mysqld_t)
Chris PeBenito 42be7c
libs_use_shared_libs(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
logging_send_syslog_msg(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
miscfiles_read_localization(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
sysnet_read_config(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 15722e
userdom_dontaudit_use_unpriv_user_fds(mysqld_t)
Chris PeBenito 42be7c
# for /root/.my.cnf - should not be needed:
Chris PeBenito 103fe2
userdom_read_sysadm_home_content_files(mysqld_t)
Chris PeBenito 42be7c
Chris PeBenito 42be7c
ifdef(`distro_redhat',`
Chris PeBenito 42be7c
	# because Fedora has the sock_file in the database directory
Chris PeBenito 42be7c
	type_transition mysqld_t mysqld_db_t:sock_file mysqld_var_run_t;
Chris PeBenito 42be7c
')
Chris PeBenito 42be7c
Chris PeBenito 42be7c
ifdef(`targeted_policy',`
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(mysqld_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(mysqld_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(mysqld_t)
Chris PeBenito 42be7c
')
Chris PeBenito 42be7c
Chris PeBenito 44d5d9
optional_policy(`daemontools',`
Chris PeBenito 44d5d9
	daemontools_service_domain(mysqld_t, mysqld_exec_t)
Chris PeBenito 44d5d9
')
Chris PeBenito 44d5d9
Chris PeBenito 132880
optional_policy(`mount',`
Chris PeBenito d8636f
	mount_send_nfs_client_request(mysqld_t)
Chris PeBenito d8636f
')
Chris PeBenito d8636f
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito 42be7c
	nis_use_ypbind(mysqld_t)
Chris PeBenito 42be7c
')
Chris PeBenito 42be7c
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 1815ba
	nscd_socket_use(mysqld_t)
Chris PeBenito 98a8ea
')
Chris PeBenito 98a8ea
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito 42be7c
	seutil_sigchld_newrole(mysqld_t)
Chris PeBenito 42be7c
')
Chris PeBenito 42be7c
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito 42be7c
	udev_read_db(mysqld_t)
Chris PeBenito 42be7c
')