supervisor.te 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. policy_module(supervisor, 0.1.18)
  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;
  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. read_files_pattern(supervisor_t,supervisor_etc_t,supervisor_etc_t)
  45. search_dirs_pattern(supervisor_t,supervisor_etc_t,supervisor_etc_t)
  46. allow supervisor_t supervisor_etc_t:dir read;
  47. read_files_pattern(supervisor_t,supervisor_usr_t,supervisor_usr_t)
  48. manage_dirs_pattern(supervisor_t,supervisor_var_log_t,supervisor_var_log_t)
  49. manage_files_pattern(supervisor_t,supervisor_var_log_t,supervisor_var_log_t)
  50. logging_log_filetrans(supervisor_t,supervisor_var_log_t, file)
  51. manage_dirs_pattern(supervisor_t,supervisor_tmp_t,supervisor_tmp_t)
  52. manage_files_pattern(supervisor_t,supervisor_tmp_t,supervisor_tmp_t)
  53. files_tmp_filetrans(supervisor_t,supervisor_tmp_t, file)
  54. manage_files_pattern(supervisor_t,supervisor_var_run_t,supervisor_var_run_t)
  55. manage_sock_files_pattern(supervisor_t,supervisor_var_run_t,supervisor_var_run_t)
  56. files_pid_filetrans(supervisor_t,supervisor_var_run_t, { file sock_file })