jabber.te 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. policy_module(jabber, 1.11.13)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. attribute jabberd_domain;
  7. jabber_domain_template(jabberd)
  8. jabber_domain_template(jabberd_router)
  9. type jabberd_initrc_exec_t;
  10. init_script_file(jabberd_initrc_exec_t)
  11. type jabberd_lock_t;
  12. files_lock_file(jabberd_lock_t)
  13. type jabberd_log_t;
  14. logging_log_file(jabberd_log_t)
  15. type jabberd_spool_t;
  16. files_type(jabberd_spool_t)
  17. type jabberd_var_cache_t;
  18. files_type(jabberd_var_cache_t)
  19. type jabberd_var_lib_t;
  20. files_type(jabberd_var_lib_t)
  21. type jabberd_var_run_t;
  22. files_pid_file(jabberd_var_run_t)
  23. type jabber_unit_t;
  24. init_unit_file(jabber_unit_t)
  25. ########################################
  26. #
  27. # Common local policy
  28. #
  29. allow jabberd_domain self:process signal_perms;
  30. allow jabberd_domain self:fifo_file rw_fifo_file_perms;
  31. allow jabberd_domain self:tcp_socket { accept listen };
  32. allow jabberd_t self:netlink_route_socket create;
  33. manage_files_pattern(jabberd_domain, jabberd_var_lib_t, jabberd_var_lib_t)
  34. kernel_read_system_state(jabberd_domain)
  35. corenet_all_recvfrom_unlabeled(jabberd_domain)
  36. corenet_all_recvfrom_netlabel(jabberd_domain)
  37. corenet_tcp_sendrecv_generic_if(jabberd_domain)
  38. corenet_tcp_sendrecv_generic_node(jabberd_domain)
  39. corenet_tcp_bind_generic_node(jabberd_domain)
  40. corenet_udp_bind_generic_node(jabberd_domain)
  41. corenet_udp_bind_all_unreserved_ports(jabberd_domain)
  42. dev_read_urand(jabberd_domain)
  43. dev_read_sysfs(jabberd_domain)
  44. fs_getattr_all_fs(jabberd_domain)
  45. logging_send_syslog_msg(jabberd_domain)
  46. miscfiles_read_localization(jabberd_domain)
  47. optional_policy(`
  48. nis_use_ypbind(jabberd_domain)
  49. ')
  50. optional_policy(`
  51. seutil_sigchld_newrole(jabberd_domain)
  52. ')
  53. ########################################
  54. #
  55. # Local policy
  56. #
  57. allow jabberd_t self:capability dac_override;
  58. dontaudit jabberd_t self:capability sys_tty_config;
  59. allow jabberd_t self:tcp_socket create_socket_perms;
  60. allow jabberd_t self:udp_socket create_socket_perms;
  61. allow jabberd_t self:capability { setuid audit_write setgid };
  62. allow jabberd_t self:netlink_audit_socket { write nlmsg_relay create read };
  63. allow jabberd_t self:netlink_selinux_socket { bind create };
  64. allow jabberd_t self:process { setsched getsched };
  65. gen_require(`
  66. class passwd passwd;
  67. ')
  68. allow jabberd_t self:passwd passwd;
  69. manage_files_pattern(jabberd_t, jabberd_lock_t, jabberd_lock_t)
  70. files_lock_filetrans(jabberd_t, jabberd_lock_t, file)
  71. manage_dirs_pattern(jabberd_t, jabberd_log_t, jabberd_log_t)
  72. manage_files_pattern(jabberd_t, jabberd_log_t, jabberd_log_t)
  73. logging_log_filetrans(jabberd_t, jabberd_log_t, { file dir })
  74. manage_dirs_pattern(jabberd_t, jabberd_var_cache_t, jabberd_var_cache_t)
  75. manage_files_pattern(jabberd_t, jabberd_var_cache_t, jabberd_var_cache_t)
  76. type_transition jabberd_t jabberd_var_cache_t:{ file dir } jabberd_var_cache_t;
  77. manage_files_pattern(jabberd_domain, jabberd_spool_t, jabberd_spool_t)
  78. manage_files_pattern(jabberd_t, jabberd_var_run_t, jabberd_var_run_t)
  79. files_pid_filetrans(jabberd_t, jabberd_var_run_t, file)
  80. files_search_var_lib(jabberd_t)
  81. files_read_usr_files(jabberd_t)
  82. files_search_spool(jabberd_t)
  83. kernel_read_kernel_sysctls(jabberd_t)
  84. kernel_read_vm_sysctls(jabberd_t)
  85. kernel_read_vm_overcommit_sysctl(jabberd_t)
  86. corenet_sendrecv_jabber_client_server_packets(jabberd_t)
  87. corenet_tcp_bind_jabber_client_port(jabberd_t)
  88. corenet_tcp_sendrecv_jabber_client_port(jabberd_t)
  89. corenet_sendrecv_jabber_interserver_server_packets(jabberd_t)
  90. corenet_tcp_bind_jabber_interserver_port(jabberd_t)
  91. corenet_tcp_sendrecv_jabber_interserver_port(jabberd_t)
  92. corenet_tcp_bind_epmd_port(jabberd_t)
  93. corenet_tcp_connect_epmd_port(jabberd_t)
  94. corenet_tcp_bind_all_unreserved_ports(jabberd_t)
  95. corenet_tcp_connect_all_unreserved_ports(jabberd_t)
  96. dev_read_rand(jabberd_t)
  97. corenet_tcp_connect_ldap_port(jabberd_t)
  98. domain_use_interactive_fds(jabberd_t)
  99. files_read_etc_files(jabberd_t)
  100. files_read_etc_runtime_files(jabberd_t)
  101. files_manage_generic_tmp_dirs(jabberd_t)
  102. fs_search_auto_mountpoints(jabberd_t)
  103. sysnet_read_config(jabberd_t)
  104. userdom_dontaudit_use_unpriv_user_fds(jabberd_t)
  105. userdom_dontaudit_search_user_home_dirs(jabberd_t)
  106. corecmd_read_bin_symlinks(jabberd_t)
  107. corecmd_exec_bin(jabberd_t)
  108. corecmd_exec_shell(jabberd_t)
  109. init_read_state(jabberd_t)
  110. init_read_utmp(jabberd_t)
  111. su_exec(jabberd_t)
  112. selinux_compute_access_vector(jabberd_t)
  113. auth_read_shadow(jabberd_t)
  114. miscfiles_read_generic_certs(jabberd_t)
  115. auth_domtrans_chk_passwd(jabberd_t)
  116. optional_policy(`
  117. udev_read_db(jabberd_t)
  118. ')
  119. optional_policy(`
  120. gen_require(`
  121. type rabbitmq_epmd_exec_t;
  122. ')
  123. can_exec(jabberd_t, rabbitmq_epmd_exec_t)
  124. ')
  125. optional_policy(`
  126. gen_require(`
  127. type rabbitmq_beam_exec_t;
  128. ')
  129. can_exec(jabberd_t, rabbitmq_beam_exec_t)
  130. ')
  131. ########################################
  132. #
  133. # Router local policy
  134. #
  135. manage_dirs_pattern(jabberd_router_t, jabberd_var_lib_t, jabberd_var_lib_t)
  136. kernel_read_network_state(jabberd_router_t)
  137. corenet_sendrecv_jabber_client_server_packets(jabberd_router_t)
  138. corenet_tcp_bind_jabber_client_port(jabberd_router_t)
  139. corenet_tcp_sendrecv_jabber_client_port(jabberd_router_t)
  140. # corenet_sendrecv_jabber_router_server_packets(jabberd_router_t)
  141. # corenet_tcp_bind_jabber_router_port(jabberd_router_t)
  142. # corenet_sendrecv_jabber_router_client_packets(jabberd_router_t)
  143. # corenet_tcp_connect_jabber_router_port(jabberd_router_t)
  144. # corenet_tcp_sendrecv_jabber_router_port(jabberd_router_t)
  145. auth_use_nsswitch(jabberd_router_t)