2
policy_module(mysql,1.0.0)
4
########################################
11
init_daemon_domain(mysqld_t,mysqld_exec_t)
13
type mysqld_var_run_t;
14
files_pid_file(mysqld_var_run_t)
17
files_type(mysqld_db_t)
19
type mysqld_etc_t alias etc_mysqld_t;
20
files_config_file(mysqld_etc_t)
23
logging_log_file(mysqld_log_t)
26
files_tmp_file(mysqld_tmp_t)
28
########################################
33
allow mysqld_t self:capability { dac_override setgid setuid sys_resource net_bind_service };
34
dontaudit mysqld_t self:capability sys_tty_config;
35
allow mysqld_t self:process { setsched getsched setrlimit signal_perms rlimitinh };
36
allow mysqld_t self:fifo_file { read write };
37
allow mysqld_t self:unix_stream_socket create_stream_socket_perms;
38
allow mysqld_t self:tcp_socket create_stream_socket_perms;
39
allow mysqld_t self:udp_socket create_socket_perms;
41
allow mysqld_t mysqld_db_t:dir create_dir_perms;
42
allow mysqld_t mysqld_db_t:file create_file_perms;
43
allow mysqld_t mysqld_db_t:lnk_file create_lnk_perms;
44
files_var_lib_filetrans(mysqld_t,mysqld_db_t,{ dir file })
46
allow mysqld_t mysqld_etc_t:file { getattr read };
47
allow mysqld_t mysqld_etc_t:lnk_file { getattr read };
48
allow mysqld_t mysqld_etc_t:dir list_dir_perms;
50
allow mysqld_t mysqld_log_t:file create_file_perms;
51
logging_log_filetrans(mysqld_t,mysqld_log_t,file)
53
allow mysqld_t mysqld_tmp_t:dir create_dir_perms;
54
allow mysqld_t mysqld_tmp_t:file create_file_perms;
55
files_tmp_filetrans(mysqld_t, mysqld_tmp_t, { file dir })
57
allow mysqld_t mysqld_var_run_t:dir rw_dir_perms;
58
allow mysqld_t mysqld_var_run_t:sock_file create_file_perms;
59
allow mysqld_t mysqld_var_run_t:file create_file_perms;
60
files_pid_filetrans(mysqld_t,mysqld_var_run_t,file)
62
kernel_read_system_state(mysqld_t)
63
kernel_read_kernel_sysctls(mysqld_t)
65
corenet_non_ipsec_sendrecv(mysqld_t)
66
corenet_tcp_sendrecv_all_if(mysqld_t)
67
corenet_udp_sendrecv_all_if(mysqld_t)
68
corenet_tcp_sendrecv_all_nodes(mysqld_t)
69
corenet_udp_sendrecv_all_nodes(mysqld_t)
70
corenet_tcp_sendrecv_all_ports(mysqld_t)
71
corenet_udp_sendrecv_all_ports(mysqld_t)
72
corenet_tcp_bind_all_nodes(mysqld_t)
73
corenet_tcp_bind_mysqld_port(mysqld_t)
74
corenet_tcp_connect_mysqld_port(mysqld_t)
75
corenet_sendrecv_mysqld_client_packets(mysqld_t)
76
corenet_sendrecv_mysqld_server_packets(mysqld_t)
78
dev_read_sysfs(mysqld_t)
80
fs_getattr_all_fs(mysqld_t)
81
fs_search_auto_mountpoints(mysqld_t)
83
term_dontaudit_use_console(mysqld_t)
85
domain_use_interactive_fds(mysqld_t)
87
files_getattr_var_lib_dirs(mysqld_t)
88
files_read_etc_runtime_files(mysqld_t)
89
files_read_etc_files(mysqld_t)
90
files_read_usr_files(mysqld_t)
91
files_search_var_lib(mysqld_t)
93
auth_use_nsswitch(mysqld_t)
95
init_use_fds(mysqld_t)
96
init_use_script_ptys(mysqld_t)
98
libs_use_ld_so(mysqld_t)
99
libs_use_shared_libs(mysqld_t)
101
logging_send_syslog_msg(mysqld_t)
103
miscfiles_read_localization(mysqld_t)
105
sysnet_read_config(mysqld_t)
107
userdom_dontaudit_use_unpriv_user_fds(mysqld_t)
108
# for /root/.my.cnf - should not be needed:
109
userdom_read_sysadm_home_content_files(mysqld_t)
111
ifdef(`distro_redhat',`
112
# because Fedora has the sock_file in the database directory
113
type_transition mysqld_t mysqld_db_t:sock_file mysqld_var_run_t;
116
ifdef(`targeted_policy',`
117
term_dontaudit_use_unallocated_ttys(mysqld_t)
118
term_dontaudit_use_generic_ptys(mysqld_t)
119
files_dontaudit_read_root_files(mysqld_t)
123
daemontools_service_domain(mysqld_t, mysqld_exec_t)
127
seutil_sigchld_newrole(mysqld_t)
131
udev_read_db(mysqld_t)