ipsec.te 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. policy_module(ipsec, 1.14.25)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. ## <desc>
  7. ## <p>
  8. ## Allow racoon to read shadow
  9. ## </p>
  10. ## </desc>
  11. gen_tunable(racoon_read_shadow, false)
  12. type ipsec_t;
  13. type ipsec_exec_t;
  14. init_daemon_domain(ipsec_t, ipsec_exec_t)
  15. role system_r types ipsec_t;
  16. # type for ipsec configuration file(s) - not for keys
  17. type ipsec_conf_file_t;
  18. files_type(ipsec_conf_file_t)
  19. type ipsec_initrc_exec_t;
  20. init_script_file(ipsec_initrc_exec_t)
  21. # type for file(s) containing ipsec keys - RSA or preshared
  22. type ipsec_key_file_t;
  23. files_type(ipsec_key_file_t)
  24. type ipsec_log_t;
  25. logging_log_file(ipsec_log_t)
  26. # Default type for IPSEC SPD entries
  27. type ipsec_spd_t;
  28. corenet_spd_type(ipsec_spd_t)
  29. type ipsec_tmp_t;
  30. files_tmp_file(ipsec_tmp_t)
  31. # type for runtime files, including pluto.ctl
  32. type ipsec_var_run_t;
  33. files_pid_file(ipsec_var_run_t)
  34. type ipsec_mgmt_t;
  35. type ipsec_mgmt_exec_t;
  36. init_system_domain(ipsec_mgmt_t, ipsec_mgmt_exec_t)
  37. corecmd_shell_entry_type(ipsec_mgmt_t)
  38. role system_r types ipsec_mgmt_t;
  39. type ipsec_mgmt_lock_t;
  40. files_lock_file(ipsec_mgmt_lock_t)
  41. type ipsec_mgmt_var_run_t;
  42. files_pid_file(ipsec_mgmt_var_run_t)
  43. type ipsec_var_lib_t;
  44. files_type(ipsec_var_lib_t)
  45. type racoon_t;
  46. type racoon_exec_t;
  47. init_daemon_domain(racoon_t, racoon_exec_t)
  48. role system_r types racoon_t;
  49. type racoon_tmp_t;
  50. files_tmp_file(racoon_tmp_t)
  51. type charon_t;
  52. type charon_exec_t;
  53. init_daemon_domain(charon_t, charon_exec_t)
  54. type_transition ipsec_t charon_exec_t: process charon_t;
  55. role system_r types charon_t;
  56. type setkey_t;
  57. type setkey_exec_t;
  58. init_system_domain(setkey_t, setkey_exec_t)
  59. role system_r types setkey_t;
  60. ########################################
  61. #
  62. # ipsec Local policy
  63. #
  64. allow ipsec_t self:capability { net_admin dac_override dac_read_search setpcap sys_nice };
  65. dontaudit ipsec_t self:capability { sys_ptrace sys_tty_config };
  66. allow ipsec_t self:process { getcap setcap getsched signal setsched };
  67. allow ipsec_t self:tcp_socket create_stream_socket_perms;
  68. allow ipsec_t self:udp_socket create_socket_perms;
  69. allow ipsec_t self:key_socket create_socket_perms;
  70. allow ipsec_t self:fifo_file read_fifo_file_perms;
  71. allow ipsec_t self:netlink_xfrm_socket { create_netlink_socket_perms nlmsg_write };
  72. allow ipsec_t self:netlink_route_socket nlmsg_write;
  73. allow ipsec_t charon_t:process { siginh rlimitinh transition noatsecure sigkill };
  74. allow ipsec_t charon_t:unix_stream_socket connectto;
  75. allow ipsec_t charon_t:process signal;
  76. allow ipsec_t ipsec_initrc_exec_t:file read_file_perms;
  77. allow ipsec_t ipsec_conf_file_t:dir list_dir_perms;
  78. read_files_pattern(ipsec_t, ipsec_conf_file_t, ipsec_conf_file_t)
  79. read_lnk_files_pattern(ipsec_t, ipsec_conf_file_t, ipsec_conf_file_t)
  80. read_files_pattern(ipsec_t, ipsec_var_lib_t, ipsec_var_lib_t)
  81. allow charon_t ipsec_var_lib_t:dir search;
  82. allow ipsec_t ipsec_key_file_t:dir list_dir_perms;
  83. manage_files_pattern(ipsec_t, ipsec_key_file_t, ipsec_key_file_t)
  84. read_lnk_files_pattern(ipsec_t, ipsec_key_file_t, ipsec_key_file_t)
  85. manage_dirs_pattern(ipsec_t, ipsec_tmp_t, ipsec_tmp_t)
  86. manage_files_pattern(ipsec_t, ipsec_tmp_t, ipsec_tmp_t)
  87. files_tmp_filetrans(ipsec_t, ipsec_tmp_t, { dir file })
  88. manage_dirs_pattern(ipsec_t, ipsec_var_run_t, ipsec_var_run_t)
  89. manage_files_pattern(ipsec_t, ipsec_var_run_t, ipsec_var_run_t)
  90. manage_sock_files_pattern(ipsec_t, ipsec_var_run_t, ipsec_var_run_t)
  91. files_pid_filetrans(ipsec_t, ipsec_var_run_t, { dir file sock_file })
  92. kernel_rw_net_sysctls(ipsec_t)
  93. can_exec(ipsec_t, ipsec_mgmt_exec_t)
  94. can_exec(ipsec_t, charon_exec_t)
  95. allow ipsec_t self:fifo_file write;
  96. # pluto runs an updown script (by calling popen()!) as this is by default
  97. # a shell script, we need to find a way to make things work without
  98. # letting all sorts of stuff possibly be run...
  99. # so try flipping back into the ipsec_mgmt_t domain
  100. corecmd_shell_domtrans(ipsec_t, ipsec_mgmt_t)
  101. allow ipsec_mgmt_t ipsec_t:fd use;
  102. allow ipsec_mgmt_t ipsec_t:fifo_file rw_fifo_file_perms;
  103. allow ipsec_mgmt_t ipsec_t:unix_stream_socket { read write };
  104. allow ipsec_mgmt_t ipsec_t:process { rlimitinh sigchld };
  105. kernel_read_kernel_sysctls(ipsec_t)
  106. kernel_read_net_sysctls(ipsec_t)
  107. kernel_list_proc(ipsec_t)
  108. kernel_read_proc_symlinks(ipsec_t)
  109. # allow pluto to access /proc/net/ipsec_eroute;
  110. kernel_read_system_state(ipsec_t)
  111. kernel_read_network_state(ipsec_t)
  112. kernel_read_software_raid_state(ipsec_t)
  113. kernel_request_load_module(ipsec_t)
  114. kernel_getattr_core_if(ipsec_t)
  115. kernel_getattr_message_if(ipsec_t)
  116. corecmd_exec_shell(ipsec_t)
  117. corecmd_exec_bin(ipsec_t)
  118. # Pluto needs network access
  119. corenet_all_recvfrom_unlabeled(ipsec_t)
  120. corenet_tcp_sendrecv_all_if(ipsec_t)
  121. corenet_raw_sendrecv_all_if(ipsec_t)
  122. corenet_tcp_sendrecv_all_nodes(ipsec_t)
  123. corenet_raw_sendrecv_all_nodes(ipsec_t)
  124. corenet_tcp_sendrecv_all_ports(ipsec_t)
  125. corenet_tcp_bind_all_nodes(ipsec_t)
  126. corenet_udp_bind_all_nodes(ipsec_t)
  127. corenet_tcp_bind_reserved_port(ipsec_t)
  128. corenet_tcp_bind_isakmp_port(ipsec_t)
  129. corenet_udp_bind_isakmp_port(ipsec_t)
  130. corenet_udp_bind_ipsecnat_port(ipsec_t)
  131. corenet_sendrecv_generic_server_packets(ipsec_t)
  132. corenet_sendrecv_isakmp_server_packets(ipsec_t)
  133. dev_read_sysfs(ipsec_t)
  134. dev_read_rand(ipsec_t)
  135. dev_read_urand(ipsec_t)
  136. domain_use_interactive_fds(ipsec_t)
  137. files_list_tmp(ipsec_t)
  138. files_read_etc_files(ipsec_t)
  139. files_read_usr_files(ipsec_t)
  140. files_dontaudit_search_home(ipsec_t)
  141. fs_getattr_all_fs(ipsec_t)
  142. fs_search_auto_mountpoints(ipsec_t)
  143. term_use_console(ipsec_t)
  144. term_dontaudit_use_all_ttys(ipsec_t)
  145. auth_use_nsswitch(ipsec_t)
  146. init_use_fds(ipsec_t)
  147. init_use_script_ptys(ipsec_t)
  148. logging_send_syslog_msg(ipsec_t)
  149. miscfiles_read_localization(ipsec_t)
  150. sysnet_domtrans_ifconfig(ipsec_t)
  151. userdom_dontaudit_use_unpriv_user_fds(ipsec_t)
  152. userdom_dontaudit_search_user_home_dirs(ipsec_t)
  153. optional_policy(`
  154. seutil_sigchld_newrole(ipsec_t)
  155. ')
  156. optional_policy(`
  157. udev_read_db(ipsec_t)
  158. ')
  159. ########################################
  160. #
  161. # ipsec_mgmt Local policy
  162. #
  163. allow ipsec_mgmt_t self:capability { dac_override dac_read_search net_admin setpcap sys_nice };
  164. dontaudit ipsec_mgmt_t self:capability { sys_ptrace sys_tty_config };
  165. allow ipsec_mgmt_t self:process { getsched ptrace setrlimit setsched signal };
  166. allow ipsec_mgmt_t self:unix_stream_socket create_stream_socket_perms;
  167. allow ipsec_mgmt_t self:tcp_socket create_stream_socket_perms;
  168. allow ipsec_mgmt_t self:udp_socket create_socket_perms;
  169. allow ipsec_mgmt_t self:key_socket create_socket_perms;
  170. allow ipsec_mgmt_t self:fifo_file rw_fifo_file_perms;
  171. allow ipsec_mgmt_t ipsec_t:process signal;
  172. allow ipsec_mgmt_t ipsec_mgmt_lock_t:file manage_file_perms;
  173. files_lock_filetrans(ipsec_mgmt_t, ipsec_mgmt_lock_t, file)
  174. manage_dirs_pattern(ipsec_mgmt_t, ipsec_tmp_t, ipsec_tmp_t)
  175. manage_files_pattern(ipsec_mgmt_t, ipsec_tmp_t, ipsec_tmp_t)
  176. files_tmp_filetrans(ipsec_mgmt_t, ipsec_tmp_t, { dir file })
  177. manage_files_pattern(ipsec_mgmt_t, ipsec_log_t, ipsec_log_t)
  178. logging_log_filetrans(ipsec_mgmt_t, ipsec_log_t, file)
  179. allow ipsec_mgmt_t ipsec_mgmt_var_run_t:file manage_file_perms;
  180. files_pid_filetrans(ipsec_mgmt_t, ipsec_mgmt_var_run_t, file)
  181. manage_files_pattern(ipsec_mgmt_t, ipsec_var_run_t, ipsec_var_run_t)
  182. manage_lnk_files_pattern(ipsec_mgmt_t, ipsec_var_run_t, ipsec_var_run_t)
  183. allow ipsec_mgmt_t ipsec_var_run_t:sock_file manage_sock_file_perms;
  184. files_pid_filetrans(ipsec_mgmt_t, ipsec_var_run_t, sock_file)
  185. allow ipsec_mgmt_t ipsec_t:process signull;
  186. # _realsetup needs to be able to cat /var/run/pluto.pid,
  187. # run ps on that pid, and delete the file
  188. read_files_pattern(ipsec_mgmt_t, ipsec_t, ipsec_t)
  189. read_lnk_files_pattern(ipsec_mgmt_t, ipsec_t, ipsec_t)
  190. # logger, running in ipsec_mgmt_t needs to use sockets
  191. allow ipsec_mgmt_t self:unix_dgram_socket { create connect write };
  192. allow ipsec_mgmt_t ipsec_t:unix_dgram_socket { create connect write };
  193. allow ipsec_mgmt_t ipsec_conf_file_t:file read_file_perms;
  194. manage_files_pattern(ipsec_mgmt_t, ipsec_key_file_t, ipsec_key_file_t)
  195. manage_lnk_files_pattern(ipsec_mgmt_t, ipsec_key_file_t, ipsec_key_file_t)
  196. # whack needs to connect to pluto
  197. stream_connect_pattern(ipsec_mgmt_t, ipsec_var_run_t, ipsec_var_run_t, ipsec_t)
  198. can_exec(ipsec_mgmt_t, ipsec_mgmt_exec_t)
  199. allow ipsec_mgmt_t ipsec_mgmt_exec_t:lnk_file read;
  200. domtrans_pattern(ipsec_mgmt_t, ipsec_exec_t, ipsec_t)
  201. kernel_rw_net_sysctls(ipsec_mgmt_t)
  202. # allow pluto to access /proc/net/ipsec_eroute;
  203. kernel_read_system_state(ipsec_mgmt_t)
  204. kernel_read_network_state(ipsec_mgmt_t)
  205. kernel_read_software_raid_state(ipsec_mgmt_t)
  206. kernel_read_kernel_sysctls(ipsec_mgmt_t)
  207. kernel_getattr_core_if(ipsec_mgmt_t)
  208. kernel_getattr_message_if(ipsec_mgmt_t)
  209. files_read_kernel_symbol_table(ipsec_mgmt_t)
  210. files_getattr_kernel_modules(ipsec_mgmt_t)
  211. # the default updown script wants to run route
  212. # the ipsec wrapper wants to run /usr/bin/logger (should we put
  213. # it in its own domain?)
  214. corecmd_exec_bin(ipsec_mgmt_t)
  215. corecmd_exec_shell(ipsec_mgmt_t)
  216. dev_read_rand(ipsec_mgmt_t)
  217. dev_read_urand(ipsec_mgmt_t)
  218. domain_use_interactive_fds(ipsec_mgmt_t)
  219. # denials when ps tries to search /proc. Do not audit these denials.
  220. domain_dontaudit_read_all_domains_state(ipsec_mgmt_t)
  221. # suppress audit messages about unnecessary socket access
  222. # cjp: this seems excessive
  223. domain_dontaudit_rw_all_udp_sockets(ipsec_mgmt_t)
  224. domain_dontaudit_rw_all_key_sockets(ipsec_mgmt_t)
  225. files_read_etc_files(ipsec_mgmt_t)
  226. files_exec_etc_files(ipsec_mgmt_t)
  227. files_read_etc_runtime_files(ipsec_mgmt_t)
  228. files_read_usr_files(ipsec_mgmt_t)
  229. files_dontaudit_getattr_default_dirs(ipsec_mgmt_t)
  230. files_dontaudit_getattr_default_files(ipsec_mgmt_t)
  231. files_list_tmp(ipsec_mgmt_t)
  232. fs_getattr_xattr_fs(ipsec_mgmt_t)
  233. fs_list_tmpfs(ipsec_mgmt_t)
  234. term_use_console(ipsec_mgmt_t)
  235. term_dontaudit_getattr_unallocated_ttys(ipsec_mgmt_t)
  236. auth_dontaudit_read_login_records(ipsec_mgmt_t)
  237. init_read_utmp(ipsec_mgmt_t)
  238. init_use_script_ptys(ipsec_mgmt_t)
  239. init_exec_script_files(ipsec_mgmt_t)
  240. init_use_fds(ipsec_mgmt_t)
  241. init_labeled_script_domtrans(ipsec_mgmt_t, ipsec_initrc_exec_t)
  242. logging_send_syslog_msg(ipsec_mgmt_t)
  243. miscfiles_read_localization(ipsec_mgmt_t)
  244. seutil_dontaudit_search_config(ipsec_mgmt_t)
  245. sysnet_manage_config(ipsec_mgmt_t)
  246. sysnet_domtrans_ifconfig(ipsec_mgmt_t)
  247. sysnet_etc_filetrans_config(ipsec_mgmt_t)
  248. userdom_use_user_terminals(ipsec_mgmt_t)
  249. optional_policy(`
  250. consoletype_exec(ipsec_mgmt_t)
  251. ')
  252. optional_policy(`
  253. hostname_exec(ipsec_mgmt_t)
  254. ')
  255. optional_policy(`
  256. dbus_system_bus_client(ipsec_mgmt_t)
  257. dbus_connect_system_bus(ipsec_mgmt_t)
  258. optional_policy(`
  259. networkmanager_dbus_chat(ipsec_mgmt_t)
  260. ')
  261. ')
  262. optional_policy(`
  263. iptables_domtrans(ipsec_mgmt_t)
  264. ')
  265. optional_policy(`
  266. modutils_domtrans_insmod(ipsec_mgmt_t)
  267. ')
  268. optional_policy(`
  269. nscd_use(ipsec_mgmt_t)
  270. ')
  271. ########################################
  272. #
  273. # Racoon local policy
  274. #
  275. allow racoon_t self:capability { net_admin net_bind_service };
  276. allow racoon_t self:netlink_route_socket create_netlink_socket_perms;
  277. allow racoon_t self:unix_dgram_socket { connect create ioctl write };
  278. allow racoon_t self:netlink_selinux_socket { bind create read };
  279. allow racoon_t self:udp_socket create_socket_perms;
  280. allow racoon_t self:key_socket create_socket_perms;
  281. allow racoon_t self:fifo_file rw_fifo_file_perms;
  282. manage_dirs_pattern(racoon_t, racoon_tmp_t, racoon_tmp_t)
  283. manage_files_pattern(racoon_t, racoon_tmp_t, racoon_tmp_t)
  284. files_tmp_filetrans(racoon_t, racoon_tmp_t, { dir file })
  285. can_exec(racoon_t, racoon_exec_t)
  286. can_exec(racoon_t, setkey_exec_t)
  287. # manage pid file
  288. manage_files_pattern(racoon_t, ipsec_var_run_t, ipsec_var_run_t)
  289. manage_sock_files_pattern(racoon_t, ipsec_var_run_t, ipsec_var_run_t)
  290. files_pid_filetrans(racoon_t, ipsec_var_run_t, file)
  291. allow racoon_t ipsec_conf_file_t:dir list_dir_perms;
  292. read_files_pattern(racoon_t, ipsec_conf_file_t, ipsec_conf_file_t)
  293. read_lnk_files_pattern(racoon_t, ipsec_conf_file_t, ipsec_conf_file_t)
  294. allow racoon_t ipsec_key_file_t:dir list_dir_perms;
  295. read_files_pattern(racoon_t, ipsec_key_file_t, ipsec_key_file_t)
  296. read_lnk_files_pattern(racoon_t, ipsec_key_file_t, ipsec_key_file_t)
  297. kernel_read_system_state(racoon_t)
  298. kernel_read_network_state(racoon_t)
  299. kernel_request_load_module(racoon_t)
  300. corecmd_exec_shell(racoon_t)
  301. corecmd_exec_bin(racoon_t)
  302. corenet_all_recvfrom_unlabeled(racoon_t)
  303. corenet_tcp_sendrecv_all_if(racoon_t)
  304. corenet_udp_sendrecv_all_if(racoon_t)
  305. corenet_tcp_sendrecv_all_nodes(racoon_t)
  306. corenet_udp_sendrecv_all_nodes(racoon_t)
  307. corenet_tcp_bind_all_nodes(racoon_t)
  308. corenet_udp_bind_all_nodes(racoon_t)
  309. corenet_udp_bind_isakmp_port(racoon_t)
  310. corenet_udp_bind_ipsecnat_port(racoon_t)
  311. dev_read_urand(racoon_t)
  312. # allow racoon to set contexts on ipsec policy and SAs
  313. domain_ipsec_setcontext_all_domains(racoon_t)
  314. files_read_etc_files(racoon_t)
  315. fs_dontaudit_getattr_xattr_fs(racoon_t)
  316. # allow racoon to use avc_has_perm to check context on proposed SA
  317. selinux_compute_access_vector(racoon_t)
  318. auth_use_nsswitch(racoon_t)
  319. ipsec_setcontext_default_spd(racoon_t)
  320. locallogin_use_fds(racoon_t)
  321. logging_send_syslog_msg(racoon_t)
  322. logging_send_audit_msgs(racoon_t)
  323. miscfiles_read_localization(racoon_t)
  324. sysnet_exec_ifconfig(racoon_t)
  325. auth_can_read_shadow_passwords(racoon_t)
  326. tunable_policy(`racoon_read_shadow',`
  327. auth_tunable_read_shadow(racoon_t)
  328. ')
  329. ########################################
  330. #
  331. # Charon local policy
  332. #
  333. allow charon_t self:capability { net_admin net_bind_service };
  334. allow charon_t self:netlink_route_socket create_netlink_socket_perms;
  335. allow charon_t self:unix_dgram_socket { connect create ioctl write };
  336. allow charon_t self:netlink_selinux_socket { bind create read };
  337. allow charon_t self:udp_socket create_socket_perms;
  338. allow charon_t self:key_socket create_socket_perms;
  339. allow charon_t self:fifo_file rw_fifo_file_perms;
  340. allow charon_t charon_exec_t:file entrypoint;
  341. allow charon_t ipsec_t:fd use;
  342. allow charon_t self:netlink_xfrm_socket { write bind create read nlmsg_write };
  343. allow charon_t self:process { fork getcap setcap };
  344. allow charon_t self:unix_stream_socket { accept listen };
  345. allow charon_t self:netlink_xfrm_socket nlmsg_read;
  346. allow charon_t self:process signal;
  347. allow charon_t self:socket { bind create setopt write read accept };
  348. can_exec(charon_t, charon_exec_t)
  349. can_exec(charon_t, setkey_exec_t)
  350. # manage pid file
  351. manage_dirs_pattern(charon_t, ipsec_var_run_t, ipsec_var_run_t)
  352. manage_files_pattern(charon_t, ipsec_var_run_t, ipsec_var_run_t)
  353. manage_sock_files_pattern(charon_t, ipsec_var_run_t, ipsec_var_run_t)
  354. files_pid_filetrans(charon_t, ipsec_var_run_t, { dir file sock_file })
  355. allow charon_t ipsec_conf_file_t:dir list_dir_perms;
  356. read_files_pattern(charon_t, ipsec_conf_file_t, ipsec_conf_file_t)
  357. read_lnk_files_pattern(charon_t, ipsec_conf_file_t, ipsec_conf_file_t)
  358. allow charon_t ipsec_key_file_t:dir list_dir_perms;
  359. read_files_pattern(charon_t, ipsec_key_file_t, ipsec_key_file_t)
  360. read_lnk_files_pattern(charon_t, ipsec_key_file_t, ipsec_key_file_t)
  361. kernel_read_system_state(charon_t)
  362. kernel_read_network_state(charon_t)
  363. kernel_request_load_module(charon_t)
  364. corecmd_exec_shell(charon_t)
  365. corecmd_exec_bin(charon_t)
  366. corenet_all_recvfrom_unlabeled(charon_t)
  367. corenet_tcp_sendrecv_all_if(charon_t)
  368. corenet_udp_sendrecv_all_if(charon_t)
  369. corenet_tcp_sendrecv_all_nodes(charon_t)
  370. corenet_udp_sendrecv_all_nodes(charon_t)
  371. corenet_tcp_bind_all_nodes(charon_t)
  372. corenet_udp_bind_all_nodes(charon_t)
  373. corenet_udp_bind_isakmp_port(charon_t)
  374. corenet_udp_bind_ipsecnat_port(charon_t)
  375. dev_read_urand(charon_t)
  376. # allow charon to set contexts on ipsec policy and SAs
  377. domain_ipsec_setcontext_all_domains(charon_t)
  378. files_read_etc_files(charon_t)
  379. fs_dontaudit_getattr_xattr_fs(charon_t)
  380. # allow charon to use avc_has_perm to check context on proposed SA
  381. selinux_compute_access_vector(charon_t)
  382. auth_use_nsswitch(charon_t)
  383. ipsec_setcontext_default_spd(charon_t)
  384. locallogin_use_fds(charon_t)
  385. logging_send_syslog_msg(charon_t)
  386. logging_send_audit_msgs(charon_t)
  387. miscfiles_read_localization(charon_t)
  388. sysnet_exec_ifconfig(charon_t)
  389. allow charon_t ipsec_t:process sigchld;
  390. libs_use_ld_so(charon_t)
  391. libs_exec_ld_so(charon_t)
  392. libs_use_shared_libs(charon_t)
  393. dev_rw_null(charon_t)
  394. dev_read_rand(charon_t)
  395. kernel_search_network_sysctl(charon_t)
  396. kernel_rw_net_sysctls(charon_t)
  397. dev_read_sysfs(charon_t)
  398. kernel_read_crypto_sysctls(charon_t)
  399. ########################################
  400. #
  401. # Setkey local policy
  402. #
  403. allow setkey_t self:capability net_admin;
  404. allow setkey_t self:key_socket create_socket_perms;
  405. allow setkey_t self:netlink_route_socket create_netlink_socket_perms;
  406. allow setkey_t ipsec_conf_file_t:dir list_dir_perms;
  407. read_files_pattern(setkey_t, ipsec_conf_file_t, ipsec_conf_file_t)
  408. read_lnk_files_pattern(setkey_t, ipsec_conf_file_t, ipsec_conf_file_t)
  409. kernel_request_load_module(setkey_t)
  410. # allow setkey utility to set contexts on SA's and policy
  411. domain_ipsec_setcontext_all_domains(setkey_t)
  412. files_read_etc_files(setkey_t)
  413. init_dontaudit_use_fds(setkey_t)
  414. init_read_script_tmp_files(setkey_t)
  415. # allow setkey to set the context for ipsec SAs and policy.
  416. corenet_setcontext_all_spds(setkey_t)
  417. locallogin_use_fds(setkey_t)
  418. miscfiles_read_localization(setkey_t)
  419. seutil_read_config(setkey_t)
  420. userdom_use_user_terminals(setkey_t)