apm.te 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. policy_module(apm, 1.13.2)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. attribute_role apm_roles;
  7. roleattribute system_r apm_roles;
  8. type apmd_t;
  9. type apmd_exec_t;
  10. init_daemon_domain(apmd_t, apmd_exec_t)
  11. type apmd_initrc_exec_t;
  12. init_script_file(apmd_initrc_exec_t)
  13. type apm_t;
  14. type apm_exec_t;
  15. application_domain(apm_t, apm_exec_t)
  16. role apm_roles types apm_t;
  17. type apmd_lock_t;
  18. files_lock_file(apmd_lock_t)
  19. type apmd_log_t;
  20. logging_log_file(apmd_log_t)
  21. type apmd_tmp_t;
  22. files_tmp_file(apmd_tmp_t)
  23. type apmd_var_lib_t;
  24. files_type(apmd_var_lib_t)
  25. type apmd_var_run_t;
  26. files_pid_file(apmd_var_run_t)
  27. type apmd_unit_file_t;
  28. systemd_unit_file(apmd_unit_file_t)
  29. ########################################
  30. #
  31. # Client local policy
  32. #
  33. allow apm_t self:capability { dac_override sys_admin };
  34. kernel_read_system_state(apm_t)
  35. dev_rw_apm_bios(apm_t)
  36. fs_getattr_xattr_fs(apm_t)
  37. term_use_all_terms(apm_t)
  38. domain_use_interactive_fds(apm_t)
  39. logging_send_syslog_msg(apm_t)
  40. ########################################
  41. #
  42. # Server local policy
  43. #
  44. allow apmd_t self:capability { sys_admin sys_nice sys_time kill mknod };
  45. dontaudit apmd_t self:capability { setuid dac_override dac_read_search sys_ptrace sys_tty_config };
  46. allow apmd_t self:process { signal_perms getsession };
  47. allow apmd_t self:fifo_file rw_fifo_file_perms;
  48. allow apmd_t self:netlink_socket create_socket_perms;
  49. allow apmd_t self:unix_stream_socket { accept listen };
  50. allow apmd_t apmd_lock_t:file manage_file_perms;
  51. files_lock_filetrans(apmd_t, apmd_lock_t, file)
  52. allow apmd_t apmd_log_t:file manage_file_perms;
  53. logging_log_filetrans(apmd_t, apmd_log_t, file)
  54. manage_dirs_pattern(apmd_t, apmd_tmp_t, apmd_tmp_t)
  55. manage_files_pattern(apmd_t, apmd_tmp_t, apmd_tmp_t)
  56. files_tmp_filetrans(apmd_t, apmd_tmp_t, { file dir })
  57. manage_dirs_pattern(apmd_t, apmd_var_lib_t, apmd_var_lib_t)
  58. manage_files_pattern(apmd_t, apmd_var_lib_t, apmd_var_lib_t)
  59. files_var_lib_filetrans(apmd_t, apmd_var_lib_t, dir)
  60. manage_files_pattern(apmd_t, apmd_var_run_t, apmd_var_run_t)
  61. manage_sock_files_pattern(apmd_t, apmd_var_run_t, apmd_var_run_t)
  62. files_pid_filetrans(apmd_t, apmd_var_run_t, { file sock_file })
  63. can_exec(apmd_t, apmd_var_run_t)
  64. kernel_read_kernel_sysctls(apmd_t)
  65. kernel_rw_all_sysctls(apmd_t)
  66. kernel_read_system_state(apmd_t)
  67. kernel_write_proc_files(apmd_t)
  68. kernel_request_load_module(apmd_t)
  69. dev_read_input(apmd_t)
  70. dev_read_mouse(apmd_t)
  71. dev_read_realtime_clock(apmd_t)
  72. dev_read_urand(apmd_t)
  73. dev_rw_apm_bios(apmd_t)
  74. dev_rw_sysfs(apmd_t)
  75. dev_dontaudit_getattr_all_chr_files(apmd_t)
  76. dev_dontaudit_getattr_all_blk_files(apmd_t)
  77. files_exec_etc_files(apmd_t)
  78. files_read_etc_runtime_files(apmd_t)
  79. files_read_usr_files(apmd_t)
  80. files_dontaudit_getattr_all_files(apmd_t)
  81. files_dontaudit_getattr_all_symlinks(apmd_t)
  82. files_dontaudit_getattr_all_pipes(apmd_t)
  83. files_dontaudit_getattr_all_sockets(apmd_t)
  84. fs_dontaudit_list_tmpfs(apmd_t)
  85. fs_getattr_all_fs(apmd_t)
  86. fs_search_auto_mountpoints(apmd_t)
  87. fs_dontaudit_getattr_all_files(apmd_t)
  88. fs_dontaudit_getattr_all_symlinks(apmd_t)
  89. fs_dontaudit_getattr_all_pipes(apmd_t)
  90. fs_dontaudit_getattr_all_sockets(apmd_t)
  91. selinux_search_fs(apmd_t)
  92. corecmd_exec_all_executables(apmd_t)
  93. domain_read_all_domains_state(apmd_t)
  94. domain_dontaudit_ptrace_all_domains(apmd_t)
  95. domain_use_interactive_fds(apmd_t)
  96. domain_dontaudit_getattr_all_sockets(apmd_t)
  97. domain_dontaudit_getattr_all_key_sockets(apmd_t)
  98. domain_dontaudit_list_all_domains_state(apmd_t)
  99. auth_use_nsswitch(apmd_t)
  100. init_domtrans_script(apmd_t)
  101. libs_exec_ld_so(apmd_t)
  102. libs_exec_lib_files(apmd_t)
  103. logging_send_audit_msgs(apmd_t)
  104. logging_send_syslog_msg(apmd_t)
  105. miscfiles_read_localization(apmd_t)
  106. miscfiles_read_hwdata(apmd_t)
  107. modutils_domtrans_insmod(apmd_t)
  108. modutils_read_module_config(apmd_t)
  109. seutil_dontaudit_read_config(apmd_t)
  110. init_read_utmp(apmd_t)
  111. userdom_dontaudit_use_unpriv_user_fds(apmd_t)
  112. userdom_dontaudit_search_user_home_dirs(apmd_t)
  113. userdom_dontaudit_search_user_home_content(apmd_t)
  114. optional_policy(`
  115. automount_domtrans(apmd_t)
  116. ')
  117. optional_policy(`
  118. clock_domtrans(apmd_t)
  119. clock_rw_adjtime(apmd_t)
  120. ')
  121. optional_policy(`
  122. cron_system_entry(apmd_t, apmd_exec_t)
  123. cron_anacron_domtrans_system_job(apmd_t)
  124. ')
  125. optional_policy(`
  126. devicekit_manage_pid_files(apmd_t)
  127. devicekit_manage_log_files(apmd_t)
  128. devicekit_relabel_log_files(apmd_t)
  129. ')
  130. optional_policy(`
  131. dbus_system_bus_client(apmd_t)
  132. optional_policy(`
  133. consolekit_dbus_chat(apmd_t)
  134. ')
  135. optional_policy(`
  136. networkmanager_dbus_chat(apmd_t)
  137. ')
  138. ')
  139. optional_policy(`
  140. fstools_domtrans(apmd_t)
  141. ')
  142. optional_policy(`
  143. iptables_domtrans(apmd_t)
  144. ')
  145. optional_policy(`
  146. logrotate_use_fds(apmd_t)
  147. ')
  148. optional_policy(`
  149. mta_send_mail(apmd_t)
  150. ')
  151. optional_policy(`
  152. netutils_domtrans(apmd_t)
  153. ')
  154. optional_policy(`
  155. pcmcia_domtrans_cardmgr(apmd_t)
  156. pcmcia_domtrans_cardctl(apmd_t)
  157. ')
  158. optional_policy(`
  159. seutil_sigchld_newrole(apmd_t)
  160. ')
  161. optional_policy(`
  162. shutdown_domtrans(apmd_t)
  163. ')
  164. optional_policy(`
  165. sysnet_domtrans_ifconfig(apmd_t)
  166. ')
  167. optional_policy(`
  168. udev_read_db(apmd_t)
  169. udev_read_state(apmd_t)
  170. ')
  171. optional_policy(`
  172. vbetool_domtrans(apmd_t)
  173. ')
  174. optional_policy(`
  175. xserver_domtrans(apmd_t)
  176. ')