ipsec.if 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. ## <summary>TCP/IP encryption</summary>
  2. ########################################
  3. ## <summary>
  4. ## Execute ipsec in the ipsec domain.
  5. ## </summary>
  6. ## <param name="domain">
  7. ## <summary>
  8. ## Domain allowed to transition.
  9. ## </summary>
  10. ## </param>
  11. #
  12. interface(`ipsec_domtrans',`
  13. gen_require(`
  14. type ipsec_t, ipsec_exec_t;
  15. ')
  16. domtrans_pattern($1, ipsec_exec_t, ipsec_t)
  17. ')
  18. ########################################
  19. ## <summary>
  20. ## Connect to IPSEC using a unix domain stream socket.
  21. ## </summary>
  22. ## <param name="domain">
  23. ## <summary>
  24. ## Domain allowed access.
  25. ## </summary>
  26. ## </param>
  27. #
  28. interface(`ipsec_stream_connect',`
  29. gen_require(`
  30. type ipsec_t, ipsec_var_run_t;
  31. ')
  32. files_search_pids($1)
  33. stream_connect_pattern($1, ipsec_var_run_t, ipsec_var_run_t, ipsec_t)
  34. ')
  35. ########################################
  36. ## <summary>
  37. ## Execute ipsec in the ipsec mgmt domain.
  38. ## </summary>
  39. ## <param name="domain">
  40. ## <summary>
  41. ## Domain allowed access.
  42. ## </summary>
  43. ## </param>
  44. #
  45. interface(`ipsec_domtrans_mgmt',`
  46. gen_require(`
  47. type ipsec_mgmt_t, ipsec_mgmt_exec_t;
  48. ')
  49. domtrans_pattern($1, ipsec_mgmt_exec_t, ipsec_mgmt_t)
  50. ')
  51. ########################################
  52. ## <summary>
  53. ## Connect to racoon using a unix domain stream socket.
  54. ## </summary>
  55. ## <param name="domain">
  56. ## <summary>
  57. ## Domain allowed access.
  58. ## </summary>
  59. ## </param>
  60. #
  61. interface(`ipsec_stream_connect_racoon',`
  62. gen_require(`
  63. type racoon_t, ipsec_var_run_t;
  64. ')
  65. files_search_pids($1)
  66. stream_connect_pattern($1, ipsec_var_run_t, ipsec_var_run_t, racoon_t)
  67. ')
  68. ########################################
  69. ## <summary>
  70. ## Get the attributes of an IPSEC key socket.
  71. ## </summary>
  72. ## <param name="domain">
  73. ## <summary>
  74. ## Domain allowed access.
  75. ## </summary>
  76. ## </param>
  77. #
  78. interface(`ipsec_getattr_key_sockets',`
  79. gen_require(`
  80. type ipsec_t;
  81. ')
  82. allow $1 ipsec_t:key_socket getattr;
  83. ')
  84. ########################################
  85. ## <summary>
  86. ## Execute the IPSEC management program in the caller domain.
  87. ## </summary>
  88. ## <param name="domain">
  89. ## <summary>
  90. ## Domain allowed access.
  91. ## </summary>
  92. ## </param>
  93. #
  94. interface(`ipsec_exec_mgmt',`
  95. gen_require(`
  96. type ipsec_exec_t;
  97. ')
  98. can_exec($1, ipsec_exec_t)
  99. ')
  100. ########################################
  101. ## <summary>
  102. ## Send ipsec mgmt a general signal.
  103. ## </summary>
  104. ## <param name="domain">
  105. ## <summary>
  106. ## Domain allowed access.
  107. ## </summary>
  108. ## </param>
  109. #
  110. #
  111. interface(`ipsec_signal_mgmt',`
  112. gen_require(`
  113. type ipsec_mgmt_t;
  114. ')
  115. allow $1 ipsec_mgmt_t:process signal;
  116. ')
  117. ########################################
  118. ## <summary>
  119. ## Send ipsec mgmt a null signal.
  120. ## </summary>
  121. ## <param name="domain">
  122. ## <summary>
  123. ## Domain allowed access.
  124. ## </summary>
  125. ## </param>
  126. #
  127. #
  128. interface(`ipsec_signull_mgmt',`
  129. gen_require(`
  130. type ipsec_mgmt_t;
  131. ')
  132. allow $1 ipsec_mgmt_t:process signull;
  133. ')
  134. ########################################
  135. ## <summary>
  136. ## Send ipsec mgmt a kill signal.
  137. ## </summary>
  138. ## <param name="domain">
  139. ## <summary>
  140. ## Domain allowed access.
  141. ## </summary>
  142. ## </param>
  143. #
  144. #
  145. interface(`ipsec_kill_mgmt',`
  146. gen_require(`
  147. type ipsec_mgmt_t;
  148. ')
  149. allow $1 ipsec_mgmt_t:process sigkill;
  150. ')
  151. ######################################
  152. ## <summary>
  153. ## Send and receive messages from
  154. ## ipsec-mgmt over dbus.
  155. ## </summary>
  156. ## <param name="domain">
  157. ## <summary>
  158. ## Domain allowed access.
  159. ## </summary>
  160. ## </param>
  161. #
  162. interface(`ipsec_mgmt_dbus_chat',`
  163. gen_require(`
  164. type ipsec_mgmt_t;
  165. class dbus send_msg;
  166. ')
  167. allow $1 ipsec_mgmt_t:dbus send_msg;
  168. allow ipsec_mgmt_t $1:dbus send_msg;
  169. ')
  170. ########################################
  171. ## <summary>
  172. ## Read the IPSEC configuration
  173. ## </summary>
  174. ## <param name="domain">
  175. ## <summary>
  176. ## Domain allowed access.
  177. ## </summary>
  178. ## </param>
  179. ## <rolecap/>
  180. #
  181. interface(`ipsec_read_config',`
  182. gen_require(`
  183. type ipsec_conf_file_t;
  184. ')
  185. files_search_etc($1)
  186. allow $1 ipsec_conf_file_t:file read_file_perms;
  187. ')
  188. ########################################
  189. ## <summary>
  190. ## Match the default SPD entry.
  191. ## </summary>
  192. ## <param name="domain">
  193. ## <summary>
  194. ## Domain allowed access.
  195. ## </summary>
  196. ## </param>
  197. #
  198. interface(`ipsec_match_default_spd',`
  199. gen_require(`
  200. type ipsec_spd_t;
  201. ')
  202. allow $1 ipsec_spd_t:association polmatch;
  203. allow $1 self:association sendto;
  204. ')
  205. ########################################
  206. ## <summary>
  207. ## Set the context of a SPD entry to
  208. ## the default context.
  209. ## </summary>
  210. ## <param name="domain">
  211. ## <summary>
  212. ## Domain allowed access.
  213. ## </summary>
  214. ## </param>
  215. #
  216. interface(`ipsec_setcontext_default_spd',`
  217. gen_require(`
  218. type ipsec_spd_t;
  219. ')
  220. allow $1 ipsec_spd_t:association setcontext;
  221. ')
  222. ########################################
  223. ## <summary>
  224. ## write the ipsec_var_run_t files.
  225. ## </summary>
  226. ## <param name="domain">
  227. ## <summary>
  228. ## Domain allowed access.
  229. ## </summary>
  230. ## </param>
  231. #
  232. interface(`ipsec_write_pid',`
  233. gen_require(`
  234. type ipsec_var_run_t;
  235. ')
  236. files_search_pids($1)
  237. write_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t)
  238. ')
  239. ########################################
  240. ## <summary>
  241. ## Create, read, write, and delete the IPSEC pid files.
  242. ## </summary>
  243. ## <param name="domain">
  244. ## <summary>
  245. ## Domain allowed access.
  246. ## </summary>
  247. ## </param>
  248. #
  249. interface(`ipsec_manage_pid',`
  250. gen_require(`
  251. type ipsec_var_run_t;
  252. ')
  253. files_search_pids($1)
  254. manage_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t)
  255. ')
  256. ########################################
  257. ## <summary>
  258. ## Execute racoon in the racoon domain.
  259. ## </summary>
  260. ## <param name="domain">
  261. ## <summary>
  262. ## Domain allowed to transition.
  263. ## </summary>
  264. ## </param>
  265. #
  266. interface(`ipsec_domtrans_racoon',`
  267. gen_require(`
  268. type racoon_t, racoon_exec_t;
  269. ')
  270. domtrans_pattern($1, racoon_exec_t, racoon_t)
  271. ')
  272. ########################################
  273. ## <summary>
  274. ## Execute racoon and allow the specified role the domain.
  275. ## </summary>
  276. ## <param name="domain">
  277. ## <summary>
  278. ## Domain allowed to transition.
  279. ## </summary>
  280. ## </param>
  281. ## <param name="role">
  282. ## <summary>
  283. ## Role allowed access.
  284. ## </summary>
  285. ## </param>
  286. ## <rolecap/>
  287. #
  288. interface(`ipsec_run_racoon',`
  289. gen_require(`
  290. type racoon_t;
  291. ')
  292. ipsec_domtrans_racoon($1)
  293. role $2 types racoon_t;
  294. ')
  295. ########################################
  296. ## <summary>
  297. ## Execute setkey in the setkey domain.
  298. ## </summary>
  299. ## <param name="domain">
  300. ## <summary>
  301. ## Domain allowed to transition.
  302. ## </summary>
  303. ## </param>
  304. #
  305. interface(`ipsec_domtrans_setkey',`
  306. gen_require(`
  307. type setkey_t, setkey_exec_t;
  308. ')
  309. domtrans_pattern($1, setkey_exec_t, setkey_t)
  310. ')
  311. ########################################
  312. ## <summary>
  313. ## Execute setkey and allow the specified role the domains.
  314. ## </summary>
  315. ## <param name="domain">
  316. ## <summary>
  317. ## Domain allowed to transition.
  318. ## </summary>
  319. ## </param>
  320. ## <param name="role">
  321. ## <summary>
  322. ## Role allowed access..
  323. ## </summary>
  324. ## </param>
  325. ## <rolecap/>
  326. #
  327. interface(`ipsec_run_setkey',`
  328. gen_require(`
  329. type setkey_t;
  330. ')
  331. ipsec_domtrans_setkey($1)
  332. role $2 types setkey_t;
  333. ')