|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
a52b4d |
policy_module(mysql,1.3.0)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type mysqld_t;
|
|
Chris PeBenito |
17de1b |
type mysqld_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(mysqld_t,mysqld_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type mysqld_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(mysqld_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type mysqld_db_t;
|
|
Chris PeBenito |
17de1b |
files_type(mysqld_db_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type mysqld_etc_t alias etc_mysqld_t;
|
|
Chris PeBenito |
17de1b |
files_config_file(mysqld_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type mysqld_log_t;
|
|
Chris PeBenito |
17de1b |
logging_log_file(mysqld_log_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type mysqld_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(mysqld_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow mysqld_t self:capability { dac_override setgid setuid sys_resource net_bind_service };
|
|
Chris PeBenito |
17de1b |
dontaudit mysqld_t self:capability sys_tty_config;
|
|
Chris PeBenito |
17de1b |
allow mysqld_t self:process { setsched getsched setrlimit signal_perms rlimitinh };
|
|
Chris PeBenito |
17de1b |
allow mysqld_t self:fifo_file { read write };
|
|
Chris PeBenito |
17de1b |
allow mysqld_t self:unix_stream_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow mysqld_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow mysqld_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_dirs_pattern(mysqld_t,mysqld_db_t,mysqld_db_t)
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(mysqld_t,mysqld_db_t,mysqld_db_t)
|
|
Chris PeBenito |
c0868a |
manage_lnk_files_pattern(mysqld_t,mysqld_db_t,mysqld_db_t)
|
|
Chris PeBenito |
17de1b |
files_var_lib_filetrans(mysqld_t,mysqld_db_t,{ dir file })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow mysqld_t mysqld_etc_t:file { getattr read };
|
|
Chris PeBenito |
17de1b |
allow mysqld_t mysqld_etc_t:lnk_file { getattr read };
|
|
Chris PeBenito |
17de1b |
allow mysqld_t mysqld_etc_t:dir list_dir_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow mysqld_t mysqld_log_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
logging_log_filetrans(mysqld_t,mysqld_log_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_dirs_pattern(mysqld_t,mysqld_tmp_t,mysqld_tmp_t)
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(mysqld_t,mysqld_tmp_t,mysqld_tmp_t)
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(mysqld_t, mysqld_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(mysqld_t,mysqld_var_run_t,mysqld_var_run_t)
|
|
Chris PeBenito |
c0868a |
manage_sock_files_pattern(mysqld_t,mysqld_var_run_t,mysqld_var_run_t)
|
|
Chris PeBenito |
17de1b |
files_pid_filetrans(mysqld_t,mysqld_var_run_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(mysqld_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corenet_non_ipsec_sendrecv(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_if(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_if(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_all_nodes(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_mysqld_port(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_mysqld_port(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_mysqld_client_packets(mysqld_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_mysqld_server_packets(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_all_fs(mysqld_t)
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_console(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_getattr_var_lib_dirs(mysqld_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(mysqld_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(mysqld_t)
|
|
Chris PeBenito |
17de1b |
files_read_usr_files(mysqld_t)
|
|
Chris PeBenito |
17de1b |
files_search_var_lib(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
auth_use_nsswitch(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_fds(mysqld_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(mysqld_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_use_unpriv_user_fds(mysqld_t)
|
|
Chris PeBenito |
17de1b |
# for /root/.my.cnf - should not be needed:
|
|
Chris PeBenito |
17de1b |
userdom_read_sysadm_home_content_files(mysqld_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`distro_redhat',`
|
|
Chris PeBenito |
17de1b |
# because Fedora has the sock_file in the database directory
|
|
Chris PeBenito |
17de1b |
type_transition mysqld_t mysqld_db_t:sock_file mysqld_var_run_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_unallocated_ttys(mysqld_t)
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_generic_ptys(mysqld_t)
|
|
Chris PeBenito |
17de1b |
files_dontaudit_read_root_files(mysqld_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
daemontools_service_domain(mysqld_t, mysqld_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
seutil_sigchld_newrole(mysqld_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
udev_read_db(mysqld_t)
|
|
Chris PeBenito |
17de1b |
')
|