supervisor.te 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. policy_module(supervisor, 0.1.20)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. attribute_role supervisor_roles;
  7. type supervisor_t;
  8. type supervisord_exec_t;
  9. init_daemon_domain(supervisor_t, supervisord_exec_t)
  10. role supervisor_roles types supervisor_t;
  11. type supervisor_etc_t;
  12. files_config_file(supervisor_etc_t)
  13. type supervisor_initrc_exec_t;
  14. init_script_file(supervisor_initrc_exec_t);
  15. type supervisor_var_log_t;
  16. logging_log_file(supervisor_var_log_t)
  17. type supervisor_var_run_t;
  18. files_pid_file(supervisor_var_run_t)
  19. type supervisor_usr_t;
  20. files_type(supervisor_usr_t)
  21. type supervisor_usr_lib_t;
  22. files_type(supervisor_usr_lib_t)
  23. type supervisor_tmp_t;
  24. files_tmp_file(supervisor_tmp_t)
  25. type supervisorctl_t;
  26. type supervisorctl_exec_t;
  27. init_system_domain(supervisorctl_t,supervisorctl_exec_t)
  28. ########################################
  29. #
  30. # Local policy
  31. #
  32. allow supervisor_t self:capability { sys_tty_config chown };
  33. allow supervisor_t self:fifo_file { ioctl read write getattr };
  34. allow supervisor_t self:process setpgid;
  35. allow supervisor_t self:capability { setuid setgid };
  36. allow supervisor_t self:capability kill;
  37. allow supervisor_t self:unix_stream_socket { accept listen };
  38. corecmd_exec_bin(supervisor_t)
  39. corecmd_exec_shell(supervisor_t)
  40. auth_use_nsswitch(supervisor_t)
  41. miscfiles_read_localization(supervisor_t)
  42. dev_read_urand(supervisor_t)
  43. kernel_read_system_state(supervisor_t)
  44. init_manage_utmp(supervisor_t)
  45. read_files_pattern(supervisor_t,supervisor_etc_t,supervisor_etc_t)
  46. search_dirs_pattern(supervisor_t,supervisor_etc_t,supervisor_etc_t)
  47. allow supervisor_t supervisor_etc_t:dir read;
  48. read_files_pattern(supervisor_t,supervisor_usr_t,supervisor_usr_t)
  49. manage_dirs_pattern(supervisor_t,supervisor_var_log_t,supervisor_var_log_t)
  50. manage_files_pattern(supervisor_t,supervisor_var_log_t,supervisor_var_log_t)
  51. logging_log_filetrans(supervisor_t,supervisor_var_log_t, file)
  52. manage_dirs_pattern(supervisor_t,supervisor_tmp_t,supervisor_tmp_t)
  53. manage_files_pattern(supervisor_t,supervisor_tmp_t,supervisor_tmp_t)
  54. files_tmp_filetrans(supervisor_t,supervisor_tmp_t, file)
  55. manage_files_pattern(supervisor_t,supervisor_var_run_t,supervisor_var_run_t)
  56. manage_sock_files_pattern(supervisor_t,supervisor_var_run_t,supervisor_var_run_t)
  57. files_pid_filetrans(supervisor_t,supervisor_var_run_t, { file sock_file })