jabber.if 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ## <summary>Jabber instant messaging servers.</summary>
  2. #######################################
  3. ## <summary>
  4. ## The template to define a jabber domain.
  5. ## </summary>
  6. ## <param name="domain_prefix">
  7. ## <summary>
  8. ## Domain prefix to be used.
  9. ## </summary>
  10. ## </param>
  11. #
  12. template(`jabber_domain_template',`
  13. gen_require(`
  14. attribute jabberd_domain;
  15. ')
  16. type $1_t, jabberd_domain;
  17. type $1_exec_t;
  18. init_daemon_domain($1_t, $1_exec_t)
  19. ')
  20. ########################################
  21. ## <summary>
  22. ## Create, read, write, and delete
  23. ## jabber lib files.
  24. ## </summary>
  25. ## <param name="domain">
  26. ## <summary>
  27. ## Domain allowed access.
  28. ## </summary>
  29. ## </param>
  30. #
  31. interface(`jabber_manage_lib_files',`
  32. gen_require(`
  33. type jabberd_var_lib_t;
  34. ')
  35. files_search_var_lib($1)
  36. manage_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t)
  37. ')
  38. ########################################
  39. ## <summary>
  40. ## Connect to jabber over a TCP socket (Deprecated)
  41. ## </summary>
  42. ## <param name="domain">
  43. ## <summary>
  44. ## Domain allowed access.
  45. ## </summary>
  46. ## </param>
  47. #
  48. interface(`jabber_tcp_connect',`
  49. refpolicywarn(`$0($*) has been deprecated.')
  50. ')
  51. ########################################
  52. ## <summary>
  53. ## All of the rules required to
  54. ## administrate an jabber environment.
  55. ## </summary>
  56. ## <param name="domain">
  57. ## <summary>
  58. ## Domain allowed access.
  59. ## </summary>
  60. ## </param>
  61. ## <param name="role">
  62. ## <summary>
  63. ## Role allowed access.
  64. ## </summary>
  65. ## </param>
  66. ## <rolecap/>
  67. #
  68. interface(`jabber_admin',`
  69. gen_require(`
  70. attribute jabberd_domain;
  71. type jabberd_lock_t, jabberd_log_t, jabberd_spool_t;
  72. type jabberd_var_lib_t, jabberd_var_run_t, jabberd_initrc_exec_t;
  73. ')
  74. allow $1 jabberd_domain:process { ptrace signal_perms };
  75. ps_process_pattern($1, jabberd_domain)
  76. init_labeled_script_domtrans($1, jabberd_initrc_exec_t)
  77. domain_system_change_exemption($1)
  78. role_transition $2 jabberd_initrc_exec_t system_r;
  79. allow $2 system_r;
  80. files_search_locks($1)
  81. admin_pattern($1, jabberd_lock_t)
  82. logging_search_logs($1)
  83. admin_pattern($1, jabberd_log_t)
  84. files_search_spool($1)
  85. admin_pattern($1, jabberd_spool_t)
  86. files_search_var_lib($1)
  87. admin_pattern($1, jabberd_var_lib_t)
  88. files_search_pids($1)
  89. admin_pattern($1, jabberd_var_run_t)
  90. ')
  91. ########################################
  92. ## <summary>
  93. ## Execute ejabberd with a domain transition.
  94. ## </summary>
  95. ## <param name="domain">
  96. ## <summary>
  97. ## Domain allowed to transition.
  98. ## </summary>
  99. ## </param>
  100. #
  101. interface(`jabber_domtrans',`
  102. gen_require(`
  103. type jabberd_t, jabberd_exec_t;
  104. ')
  105. corecmd_search_bin($1)
  106. domtrans_pattern($1, jabberd_exec_t, jabberd_t)
  107. ')