123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474 |
- ## <summary>Open source database.</summary>
- ########################################
- ## <summary>
- ## Role access for mysql.
- ## </summary>
- ## <param name="role">
- ## <summary>
- ## Role allowed access.
- ## </summary>
- ## </param>
- ## <param name="domain">
- ## <summary>
- ## User domain for the role.
- ## </summary>
- ## </param>
- #
- interface(`mysql_role',`
- refpolicywarn(`$0($*) has been deprecated')
- ')
- ######################################
- ## <summary>
- ## Execute MySQL in the mysql domain.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed to transition.
- ## </summary>
- ## </param>
- #
- interface(`mysql_domtrans',`
- gen_require(`
- type mysqld_t, mysqld_exec_t;
- ')
- corecmd_search_bin($1)
- domtrans_pattern($1, mysqld_exec_t, mysqld_t)
- ')
- ########################################
- ## <summary>
- ## Execute mysqld in the mysqld domain, and
- ## allow the specified role the mysqld domain.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed to transition.
- ## </summary>
- ## </param>
- ## <param name="role">
- ## <summary>
- ## Role allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_run_mysqld',`
- gen_require(`
- attribute_role mysqld_roles;
- ')
- mysql_domtrans($1)
- roleattribute $2 mysqld_roles;
- ')
- ########################################
- ## <summary>
- ## Send generic signals to mysqld.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_signal',`
- gen_require(`
- type mysqld_t;
- ')
- allow $1 mysqld_t:process signal;
- ')
- ########################################
- ## <summary>
- ## Connect to mysqld with a tcp socket.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_tcp_connect',`
- gen_require(`
- type mysqld_t;
- ')
- corenet_tcp_recvfrom_labeled($1, mysqld_t)
- corenet_tcp_sendrecv_mysqld_port($1)
- corenet_tcp_connect_mysqld_port($1)
- corenet_sendrecv_mysqld_client_packets($1)
- ')
- ########################################
- ## <summary>
- ## Connect to mysqld with a unix
- # domain stream socket.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- ## <rolecap/>
- #
- interface(`mysql_stream_connect',`
- gen_require(`
- type mysqld_t, mysqld_var_run_t, mysqld_db_t;
- ')
- files_search_pids($1)
- stream_connect_pattern($1, { mysqld_db_t mysqld_var_run_t }, mysqld_var_run_t, mysqld_t)
- ')
- ########################################
- ## <summary>
- ## Read mysqld configuration content.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- ## <rolecap/>
- #
- interface(`mysql_read_config',`
- gen_require(`
- type mysqld_etc_t;
- ')
- files_search_etc($1)
- allow $1 mysqld_etc_t:dir list_dir_perms;
- allow $1 mysqld_etc_t:file read_file_perms;
- allow $1 mysqld_etc_t:lnk_file read_lnk_file_perms;
- ')
- ########################################
- ## <summary>
- ## Search mysqld db directories.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_search_db',`
- gen_require(`
- type mysqld_db_t;
- ')
- files_search_var_lib($1)
- allow $1 mysqld_db_t:dir search_dir_perms;
- ')
- ########################################
- ## <summary>
- ## Read and write mysqld database directories.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_rw_db_dirs',`
- gen_require(`
- type mysqld_db_t;
- ')
- files_search_var_lib($1)
- allow $1 mysqld_db_t:dir rw_dir_perms;
- ')
- ########################################
- ## <summary>
- ## Create, read, write, and delete
- ## mysqld database directories.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_manage_db_dirs',`
- gen_require(`
- type mysqld_db_t;
- ')
- files_search_var_lib($1)
- allow $1 mysqld_db_t:dir manage_dir_perms;
- ')
- #######################################
- ## <summary>
- ## Append mysqld database files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_append_db_files',`
- gen_require(`
- type mysqld_db_t;
- ')
- files_search_var_lib($1)
- append_files_pattern($1, mysqld_db_t, mysqld_db_t)
- ')
- #######################################
- ## <summary>
- ## Read and write mysqld database files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_rw_db_files',`
- gen_require(`
- type mysqld_db_t;
- ')
- files_search_var_lib($1)
- rw_files_pattern($1, mysqld_db_t, mysqld_db_t)
- ')
- #######################################
- ## <summary>
- ## Create, read, write, and delete
- ## mysqld database files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_manage_db_files',`
- gen_require(`
- type mysqld_db_t;
- ')
- files_search_var_lib($1)
- manage_files_pattern($1, mysqld_db_t, mysqld_db_t)
- ')
- ########################################
- ## <summary>
- ## Read and write mysqld database sockets.
- ## named socket.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_rw_db_sockets',`
- refpolicywarn(`$0($*) has been deprecated.')
- ')
- ########################################
- ## <summary>
- ## Create, read, write, and delete
- ## mysqld home files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_manage_mysqld_home_files',`
- gen_require(`
- type mysqld_home_t;
- ')
- userdom_search_user_home_dirs($1)
- allow $1 mysqld_home_t:file manage_file_perms;
- ')
- ########################################
- ## <summary>
- ## Relabel mysqld home files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_relabel_mysqld_home_files',`
- gen_require(`
- type mysqld_home_t;
- ')
- userdom_search_user_home_dirs($1)
- allow $1 mysqld_home_t:file relabel_file_perms;
- ')
- ########################################
- ## <summary>
- ## Create objects in user home
- ## directories with the mysqld home type.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- ## <param name="object_class">
- ## <summary>
- ## Class of the object being created.
- ## </summary>
- ## </param>
- ## <param name="name" optional="true">
- ## <summary>
- ## The name of the object being created.
- ## </summary>
- ## </param>
- #
- interface(`mysql_home_filetrans_mysqld_home',`
- gen_require(`
- type mysqld_home_t;
- ')
- userdom_user_home_dir_filetrans($1, mysqld_home_t, $2, $3)
- ')
- ########################################
- ## <summary>
- ## Write mysqld log files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_write_log',`
- gen_require(`
- type mysqld_log_t;
- ')
- logging_search_logs($1)
- allow $1 mysqld_log_t:file write_file_perms;
- ')
- ######################################
- ## <summary>
- ## Execute mysqld safe in the
- ## mysqld safe domain.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed to transition.
- ## </summary>
- ## </param>
- #
- interface(`mysql_domtrans_mysql_safe',`
- gen_require(`
- type mysqld_safe_t, mysqld_safe_exec_t;
- ')
- corecmd_search_bin($1)
- domtrans_pattern($1, mysqld_safe_exec_t, mysqld_safe_t)
- ')
- #####################################
- ## <summary>
- ## Read mysqld pid files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- #
- interface(`mysql_read_pid_files',`
- gen_require(`
- type mysqld_var_run_t;
- ')
- files_search_pids($1)
- read_files_pattern($1, mysqld_var_run_t, mysqld_var_run_t)
- ')
- #####################################
- ## <summary>
- ## Search mysqld pid files.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- ##
- #
- interface(`mysql_search_pid_files',`
- gen_require(`
- type mysqld_var_run_t;
- ')
- files_search_pids($1)
- search_dirs_pattern($1, mysqld_var_run_t, mysqld_var_run_t)
- ')
- ########################################
- ## <summary>
- ## All of the rules required to
- ## administrate an mysqld environment.
- ## </summary>
- ## <param name="domain">
- ## <summary>
- ## Domain allowed access.
- ## </summary>
- ## </param>
- ## <param name="role">
- ## <summary>
- ## Role allowed access.
- ## </summary>
- ## </param>
- ## <rolecap/>
- #
- interface(`mysql_admin',`
- gen_require(`
- type mysqld_t, mysqld_var_run_t, mysqld_etc_t;
- type mysqld_tmp_t, mysqld_db_t, mysqld_log_t;
- type mysqld_safe_t, mysqlmanagerd_t, mysqlmanagerd_var_run_t;
- type mysqld_initrc_exec_t, mysqlmanagerd_initrc_exec_t, mysqld_home_t;
- ')
- allow $1 { mysqld_safe_t mysqld_t mysqlmanagerd_t }:process { ptrace signal_perms };
- ps_process_pattern($1, { mysqld_safe_t mysqld_t mysqlmanagerd_t })
- init_labeled_script_domtrans($1, { mysqlmanagerd_initrc_exec_t mysqld_initrc_exec_t })
- domain_system_change_exemption($1)
- role_transition $2 { mysqlmanagerd_initrc_exec_t mysqld_initrc_exec_t } system_r;
- allow $2 system_r;
- files_search_pids($1)
- admin_pattern($1, { mysqlmanagerd_var_run_t mysqld_var_run_t })
- files_search_var_lib($1)
- admin_pattern($1, mysqld_db_t)
- files_search_etc($1)
- admin_pattern($1, { mysqld_etc_t mysqld_home_t })
- logging_search_logs($1)
- admin_pattern($1, mysqld_log_t)
- files_search_tmp($1)
- admin_pattern($1, mysqld_tmp_t)
- mysql_run_mysqld($1, $2)
- ')
|