turnserver.te 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. policy_module(turnserver, 0.1.12)
  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. type turnserver_unit_t;
  23. init_unit_file(turnserver_unit_t)
  24. ########################################
  25. #
  26. # Local policy
  27. #
  28. allow turnserver_t self:tcp_socket { bind create setopt listen };
  29. allow turnserver_t self:udp_socket { getopt create setopt bind };
  30. allow turnserver_t self:capability { setuid setgid };
  31. allow turnserver_t self:process signal;
  32. allow turnserver_t self:tcp_socket accept;
  33. allow turnserver_t self:rawip_socket { bind create listen setopt };
  34. allow turnserver_t self:sctp_socket create;
  35. manage_dirs_pattern(turnserver_t, turnserver_var_t, turnserver_var_t)
  36. manage_files_pattern(turnserver_t, turnserver_var_t, turnserver_var_t)
  37. type_transition turnserver_t turnserver_var_t:file turnserver_var_t;
  38. read_files_pattern(turnserver_t, turnserver_etc_t, turnserver_etc_t)
  39. manage_files_pattern(turnserver_t, turnserver_var_run_t, turnserver_var_run_t)
  40. files_pid_filetrans(turnserver_t, turnserver_var_run_t, file)
  41. manage_files_pattern(turnserver_t, turnserver_var_log_t, turnserver_var_log_t)
  42. logging_log_filetrans(turnserver_t, turnserver_var_log_t, file)
  43. manage_dirs_pattern(turnserver_t,turnserver_tmp_t,turnserver_tmp_t)
  44. manage_files_pattern(turnserver_t,turnserver_tmp_t,turnserver_tmp_t)
  45. files_tmp_filetrans(turnserver_t,turnserver_tmp_t, file)
  46. dev_read_sysfs(turnserver_t)
  47. corenet_tcp_bind_all_unreserved_ports(turnserver_t)
  48. corenet_udp_bind_all_unreserved_ports(turnserver_t)
  49. corenet_tcp_bind_generic_node(turnserver_t)
  50. corenet_udp_bind_generic_node(turnserver_t)
  51. corenet_raw_bind_generic_node(turnserver_t)
  52. miscfiles_read_localization(turnserver_t)
  53. dev_read_urand(turnserver_t)
  54. auth_use_nsswitch(turnserver_t)
  55. kernel_request_load_module(turnserver_t)
  56. kernel_read_vm_overcommit_sysctl(turnserver_t)
  57. optional_policy(`
  58. gen_require(`
  59. type port_t;
  60. ')
  61. allow turnserver_t port_t:rawip_socket name_bind;
  62. ')