turnserver.te 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. policy_module(turnserver, 0.1.9)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. attribute_role turnserver_roles;
  7. type turnserver_t;
  8. type turnserver_exec_t;
  9. init_daemon_domain(turnserver_t, turnserver_exec_t)
  10. type turnserver_etc_t;
  11. files_config_file(turnserver_etc_t)
  12. type turnserver_initrc_exec_t;
  13. init_script_file(turnserver_initrc_exec_t)
  14. type turnserver_var_run_t;
  15. files_pid_file(turnserver_var_run_t)
  16. type turnserver_var_log_t;
  17. logging_log_file(turnserver_var_log_t)
  18. type turnserver_var_t;
  19. files_type(turnserver_var_t)
  20. type turnserver_tmp_t;
  21. files_tmp_file(turnserver_tmp_t)
  22. ########################################
  23. #
  24. # Local policy
  25. #
  26. allow turnserver_t self:tcp_socket { bind create setopt listen };
  27. allow turnserver_t self:udp_socket { getopt create setopt bind };
  28. allow turnserver_t self:capability { setuid setgid };
  29. allow turnserver_t self:process signal;
  30. allow turnserver_t self:tcp_socket accept;
  31. allow turnserver_t self:rawip_socket { bind create listen setopt };
  32. manage_dirs_pattern(turnserver_t, turnserver_var_t, turnserver_var_t)
  33. manage_files_pattern(turnserver_t, turnserver_var_t, turnserver_var_t)
  34. type_transition turnserver_t turnserver_var_t:file turnserver_var_t;
  35. read_files_pattern(turnserver_t, turnserver_etc_t, turnserver_etc_t)
  36. manage_files_pattern(turnserver_t, turnserver_var_run_t, turnserver_var_run_t)
  37. files_pid_filetrans(turnserver_t, turnserver_var_run_t, file)
  38. manage_files_pattern(turnserver_t, turnserver_var_log_t, turnserver_var_log_t)
  39. logging_log_filetrans(turnserver_t, turnserver_var_log_t, file)
  40. manage_dirs_pattern(turnserver_t,turnserver_tmp_t,turnserver_tmp_t)
  41. manage_files_pattern(turnserver_t,turnserver_tmp_t,turnserver_tmp_t)
  42. files_tmp_filetrans(turnserver_t,turnserver_tmp_t, file)
  43. dev_read_sysfs(turnserver_t)
  44. corenet_tcp_bind_all_unreserved_ports(turnserver_t)
  45. corenet_udp_bind_all_unreserved_ports(turnserver_t)
  46. corenet_tcp_bind_generic_node(turnserver_t)
  47. corenet_udp_bind_generic_node(turnserver_t)
  48. corenet_raw_bind_generic_node(turnserver_t)
  49. miscfiles_read_localization(turnserver_t)
  50. dev_read_urand(turnserver_t)
  51. auth_use_nsswitch(turnserver_t)
  52. kernel_request_load_module(turnserver_t)
  53. optional_policy(`
  54. gen_require(`
  55. type port_t;
  56. ')
  57. allow turnserver_t port_t:rawip_socket name_bind;
  58. ')