apache.te 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453
  1. policy_module(apache, 2.11.4)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. ## <desc>
  7. ## <p>
  8. ## Determine whether httpd can modify
  9. ## public files used for public file
  10. ## transfer services. Directories/Files must
  11. ## be labeled public_content_rw_t.
  12. ## </p>
  13. ## </desc>
  14. gen_tunable(allow_httpd_anon_write, false)
  15. ## <desc>
  16. ## <p>
  17. ## Determine whether httpd can use mod_auth_pam.
  18. ## </p>
  19. ## </desc>
  20. gen_tunable(allow_httpd_mod_auth_pam, false)
  21. ## <desc>
  22. ## <p>
  23. ## Determine whether httpd can use built in scripting.
  24. ## </p>
  25. ## </desc>
  26. gen_tunable(httpd_builtin_scripting, false)
  27. ## <desc>
  28. ## <p>
  29. ## Determine whether httpd can check spam.
  30. ## </p>
  31. ## </desc>
  32. gen_tunable(httpd_can_check_spam, false)
  33. ## <desc>
  34. ## <p>
  35. ## Determine whether httpd scripts and modules
  36. ## can connect to the network using TCP.
  37. ## </p>
  38. ## </desc>
  39. gen_tunable(httpd_can_network_connect, false)
  40. ## <desc>
  41. ## <p>
  42. ## Determine whether httpd scripts and modules
  43. ## can connect to cobbler over the network.
  44. ## </p>
  45. ## </desc>
  46. gen_tunable(httpd_can_network_connect_cobbler, false)
  47. ## <desc>
  48. ## <p>
  49. ## Determine whether scripts and modules can
  50. ## connect to databases over the network.
  51. ## </p>
  52. ## </desc>
  53. gen_tunable(httpd_can_network_connect_db, false)
  54. ## <desc>
  55. ## <p>
  56. ## Determine whether httpd can connect to
  57. ## ldap over the network.
  58. ## </p>
  59. ## </desc>
  60. gen_tunable(httpd_can_network_connect_ldap, false)
  61. ## <desc>
  62. ## <p>
  63. ## Determine whether httpd can connect
  64. ## to memcache server over the network.
  65. ## </p>
  66. ## </desc>
  67. gen_tunable(httpd_can_network_connect_memcache, false)
  68. ## <desc>
  69. ## <p>
  70. ## Determine whether httpd can act as a relay.
  71. ## </p>
  72. ## </desc>
  73. gen_tunable(httpd_can_network_relay, false)
  74. ## <desc>
  75. ## <p>
  76. ## Determine whether httpd daemon can
  77. ## connect to zabbix over the network.
  78. ## </p>
  79. ## </desc>
  80. gen_tunable(httpd_can_network_connect_zabbix, false)
  81. ## <desc>
  82. ## <p>
  83. ## Determine whether httpd can send mail.
  84. ## </p>
  85. ## </desc>
  86. gen_tunable(httpd_can_sendmail, false)
  87. ## <desc>
  88. ## <p>
  89. ## Determine whether httpd can communicate
  90. ## with avahi service via dbus.
  91. ## </p>
  92. ## </desc>
  93. gen_tunable(httpd_dbus_avahi, false)
  94. ## <desc>
  95. ## <p>
  96. ## Determine wether httpd can use support.
  97. ## </p>
  98. ## </desc>
  99. gen_tunable(httpd_enable_cgi, false)
  100. ## <desc>
  101. ## <p>
  102. ## Determine whether httpd can act as a
  103. ## FTP server by listening on the ftp port.
  104. ## </p>
  105. ## </desc>
  106. gen_tunable(httpd_enable_ftp_server, false)
  107. ## <desc>
  108. ## <p>
  109. ## Determine whether httpd can traverse
  110. ## user home directories.
  111. ## </p>
  112. ## </desc>
  113. gen_tunable(httpd_enable_homedirs, false)
  114. ## <desc>
  115. ## <p>
  116. ## Determine whether httpd gpg can modify
  117. ## public files used for public file
  118. ## transfer services. Directories/Files must
  119. ## be labeled public_content_rw_t.
  120. ## </p>
  121. ## </desc>
  122. gen_tunable(httpd_gpg_anon_write, false)
  123. ## <desc>
  124. ## <p>
  125. ## Determine whether httpd can execute
  126. ## its temporary content.
  127. ## </p>
  128. ## </desc>
  129. gen_tunable(httpd_tmp_exec, false)
  130. ## <desc>
  131. ## <p>
  132. ## Determine whether httpd scripts and
  133. ## modules can use execmem and execstack.
  134. ## </p>
  135. ## </desc>
  136. gen_tunable(httpd_execmem, false)
  137. ## <desc>
  138. ## <p>
  139. ## Determine whether httpd can connect
  140. ## to port 80 for graceful shutdown.
  141. ## </p>
  142. ## </desc>
  143. gen_tunable(httpd_graceful_shutdown, false)
  144. ## <desc>
  145. ## <p>
  146. ## Determine whether httpd can
  147. ## manage IPA content files.
  148. ## </p>
  149. ## </desc>
  150. gen_tunable(httpd_manage_ipa, false)
  151. ## <desc>
  152. ## <p>
  153. ## Determine whether httpd can use mod_auth_ntlm_winbind.
  154. ## </p>
  155. ## </desc>
  156. gen_tunable(httpd_mod_auth_ntlm_winbind, false)
  157. ## <desc>
  158. ## <p>
  159. ## Determine whether httpd can read
  160. ## generic user home content files.
  161. ## </p>
  162. ## </desc>
  163. gen_tunable(httpd_read_user_content, false)
  164. ## <desc>
  165. ## <p>
  166. ## Determine whether httpd can change
  167. ## its resource limits.
  168. ## </p>
  169. ## </desc>
  170. gen_tunable(httpd_setrlimit, false)
  171. ## <desc>
  172. ## <p>
  173. ## Determine whether httpd can run
  174. ## SSI executables in the same domain
  175. ## as system CGI scripts.
  176. ## </p>
  177. ## </desc>
  178. gen_tunable(httpd_ssi_exec, false)
  179. ## <desc>
  180. ## <p>
  181. ## Determine whether httpd can communicate
  182. ## with the terminal. Needed for entering the
  183. ## passphrase for certificates at the terminal.
  184. ## </p>
  185. ## </desc>
  186. gen_tunable(httpd_tty_comm, false)
  187. ## <desc>
  188. ## <p>
  189. ## Determine whether httpd can have full access
  190. ## to its content types.
  191. ## </p>
  192. ## </desc>
  193. gen_tunable(httpd_unified, false)
  194. ## <desc>
  195. ## <p>
  196. ## Determine whether httpd can use
  197. ## cifs file systems.
  198. ## </p>
  199. ## </desc>
  200. gen_tunable(httpd_use_cifs, false)
  201. ## <desc>
  202. ## <p>
  203. ## Determine whether httpd can
  204. ## use fuse file systems.
  205. ## </p>
  206. ## </desc>
  207. gen_tunable(httpd_use_fusefs, false)
  208. ## <desc>
  209. ## <p>
  210. ## Determine whether httpd can use gpg.
  211. ## </p>
  212. ## </desc>
  213. gen_tunable(httpd_use_gpg, false)
  214. ## <desc>
  215. ## <p>
  216. ## Determine whether httpd can use
  217. ## nfs file systems.
  218. ## </p>
  219. ## </desc>
  220. gen_tunable(httpd_use_nfs, false)
  221. attribute httpdcontent;
  222. attribute httpd_htaccess_type;
  223. # domains that can exec all scripts
  224. attribute httpd_exec_scripts;
  225. attribute httpd_ra_content;
  226. attribute httpd_rw_content;
  227. attribute httpd_script_exec_type;
  228. # all script domains
  229. attribute httpd_script_domains;
  230. attribute_role httpd_helper_roles;
  231. roleattribute system_r httpd_helper_roles;
  232. type httpd_t;
  233. type httpd_exec_t;
  234. init_daemon_domain(httpd_t, httpd_exec_t)
  235. type httpd_cache_t;
  236. files_type(httpd_cache_t)
  237. type httpd_config_t;
  238. files_config_file(httpd_config_t)
  239. type httpd_helper_t;
  240. type httpd_helper_exec_t;
  241. application_domain(httpd_helper_t, httpd_helper_exec_t)
  242. role httpd_helper_roles types httpd_helper_t;
  243. init_rw_inherited_script_tmp_files(httpd_t)
  244. type httpd_initrc_exec_t;
  245. init_script_file(httpd_initrc_exec_t)
  246. type httpd_keytab_t;
  247. files_type(httpd_keytab_t)
  248. type httpd_lock_t;
  249. files_lock_file(httpd_lock_t)
  250. type httpd_log_t;
  251. logging_log_file(httpd_log_t)
  252. type httpd_modules_t;
  253. files_type(httpd_modules_t)
  254. type httpd_rotatelogs_t;
  255. type httpd_rotatelogs_exec_t;
  256. init_daemon_domain(httpd_rotatelogs_t, httpd_rotatelogs_exec_t)
  257. type httpd_squirrelmail_t;
  258. files_type(httpd_squirrelmail_t)
  259. type squirrelmail_spool_t;
  260. files_tmp_file(squirrelmail_spool_t)
  261. type httpd_suexec_t;
  262. type httpd_suexec_exec_t;
  263. domain_type(httpd_suexec_t)
  264. domain_entry_file(httpd_suexec_t, httpd_suexec_exec_t)
  265. role system_r types httpd_suexec_t;
  266. type httpd_suexec_tmp_t;
  267. files_tmp_file(httpd_suexec_tmp_t)
  268. apache_content_template(sys)
  269. corecmd_shell_entry_type(httpd_sys_script_t)
  270. typealias httpd_sys_content_t alias ntop_http_content_t;
  271. type httpd_tmp_t;
  272. files_tmp_file(httpd_tmp_t)
  273. type httpd_tmpfs_t;
  274. files_tmpfs_file(httpd_tmpfs_t)
  275. type httpd_unit_t;
  276. init_unit_file(httpd_unit_t)
  277. apache_content_template(user)
  278. ubac_constrained(httpd_user_script_t)
  279. userdom_user_home_content(httpd_user_content_t)
  280. userdom_user_home_content(httpd_user_htaccess_t)
  281. userdom_user_home_content(httpd_user_script_exec_t)
  282. userdom_user_home_content(httpd_user_ra_content_t)
  283. userdom_user_home_content(httpd_user_rw_content_t)
  284. typealias httpd_user_content_t alias { httpd_staff_content_t httpd_sysadm_content_t };
  285. typealias httpd_user_content_t alias { httpd_auditadm_content_t httpd_secadm_content_t };
  286. typealias httpd_user_content_t alias { httpd_staff_script_ro_t httpd_sysadm_script_ro_t };
  287. typealias httpd_user_content_t alias { httpd_auditadm_script_ro_t httpd_secadm_script_ro_t };
  288. typealias httpd_user_htaccess_t alias { httpd_staff_htaccess_t httpd_sysadm_htaccess_t };
  289. typealias httpd_user_htaccess_t alias { httpd_auditadm_htaccess_t httpd_secadm_htaccess_t };
  290. typealias httpd_user_script_t alias { httpd_staff_script_t httpd_sysadm_script_t };
  291. typealias httpd_user_script_t alias { httpd_auditadm_script_t httpd_secadm_script_t };
  292. typealias httpd_user_script_exec_t alias { httpd_staff_script_exec_t httpd_sysadm_script_exec_t };
  293. typealias httpd_user_script_exec_t alias { httpd_auditadm_script_exec_t httpd_secadm_script_exec_t };
  294. typealias httpd_user_rw_content_t alias { httpd_staff_script_rw_t httpd_sysadm_script_rw_t };
  295. typealias httpd_user_rw_content_t alias { httpd_auditadm_script_rw_t httpd_secadm_script_rw_t };
  296. typealias httpd_user_ra_content_t alias { httpd_staff_script_ra_t httpd_sysadm_script_ra_t };
  297. typealias httpd_user_ra_content_t alias { httpd_auditadm_script_ra_t httpd_secadm_script_ra_t };
  298. type httpd_var_lib_t;
  299. files_type(httpd_var_lib_t)
  300. type httpd_var_run_t;
  301. files_pid_file(httpd_var_run_t)
  302. type httpd_passwd_t;
  303. type httpd_passwd_exec_t;
  304. domain_type(httpd_passwd_t)
  305. domain_entry_file(httpd_passwd_t, httpd_passwd_exec_t)
  306. role system_r types httpd_passwd_t;
  307. type httpd_gpg_t;
  308. domain_type(httpd_gpg_t)
  309. role system_r types httpd_gpg_t;
  310. optional_policy(`
  311. prelink_object_file(httpd_modules_t)
  312. ')
  313. ########################################
  314. #
  315. # Local policy
  316. #
  317. allow httpd_t self:capability { chown dac_override kill setgid setuid sys_nice sys_tty_config };
  318. dontaudit httpd_t self:capability net_admin;
  319. init_dontaudit_getattr_exec(httpd_t)
  320. allow httpd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
  321. allow httpd_t self:fd use;
  322. allow httpd_t self:sock_file read_sock_file_perms;
  323. allow httpd_t self:fifo_file rw_fifo_file_perms;
  324. allow httpd_t self:shm create_shm_perms;
  325. allow httpd_t self:sem create_sem_perms;
  326. allow httpd_t self:msgq create_msgq_perms;
  327. allow httpd_t self:msg { send receive };
  328. allow httpd_t self:unix_dgram_socket sendto;
  329. allow httpd_t self:unix_stream_socket { accept connectto listen };
  330. allow httpd_t self:tcp_socket { accept listen };
  331. allow httpd_t httpd_sys_content_t:dir { write remove_name add_name };
  332. allow httpd_t httpd_sys_content_t:file { write create unlink };
  333. manage_dirs_pattern(httpd_t, httpd_cache_t, httpd_cache_t)
  334. manage_files_pattern(httpd_t, httpd_cache_t, httpd_cache_t)
  335. manage_lnk_files_pattern(httpd_t, httpd_cache_t, httpd_cache_t)
  336. files_var_filetrans(httpd_t, httpd_cache_t, dir)
  337. allow httpd_t httpd_config_t:dir list_dir_perms;
  338. read_files_pattern(httpd_t, httpd_config_t, httpd_config_t)
  339. read_lnk_files_pattern(httpd_t, httpd_config_t, httpd_config_t)
  340. allow httpd_t httpd_keytab_t:file read_file_perms;
  341. allow httpd_t httpd_lock_t:dir manage_dir_perms;
  342. allow httpd_t httpd_lock_t:file manage_file_perms;
  343. files_lock_filetrans(httpd_t, httpd_lock_t, { file dir })
  344. manage_dirs_pattern(httpd_t, httpd_log_t, httpd_log_t)
  345. manage_files_pattern(httpd_t, httpd_log_t, httpd_log_t)
  346. read_lnk_files_pattern(httpd_t, httpd_log_t, httpd_log_t)
  347. logging_log_filetrans(httpd_t, httpd_log_t, file)
  348. allow httpd_t httpd_modules_t:dir list_dir_perms;
  349. mmap_files_pattern(httpd_t, httpd_modules_t, httpd_modules_t)
  350. read_files_pattern(httpd_t, httpd_modules_t, httpd_modules_t)
  351. read_lnk_files_pattern(httpd_t, httpd_modules_t, httpd_modules_t)
  352. allow httpd_t httpd_rotatelogs_t:process signal_perms;
  353. manage_dirs_pattern(httpd_t, httpd_squirrelmail_t, httpd_squirrelmail_t)
  354. manage_files_pattern(httpd_t, httpd_squirrelmail_t, httpd_squirrelmail_t)
  355. manage_lnk_files_pattern(httpd_t, httpd_squirrelmail_t, httpd_squirrelmail_t)
  356. allow httpd_t httpd_suexec_exec_t:file read_file_perms;
  357. allow httpd_t httpd_sys_script_t:unix_stream_socket connectto;
  358. allow httpd_t httpd_sys_script_t:process signull;
  359. manage_dirs_pattern(httpd_t, httpd_tmp_t, httpd_tmp_t)
  360. manage_files_pattern(httpd_t, httpd_tmp_t, httpd_tmp_t)
  361. manage_sock_files_pattern(httpd_t, httpd_tmp_t, httpd_tmp_t)
  362. manage_lnk_files_pattern(httpd_t, httpd_tmp_t, httpd_tmp_t)
  363. files_tmp_filetrans(httpd_t, httpd_tmp_t, { file dir lnk_file sock_file })
  364. userdom_user_tmp_filetrans(httpd_t, httpd_tmp_t, dir)
  365. manage_dirs_pattern(httpd_t, httpd_tmpfs_t, httpd_tmpfs_t)
  366. manage_files_pattern(httpd_t, httpd_tmpfs_t, httpd_tmpfs_t)
  367. manage_lnk_files_pattern(httpd_t, httpd_tmpfs_t, httpd_tmpfs_t)
  368. manage_fifo_files_pattern(httpd_t, httpd_tmpfs_t, httpd_tmpfs_t)
  369. manage_sock_files_pattern(httpd_t, httpd_tmpfs_t, httpd_tmpfs_t)
  370. fs_tmpfs_filetrans(httpd_t, httpd_tmpfs_t, { dir file lnk_file sock_file fifo_file })
  371. manage_dirs_pattern(httpd_t, httpd_var_lib_t, httpd_var_lib_t)
  372. manage_files_pattern(httpd_t, httpd_var_lib_t, httpd_var_lib_t)
  373. manage_lnk_files_pattern(httpd_t, httpd_var_lib_t, httpd_var_lib_t)
  374. files_var_lib_filetrans(httpd_t, httpd_var_lib_t, { dir file })
  375. setattr_dirs_pattern(httpd_t, httpd_var_run_t, httpd_var_run_t)
  376. manage_dirs_pattern(httpd_t, httpd_var_run_t, httpd_var_run_t)
  377. manage_files_pattern(httpd_t, httpd_var_run_t, httpd_var_run_t)
  378. manage_sock_files_pattern(httpd_t, httpd_var_run_t, httpd_var_run_t)
  379. files_pid_filetrans(httpd_t, httpd_var_run_t, { file sock_file dir })
  380. manage_dirs_pattern(httpd_t, squirrelmail_spool_t, squirrelmail_spool_t)
  381. manage_files_pattern(httpd_t, squirrelmail_spool_t, squirrelmail_spool_t)
  382. manage_lnk_files_pattern(httpd_t, squirrelmail_spool_t, squirrelmail_spool_t)
  383. can_exec(httpd_t, httpd_exec_t)
  384. domtrans_pattern(httpd_t, httpd_helper_exec_t, httpd_helper_t)
  385. domtrans_pattern(httpd_t, httpd_passwd_exec_t, httpd_passwd_t)
  386. domtrans_pattern(httpd_t, httpd_rotatelogs_exec_t, httpd_rotatelogs_t)
  387. domtrans_pattern(httpd_t, httpd_suexec_exec_t, httpd_suexec_t)
  388. kernel_read_kernel_sysctls(httpd_t)
  389. kernel_read_vm_sysctls(httpd_t)
  390. kernel_read_vm_overcommit_sysctl(httpd_t)
  391. kernel_read_network_state(httpd_t)
  392. kernel_read_system_state(httpd_t)
  393. kernel_search_network_sysctl(httpd_t)
  394. corenet_all_recvfrom_unlabeled(httpd_t)
  395. corenet_all_recvfrom_netlabel(httpd_t)
  396. corenet_tcp_sendrecv_generic_if(httpd_t)
  397. corenet_tcp_sendrecv_generic_node(httpd_t)
  398. corenet_tcp_bind_generic_node(httpd_t)
  399. corenet_sendrecv_http_server_packets(httpd_t)
  400. corenet_tcp_bind_http_port(httpd_t)
  401. corenet_tcp_sendrecv_http_port(httpd_t)
  402. corenet_sendrecv_http_cache_server_packets(httpd_t)
  403. corenet_tcp_bind_http_cache_port(httpd_t)
  404. corenet_tcp_sendrecv_http_cache_port(httpd_t)
  405. corecmd_exec_bin(httpd_t)
  406. corecmd_exec_shell(httpd_t)
  407. dev_read_sysfs(httpd_t)
  408. dev_read_rand(httpd_t)
  409. dev_read_urand(httpd_t)
  410. dev_rw_crypto(httpd_t)
  411. domain_use_interactive_fds(httpd_t)
  412. fs_getattr_all_fs(httpd_t)
  413. fs_search_auto_mountpoints(httpd_t)
  414. fs_getattr_all_fs(httpd_t)
  415. fs_read_anon_inodefs_files(httpd_t)
  416. fs_read_iso9660_files(httpd_t)
  417. fs_search_auto_mountpoints(httpd_t)
  418. files_dontaudit_getattr_all_pids(httpd_t)
  419. files_read_usr_files(httpd_t)
  420. files_list_mnt(httpd_t)
  421. files_search_spool(httpd_t)
  422. files_read_var_symlinks(httpd_t)
  423. files_read_var_lib_files(httpd_t)
  424. files_search_home(httpd_t)
  425. files_getattr_home_dir(httpd_t)
  426. files_read_etc_runtime_files(httpd_t)
  427. files_read_var_lib_symlinks(httpd_t)
  428. auth_use_nsswitch(httpd_t)
  429. libs_read_lib_files(httpd_t)
  430. logging_send_syslog_msg(httpd_t)
  431. miscfiles_read_localization(httpd_t)
  432. miscfiles_read_fonts(httpd_t)
  433. miscfiles_read_public_files(httpd_t)
  434. miscfiles_read_generic_certs(httpd_t)
  435. miscfiles_read_tetex_data(httpd_t)
  436. seutil_dontaudit_search_config(httpd_t)
  437. userdom_use_unpriv_users_fds(httpd_t)
  438. init_read_state(httpd_t)
  439. ifdef(`init_systemd', `
  440. systemd_manage_passwd_run(httpd_t)
  441. ')
  442. ifdef(`TODO',`
  443. tunable_policy(`allow_httpd_mod_auth_pam',`
  444. auth_domtrans_chk_passwd(httpd_t)
  445. logging_send_audit_msgs(httpd_t)
  446. ')
  447. ')
  448. ifdef(`hide_broken_symptoms',`
  449. libs_exec_lib_files(httpd_t)
  450. ')
  451. tunable_policy(`allow_httpd_anon_write',`
  452. miscfiles_manage_public_files(httpd_t)
  453. ')
  454. tunable_policy(`httpd_can_network_connect',`
  455. corenet_sendrecv_all_client_packets(httpd_t)
  456. corenet_tcp_connect_all_ports(httpd_t)
  457. corenet_tcp_sendrecv_all_ports(httpd_t)
  458. ')
  459. tunable_policy(`httpd_can_network_connect_db',`
  460. corenet_sendrecv_gds_db_client_packets(httpd_t)
  461. corenet_tcp_connect_gds_db_port(httpd_t)
  462. corenet_tcp_sendrecv_gds_db_port(httpd_t)
  463. corenet_sendrecv_mssql_client_packets(httpd_t)
  464. corenet_tcp_connect_mssql_port(httpd_t)
  465. corenet_tcp_sendrecv_mssql_port(httpd_t)
  466. corenet_sendrecv_oracledb_client_packets(httpd_t)
  467. corenet_tcp_connect_oracledb_port(httpd_t)
  468. corenet_tcp_sendrecv_oracledb_port(httpd_t)
  469. ')
  470. tunable_policy(`httpd_can_network_relay',`
  471. corenet_sendrecv_gopher_client_packets(httpd_t)
  472. corenet_tcp_connect_gopher_port(httpd_t)
  473. corenet_tcp_sendrecv_gopher_port(httpd_t)
  474. corenet_sendrecv_ftp_client_packets(httpd_t)
  475. corenet_tcp_connect_ftp_port(httpd_t)
  476. corenet_tcp_sendrecv_ftp_port(httpd_t)
  477. corenet_sendrecv_http_client_packets(httpd_t)
  478. corenet_tcp_connect_http_port(httpd_t)
  479. corenet_tcp_sendrecv_http_port(httpd_t)
  480. corenet_sendrecv_http_cache_client_packets(httpd_t)
  481. corenet_tcp_connect_http_cache_port(httpd_t)
  482. corenet_tcp_sendrecv_http_cache_port(httpd_t)
  483. corenet_sendrecv_squid_client_packets(httpd_t)
  484. corenet_tcp_connect_squid_port(httpd_t)
  485. corenet_tcp_sendrecv_squid_port(httpd_t)
  486. ')
  487. tunable_policy(`httpd_builtin_scripting',`
  488. exec_files_pattern(httpd_t, httpd_script_exec_type, httpd_script_exec_type)
  489. allow httpd_t httpdcontent:dir list_dir_perms;
  490. allow httpd_t httpdcontent:file read_file_perms;
  491. allow httpd_t httpdcontent:lnk_file read_lnk_file_perms;
  492. ')
  493. tunable_policy(`httpd_enable_cgi',`
  494. allow httpd_t httpd_script_domains:process { signal sigkill sigstop };
  495. allow httpd_t httpd_script_exec_type:dir list_dir_perms;
  496. allow httpd_t httpd_script_exec_type:lnk_file read_lnk_file_perms;
  497. ')
  498. tunable_policy(`httpd_enable_cgi && httpd_use_nfs',`
  499. fs_nfs_domtrans(httpd_t, httpd_sys_script_t)
  500. ')
  501. tunable_policy(`httpd_enable_cgi && httpd_use_cifs',`
  502. fs_cifs_domtrans(httpd_t, httpd_sys_script_t)
  503. ')
  504. # tunable_policy(`httpd_enable_cgi && httpd_use_fusefs',`
  505. # fs_fusefs_domtrans(httpd_t, httpd_sys_script_t)
  506. # ')
  507. tunable_policy(`httpd_enable_cgi && httpd_unified && httpd_builtin_scripting',`
  508. domtrans_pattern(httpd_t, httpdcontent, httpd_sys_script_t)
  509. manage_dirs_pattern(httpd_t, httpdcontent, httpdcontent)
  510. manage_files_pattern(httpd_t, httpdcontent, httpdcontent)
  511. manage_fifo_files_pattern(httpd_t, httpdcontent, httpdcontent)
  512. manage_lnk_files_pattern(httpd_t, httpdcontent, httpdcontent)
  513. manage_sock_files_pattern(httpd_t, httpdcontent, httpdcontent)
  514. ')
  515. tunable_policy(`httpd_enable_ftp_server',`
  516. corenet_sendrecv_ftp_server_packets(httpd_t)
  517. corenet_tcp_bind_ftp_port(httpd_t)
  518. corenet_tcp_sendrecv_ftp_port(httpd_t)
  519. ')
  520. tunable_policy(`httpd_enable_homedirs',`
  521. userdom_search_user_home_dirs(httpd_t)
  522. ')
  523. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  524. fs_list_auto_mountpoints(httpd_t)
  525. fs_read_nfs_files(httpd_t)
  526. fs_read_nfs_symlinks(httpd_t)
  527. ')
  528. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  529. fs_exec_nfs_files(httpd_t)
  530. ')
  531. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  532. fs_list_auto_mountpoints(httpd_t)
  533. fs_read_cifs_files(httpd_t)
  534. fs_read_cifs_symlinks(httpd_t)
  535. ')
  536. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  537. fs_exec_cifs_files(httpd_t)
  538. ')
  539. tunable_policy(`httpd_execmem',`
  540. allow httpd_t self:process { execmem execstack };
  541. ')
  542. tunable_policy(`httpd_can_sendmail',`
  543. corenet_sendrecv_smtp_client_packets(httpd_t)
  544. corenet_tcp_connect_smtp_port(httpd_t)
  545. corenet_tcp_sendrecv_smtp_port(httpd_t)
  546. corenet_sendrecv_pop_client_packets(httpd_t)
  547. corenet_tcp_connect_pop_port(httpd_t)
  548. corenet_tcp_sendrecv_pop_port(httpd_t)
  549. mta_send_mail(httpd_t)
  550. mta_signal_system_mail(httpd_t)
  551. ')
  552. optional_policy(`
  553. tunable_policy(`httpd_can_network_connect_zabbix',`
  554. zabbix_tcp_connect(httpd_t)
  555. ')
  556. ')
  557. optional_policy(`
  558. tunable_policy(`httpd_can_sendmail && httpd_can_check_spam',`
  559. spamassassin_domtrans_client(httpd_t)
  560. ')
  561. ')
  562. tunable_policy(`httpd_graceful_shutdown',`
  563. corenet_sendrecv_http_client_packets(httpd_t)
  564. corenet_tcp_connect_http_port(httpd_t)
  565. corenet_tcp_sendrecv_http_port(httpd_t)
  566. ')
  567. optional_policy(`
  568. tunable_policy(`httpd_enable_cgi && httpd_use_gpg',`
  569. gpg_spec_domtrans(httpd_t, httpd_gpg_t)
  570. ')
  571. ')
  572. optional_policy(`
  573. tunable_policy(`httpd_mod_auth_ntlm_winbind',`
  574. samba_domtrans_winbind_helper(httpd_t)
  575. ')
  576. ')
  577. tunable_policy(`httpd_read_user_content',`
  578. userdom_read_user_home_content_files(httpd_t)
  579. ')
  580. tunable_policy(`httpd_setrlimit',`
  581. allow httpd_t self:process setrlimit;
  582. allow httpd_t self:capability sys_resource;
  583. ')
  584. tunable_policy(`httpd_ssi_exec',`
  585. corecmd_shell_domtrans(httpd_t, httpd_sys_script_t)
  586. ')
  587. tunable_policy(`httpd_tmp_exec && httpd_builtin_scripting',`
  588. can_exec(httpd_t, httpd_tmp_t)
  589. ')
  590. tunable_policy(`httpd_tty_comm',`
  591. userdom_use_user_terminals(httpd_t)
  592. ',`
  593. userdom_dontaudit_use_user_terminals(httpd_t)
  594. ')
  595. tunable_policy(`httpd_use_cifs',`
  596. fs_list_auto_mountpoints(httpd_t)
  597. fs_manage_cifs_dirs(httpd_t)
  598. fs_manage_cifs_files(httpd_t)
  599. fs_manage_cifs_symlinks(httpd_t)
  600. ')
  601. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  602. fs_exec_cifs_files(httpd_t)
  603. ')
  604. tunable_policy(`httpd_use_fusefs',`
  605. fs_list_auto_mountpoints(httpd_t)
  606. fs_manage_fusefs_dirs(httpd_t)
  607. fs_manage_fusefs_files(httpd_t)
  608. fs_read_fusefs_symlinks(httpd_t)
  609. ')
  610. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  611. fs_exec_fusefs_files(httpd_t)
  612. ')
  613. tunable_policy(`httpd_use_nfs',`
  614. fs_list_auto_mountpoints(httpd_t)
  615. rpc_manage_nfs_rw_content(httpd_t)
  616. rpc_read_nfs_content(httpd_t)
  617. ')
  618. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  619. fs_exec_nfs_files(httpd_t)
  620. ')
  621. optional_policy(`
  622. calamaris_read_www_files(httpd_t)
  623. ')
  624. optional_policy(`
  625. ccs_read_config(httpd_t)
  626. ')
  627. optional_policy(`
  628. clamav_domtrans_clamscan(httpd_t)
  629. ')
  630. optional_policy(`
  631. cobbler_read_config(httpd_t)
  632. cobbler_read_lib_files(httpd_t)
  633. ')
  634. optional_policy(`
  635. cron_system_entry(httpd_t, httpd_exec_t)
  636. ')
  637. optional_policy(`
  638. cvs_read_data(httpd_t)
  639. ')
  640. optional_policy(`
  641. daemontools_service_domain(httpd_t, httpd_exec_t)
  642. ')
  643. optional_policy(`
  644. dbus_system_bus_client(httpd_t)
  645. tunable_policy(`httpd_dbus_avahi',`
  646. avahi_dbus_chat(httpd_t)
  647. ')
  648. ')
  649. optional_policy(`
  650. git_read_generic_sys_content_files(httpd_t)
  651. ')
  652. optional_policy(`
  653. gitosis_read_lib_files(httpd_t)
  654. ')
  655. optional_policy(`
  656. kerberos_manage_host_rcache(httpd_t)
  657. kerberos_read_keytab(httpd_t)
  658. kerberos_tmp_filetrans_host_rcache(httpd_t, file, "HTTP_23")
  659. kerberos_tmp_filetrans_host_rcache(httpd_t, file, "HTTP_48")
  660. kerberos_use(httpd_t)
  661. ')
  662. optional_policy(`
  663. ldap_stream_connect(httpd_t)
  664. tunable_policy(`httpd_can_network_connect_ldap',`
  665. ldap_tcp_connect(httpd_t)
  666. ')
  667. ')
  668. optional_policy(`
  669. mailman_signal_cgi(httpd_t)
  670. mailman_domtrans_cgi(httpd_t)
  671. mailman_read_data_files(httpd_t)
  672. mailman_search_data(httpd_t)
  673. mailman_read_archive(httpd_t)
  674. ')
  675. optional_policy(`
  676. memcached_stream_connect(httpd_t)
  677. tunable_policy(`httpd_can_network_connect_memcache',`
  678. memcached_tcp_connect(httpd_t)
  679. ')
  680. tunable_policy(`httpd_manage_ipa',`
  681. memcached_manage_pid_files(httpd_t)
  682. ')
  683. ')
  684. optional_policy(`
  685. mysql_read_config(httpd_t)
  686. mysql_stream_connect(httpd_t)
  687. tunable_policy(`httpd_can_network_connect_db',`
  688. mysql_tcp_connect(httpd_t)
  689. ')
  690. ')
  691. optional_policy(`
  692. nagios_read_config(httpd_t)
  693. ')
  694. optional_policy(`
  695. openca_domtrans(httpd_t)
  696. openca_signal(httpd_t)
  697. openca_sigstop(httpd_t)
  698. openca_kill(httpd_t)
  699. ')
  700. optional_policy(`
  701. pcscd_read_pid_files(httpd_t)
  702. ')
  703. optional_policy(`
  704. postgresql_stream_connect(httpd_t)
  705. postgresql_unpriv_client(httpd_t)
  706. tunable_policy(`httpd_can_network_connect_db',`
  707. postgresql_tcp_connect(httpd_t)
  708. ')
  709. ')
  710. optional_policy(`
  711. puppet_read_lib_files(httpd_t)
  712. ')
  713. optional_policy(`
  714. rpc_search_nfs_state_data(httpd_t)
  715. ')
  716. optional_policy(`
  717. seutil_sigchld_newrole(httpd_t)
  718. ')
  719. optional_policy(`
  720. shibboleth_read_config(httpd_t)
  721. shibboleth_stream_connect(httpd_t)
  722. ')
  723. optional_policy(`
  724. smokeping_read_lib_files(httpd_t)
  725. ')
  726. optional_policy(`
  727. snmp_dontaudit_read_snmp_var_lib_files(httpd_t)
  728. snmp_dontaudit_write_snmp_var_lib_files(httpd_t)
  729. ')
  730. optional_policy(`
  731. udev_read_db(httpd_t)
  732. ')
  733. optional_policy(`
  734. yam_read_content(httpd_t)
  735. ')
  736. ########################################
  737. #
  738. # Helper local policy
  739. #
  740. read_files_pattern(httpd_helper_t, httpd_config_t, httpd_config_t)
  741. append_files_pattern(httpd_helper_t, httpd_log_t, httpd_log_t)
  742. read_lnk_files_pattern(httpd_helper_t, httpd_log_t, httpd_log_t)
  743. files_search_etc(httpd_helper_t)
  744. logging_search_logs(httpd_helper_t)
  745. logging_send_syslog_msg(httpd_helper_t)
  746. tunable_policy(`httpd_tty_comm',`
  747. userdom_use_user_terminals(httpd_helper_t)
  748. ',`
  749. userdom_dontaudit_use_user_terminals(httpd_helper_t)
  750. ')
  751. ########################################
  752. #
  753. # Suexec local policy
  754. #
  755. allow httpd_suexec_t self:capability { setuid setgid };
  756. allow httpd_suexec_t self:process signal_perms;
  757. allow httpd_suexec_t self:fifo_file rw_fifo_file_perms;
  758. allow httpd_suexec_t self:tcp_socket { accept listen };
  759. allow httpd_suexec_t self:unix_stream_socket { accept listen };
  760. create_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  761. append_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  762. read_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  763. read_lnk_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  764. manage_dirs_pattern(httpd_suexec_t, httpd_suexec_tmp_t, httpd_suexec_tmp_t)
  765. manage_files_pattern(httpd_suexec_t, httpd_suexec_tmp_t, httpd_suexec_tmp_t)
  766. files_tmp_filetrans(httpd_suexec_t, httpd_suexec_tmp_t, { file dir })
  767. kernel_read_kernel_sysctls(httpd_suexec_t)
  768. kernel_list_proc(httpd_suexec_t)
  769. kernel_read_proc_symlinks(httpd_suexec_t)
  770. corenet_all_recvfrom_unlabeled(httpd_suexec_t)
  771. corenet_all_recvfrom_netlabel(httpd_suexec_t)
  772. corenet_tcp_sendrecv_generic_if(httpd_suexec_t)
  773. corenet_tcp_sendrecv_generic_node(httpd_suexec_t)
  774. corecmd_exec_bin(httpd_suexec_t)
  775. corecmd_exec_shell(httpd_suexec_t)
  776. dev_read_urand(httpd_suexec_t)
  777. fs_read_iso9660_files(httpd_suexec_t)
  778. fs_search_auto_mountpoints(httpd_suexec_t)
  779. files_read_usr_files(httpd_suexec_t)
  780. files_dontaudit_search_pids(httpd_suexec_t)
  781. files_search_home(httpd_suexec_t)
  782. auth_use_nsswitch(httpd_suexec_t)
  783. logging_search_logs(httpd_suexec_t)
  784. logging_send_syslog_msg(httpd_suexec_t)
  785. miscfiles_read_localization(httpd_suexec_t)
  786. miscfiles_read_public_files(httpd_suexec_t)
  787. tunable_policy(`httpd_builtin_scripting',`
  788. exec_files_pattern(httpd_suexec_t, httpd_script_exec_type, httpd_script_exec_type)
  789. allow httpd_suexec_t httpdcontent:dir list_dir_perms;
  790. allow httpd_suexec_t httpdcontent:file read_file_perms;
  791. allow httpd_suexec_t httpdcontent:lnk_file read_lnk_file_perms;
  792. ')
  793. tunable_policy(`httpd_can_network_connect',`
  794. corenet_tcp_connect_all_ports(httpd_suexec_t)
  795. corenet_sendrecv_all_client_packets(httpd_suexec_t)
  796. corenet_tcp_sendrecv_all_ports(httpd_suexec_t)
  797. ')
  798. tunable_policy(`httpd_can_network_connect_db',`
  799. corenet_sendrecv_gds_db_client_packets(httpd_suexec_t)
  800. corenet_tcp_connect_gds_db_port(httpd_suexec_t)
  801. corenet_tcp_sendrecv_gds_db_port(httpd_suexec_t)
  802. corenet_sendrecv_mssql_client_packets(httpd_suexec_t)
  803. corenet_tcp_connect_mssql_port(httpd_suexec_t)
  804. corenet_tcp_sendrecv_mssql_port(httpd_suexec_t)
  805. corenet_sendrecv_oracledb_client_packets(httpd_suexec_t)
  806. corenet_tcp_connect_oracledb_port(httpd_suexec_t)
  807. corenet_tcp_sendrecv_oracledb_port(httpd_suexec_t)
  808. ')
  809. tunable_policy(`httpd_can_sendmail',`
  810. corenet_sendrecv_smtp_client_packets(httpd_suexec_t)
  811. corenet_tcp_connect_smtp_port(httpd_suexec_t)
  812. corenet_tcp_sendrecv_smtp_port(httpd_suexec_t)
  813. corenet_sendrecv_pop_client_packets(httpd_suexec_t)
  814. corenet_tcp_connect_pop_port(httpd_suexec_t)
  815. corenet_tcp_sendrecv_pop_port(httpd_suexec_t)
  816. mta_send_mail(httpd_suexec_t)
  817. mta_signal_system_mail(httpd_suexec_t)
  818. ')
  819. tunable_policy(`httpd_enable_cgi && httpd_unified',`
  820. domtrans_pattern(httpd_suexec_t, httpdcontent, httpd_sys_script_t)
  821. ')
  822. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  823. fs_list_auto_mountpoints(httpd_suexec_t)
  824. fs_read_cifs_files(httpd_suexec_t)
  825. fs_read_cifs_symlinks(httpd_suexec_t)
  826. ')
  827. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  828. fs_exec_cifs_files(httpd_suexec_t)
  829. ')
  830. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  831. fs_list_auto_mountpoints(httpd_suexec_t)
  832. fs_read_nfs_files(httpd_suexec_t)
  833. fs_read_nfs_symlinks(httpd_suexec_t)
  834. ')
  835. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  836. fs_exec_nfs_files(httpd_suexec_t)
  837. ')
  838. tunable_policy(`httpd_execmem',`
  839. allow httpd_suexec_t self:process { execmem execstack };
  840. ')
  841. tunable_policy(`httpd_tmp_exec',`
  842. can_exec(httpd_suexec_t, httpd_suexec_tmp_t)
  843. ')
  844. tunable_policy(`httpd_tty_comm',`
  845. userdom_use_user_terminals(httpd_suexec_t)
  846. ',`
  847. userdom_dontaudit_use_user_terminals(httpd_suexec_t)
  848. ')
  849. tunable_policy(`httpd_use_cifs',`
  850. fs_list_auto_mountpoints(httpd_suexec_t)
  851. fs_manage_cifs_dirs(httpd_suexec_t)
  852. fs_manage_cifs_files(httpd_suexec_t)
  853. fs_manage_cifs_symlinks(httpd_suexec_t)
  854. ')
  855. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  856. fs_exec_cifs_files(httpd_suexec_t)
  857. ')
  858. tunable_policy(`httpd_use_fusefs',`
  859. fs_list_auto_mountpoints(httpd_suexec_t)
  860. fs_manage_fusefs_dirs(httpd_suexec_t)
  861. fs_manage_fusefs_files(httpd_suexec_t)
  862. fs_read_fusefs_symlinks(httpd_suexec_t)
  863. ')
  864. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  865. fs_exec_fusefs_files(httpd_suexec_t)
  866. ')
  867. tunable_policy(`httpd_use_nfs',`
  868. fs_list_auto_mountpoints(httpd_suexec_t)
  869. rpc_manage_nfs_rw_content(httpd_t)
  870. rpc_read_nfs_content(httpd_t)
  871. ')
  872. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  873. fs_exec_nfs_files(httpd_suexec_t)
  874. ')
  875. optional_policy(`
  876. mailman_domtrans_cgi(httpd_suexec_t)
  877. ')
  878. optional_policy(`
  879. mysql_stream_connect(httpd_suexec_t)
  880. mysql_read_config(httpd_suexec_t)
  881. tunable_policy(`httpd_can_network_connect_db',`
  882. mysql_tcp_connect(httpd_suexec_t)
  883. ')
  884. ')
  885. optional_policy(`
  886. postgresql_stream_connect(httpd_suexec_t)
  887. postgresql_unpriv_client(httpd_suexec_t)
  888. tunable_policy(`httpd_can_network_connect_db',`
  889. postgresql_tcp_connect(httpd_suexec_t)
  890. ')
  891. ')
  892. tunable_policy(`httpd_read_user_content',`
  893. userdom_read_user_home_content_files(httpd_suexec_t)
  894. ')
  895. tunable_policy(`httpd_enable_homedirs',`
  896. userdom_search_user_home_dirs(httpd_suexec_t)
  897. ')
  898. ########################################
  899. #
  900. # Common script local policy
  901. #
  902. allow httpd_script_domains self:fifo_file rw_file_perms;
  903. allow httpd_script_domains self:unix_stream_socket connectto;
  904. allow httpd_script_domains httpd_sys_content_t:dir search_dir_perms;
  905. append_files_pattern(httpd_script_domains, httpd_log_t, httpd_log_t)
  906. read_lnk_files_pattern(httpd_script_domains, httpd_log_t, httpd_log_t)
  907. kernel_dontaudit_search_sysctl(httpd_script_domains)
  908. kernel_dontaudit_search_kernel_sysctl(httpd_script_domains)
  909. corenet_all_recvfrom_unlabeled(httpd_script_domains)
  910. corenet_all_recvfrom_netlabel(httpd_script_domains)
  911. corenet_tcp_sendrecv_generic_if(httpd_script_domains)
  912. corenet_tcp_sendrecv_generic_node(httpd_script_domains)
  913. corecmd_exec_all_executables(httpd_script_domains)
  914. dev_read_rand(httpd_script_domains)
  915. dev_read_urand(httpd_script_domains)
  916. files_exec_etc_files(httpd_script_domains)
  917. files_read_etc_files(httpd_script_domains)
  918. files_search_home(httpd_script_domains)
  919. libs_exec_ld_so(httpd_script_domains)
  920. libs_exec_lib_files(httpd_script_domains)
  921. logging_search_logs(httpd_script_domains)
  922. miscfiles_read_fonts(httpd_script_domains)
  923. miscfiles_read_public_files(httpd_script_domains)
  924. seutil_dontaudit_search_config(httpd_script_domains)
  925. tunable_policy(`httpd_enable_cgi && httpd_unified',`
  926. allow httpd_script_domains httpdcontent:file entrypoint;
  927. manage_dirs_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  928. manage_files_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  929. manage_lnk_files_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  930. can_exec(httpd_script_domains, httpdcontent)
  931. ')
  932. tunable_policy(`httpd_enable_cgi',`
  933. allow httpd_script_domains self:process { setsched signal_perms };
  934. allow httpd_script_domains self:unix_stream_socket create_stream_socket_perms;
  935. kernel_read_system_state(httpd_script_domains)
  936. fs_getattr_all_fs(httpd_script_domains)
  937. files_read_etc_runtime_files(httpd_script_domains)
  938. files_read_usr_files(httpd_script_domains)
  939. libs_read_lib_files(httpd_script_domains)
  940. miscfiles_read_localization(httpd_script_domains)
  941. ')
  942. optional_policy(`
  943. tunable_policy(`httpd_enable_cgi && allow_ypbind',`
  944. nis_use_ypbind_uncond(httpd_script_domains)
  945. ')
  946. ')
  947. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  948. corenet_sendrecv_gds_db_client_packets(httpd_script_domains)
  949. corenet_tcp_connect_gds_db_port(httpd_script_domains)
  950. corenet_tcp_sendrecv_gds_db_port(httpd_script_domains)
  951. corenet_sendrecv_mssql_client_packets(httpd_script_domains)
  952. corenet_tcp_connect_mssql_port(httpd_script_domains)
  953. corenet_tcp_sendrecv_mssql_port(httpd_script_domains)
  954. corenet_sendrecv_oracledb_client_packets(httpd_script_domains)
  955. corenet_tcp_connect_oracledb_port(httpd_script_domains)
  956. corenet_tcp_sendrecv_oracledb_port(httpd_script_domains)
  957. ')
  958. optional_policy(`
  959. mysql_read_config(httpd_script_domains)
  960. mysql_stream_connect(httpd_script_domains)
  961. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  962. mysql_tcp_connect(httpd_script_domains)
  963. ')
  964. ')
  965. optional_policy(`
  966. postgresql_stream_connect(httpd_script_domains)
  967. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  968. postgresql_tcp_connect(httpd_script_domains)
  969. ')
  970. ')
  971. optional_policy(`
  972. nscd_use(httpd_script_domains)
  973. ')
  974. ########################################
  975. #
  976. # System script local policy
  977. #
  978. allow httpd_sys_script_t self:tcp_socket { accept listen };
  979. allow httpd_sys_script_t self:unix_dgram_socket { create connect connected_socket_perms };
  980. allow httpd_sys_script_t httpd_t:tcp_socket { read write };
  981. allow httpd_sys_script_t httpd_t:unix_stream_socket { read write ioctl };
  982. dontaudit httpd_sys_script_t httpd_config_t:dir search;
  983. allow httpd_sys_script_t httpd_squirrelmail_t:file { append_file_perms read_file_perms };
  984. allow httpd_sys_script_t squirrelmail_spool_t:dir list_dir_perms;
  985. allow httpd_sys_script_t squirrelmail_spool_t:file read_file_perms;
  986. allow httpd_sys_script_t squirrelmail_spool_t:lnk_file read_lnk_file_perms;
  987. kernel_read_kernel_sysctls(httpd_sys_script_t)
  988. dev_read_sysfs(httpd_sys_script_t)
  989. fs_search_auto_mountpoints(httpd_sys_script_t)
  990. files_read_var_symlinks(httpd_sys_script_t)
  991. files_search_var_lib(httpd_sys_script_t)
  992. files_search_spool(httpd_sys_script_t)
  993. apache_domtrans_rotatelogs(httpd_sys_script_t)
  994. auth_use_nsswitch(httpd_sys_script_t)
  995. logging_send_syslog_msg(httpd_sys_script_t)
  996. ifdef(`init_systemd', `
  997. init_search_pid_dirs(httpd_sys_script_t)
  998. ')
  999. tunable_policy(`httpd_can_sendmail',`
  1000. corenet_sendrecv_smtp_client_packets(httpd_sys_script_t)
  1001. corenet_tcp_connect_smtp_port(httpd_sys_script_t)
  1002. corenet_tcp_sendrecv_smtp_port(httpd_sys_script_t)
  1003. corenet_sendrecv_pop_client_packets(httpd_sys_script_t)
  1004. corenet_tcp_connect_pop_port(httpd_sys_script_t)
  1005. corenet_tcp_sendrecv_pop_port(httpd_sys_script_t)
  1006. mta_send_mail(httpd_sys_script_t)
  1007. mta_signal_system_mail(httpd_sys_script_t)
  1008. ')
  1009. tunable_policy(`httpd_enable_homedirs',`
  1010. userdom_search_user_home_dirs(httpd_sys_script_t)
  1011. ')
  1012. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect',`
  1013. corenet_tcp_connect_all_ports(httpd_sys_script_t)
  1014. corenet_sendrecv_all_client_packets(httpd_sys_script_t)
  1015. corenet_tcp_sendrecv_all_ports(httpd_sys_script_t)
  1016. ')
  1017. tunable_policy(`httpd_execmem',`
  1018. allow httpd_sys_script_t self:process { execmem execstack };
  1019. ')
  1020. tunable_policy(`httpd_read_user_content',`
  1021. userdom_read_user_home_content_files(httpd_sys_script_t)
  1022. ')
  1023. tunable_policy(`httpd_use_cifs',`
  1024. fs_list_auto_mountpoints(httpd_sys_script_t)
  1025. fs_manage_cifs_dirs(httpd_sys_script_t)
  1026. fs_manage_cifs_files(httpd_sys_script_t)
  1027. fs_manage_cifs_symlinks(httpd_sys_script_t)
  1028. ')
  1029. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  1030. fs_exec_cifs_files(httpd_sys_script_t)
  1031. ')
  1032. tunable_policy(`httpd_use_fusefs',`
  1033. fs_list_auto_mountpoints(httpd_sys_script_t)
  1034. fs_manage_fusefs_dirs(httpd_sys_script_t)
  1035. fs_manage_fusefs_files(httpd_sys_script_t)
  1036. fs_read_fusefs_symlinks(httpd_sys_script_t)
  1037. ')
  1038. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  1039. fs_exec_fusefs_files(httpd_sys_script_t)
  1040. ')
  1041. tunable_policy(`httpd_use_nfs',`
  1042. fs_list_auto_mountpoints(httpd_sys_script_t)
  1043. rpc_manage_nfs_rw_content(httpd_t)
  1044. rpc_read_nfs_content(httpd_t)
  1045. ')
  1046. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  1047. fs_exec_nfs_files(httpd_sys_script_t)
  1048. ')
  1049. optional_policy(`
  1050. clamav_domtrans_clamscan(httpd_sys_script_t)
  1051. ')
  1052. optional_policy(`
  1053. postgresql_unpriv_client(httpd_sys_script_t)
  1054. ')
  1055. ########################################
  1056. #
  1057. # Rotatelogs local policy
  1058. #
  1059. allow httpd_rotatelogs_t self:capability dac_override;
  1060. manage_files_pattern(httpd_rotatelogs_t, httpd_log_t, httpd_log_t)
  1061. read_lnk_files_pattern(httpd_rotatelogs_t, httpd_log_t, httpd_log_t)
  1062. kernel_read_kernel_sysctls(httpd_rotatelogs_t)
  1063. kernel_dontaudit_list_proc(httpd_rotatelogs_t)
  1064. files_read_etc_files(httpd_rotatelogs_t)
  1065. logging_search_logs(httpd_rotatelogs_t)
  1066. miscfiles_read_localization(httpd_rotatelogs_t)
  1067. ########################################
  1068. #
  1069. # Unconfined script local policy
  1070. #
  1071. optional_policy(`
  1072. apache_content_template(unconfined)
  1073. unconfined_domain(httpd_unconfined_script_t)
  1074. ')
  1075. ########################################
  1076. #
  1077. # User content local policy
  1078. #
  1079. tunable_policy(`httpd_enable_homedirs',`
  1080. userdom_search_user_home_dirs(httpd_user_script_t)
  1081. ')
  1082. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  1083. fs_list_auto_mountpoints(httpd_user_script_t)
  1084. fs_read_cifs_files(httpd_user_script_t)
  1085. fs_read_cifs_symlinks(httpd_user_script_t)
  1086. ')
  1087. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  1088. fs_exec_cifs_files(httpd_user_script_t)
  1089. ')
  1090. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  1091. fs_list_auto_mountpoints(httpd_user_script_t)
  1092. fs_read_nfs_files(httpd_user_script_t)
  1093. fs_read_nfs_symlinks(httpd_user_script_t)
  1094. ')
  1095. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  1096. fs_exec_nfs_files(httpd_user_script_t)
  1097. ')
  1098. tunable_policy(`httpd_read_user_content',`
  1099. userdom_read_user_home_content_files(httpd_user_script_t)
  1100. ')
  1101. optional_policy(`
  1102. postgresql_unpriv_client(httpd_user_script_t)
  1103. ')
  1104. ########################################
  1105. #
  1106. # Passwd local policy
  1107. #
  1108. allow httpd_passwd_t self:fifo_file manage_fifo_file_perms;
  1109. allow httpd_passwd_t self:unix_stream_socket create_stream_socket_perms;
  1110. allow httpd_passwd_t self:unix_dgram_socket create_socket_perms;
  1111. dontaudit httpd_passwd_t httpd_config_t:file read_file_perms;
  1112. kernel_read_system_state(httpd_passwd_t)
  1113. corecmd_exec_bin(httpd_passwd_t)
  1114. corecmd_exec_shell(httpd_passwd_t)
  1115. dev_read_urand(httpd_passwd_t)
  1116. domain_use_interactive_fds(httpd_passwd_t)
  1117. auth_use_nsswitch(httpd_passwd_t)
  1118. miscfiles_read_generic_certs(httpd_passwd_t)
  1119. miscfiles_read_localization(httpd_passwd_t)
  1120. ########################################
  1121. #
  1122. # GPG local policy
  1123. #
  1124. allow httpd_gpg_t self:process setrlimit;
  1125. allow httpd_gpg_t httpd_t:fd use;
  1126. allow httpd_gpg_t httpd_t:fifo_file rw_fifo_file_perms;
  1127. allow httpd_gpg_t httpd_t:process sigchld;
  1128. dev_read_rand(httpd_gpg_t)
  1129. dev_read_urand(httpd_gpg_t)
  1130. files_read_usr_files(httpd_gpg_t)
  1131. miscfiles_read_localization(httpd_gpg_t)
  1132. tunable_policy(`httpd_gpg_anon_write',`
  1133. miscfiles_manage_public_files(httpd_gpg_t)
  1134. ')
  1135. optional_policy(`
  1136. apache_manage_sys_rw_content(httpd_gpg_t)
  1137. ')
  1138. optional_policy(`
  1139. gpg_entry_type(httpd_gpg_t)
  1140. gpg_exec(httpd_gpg_t)
  1141. ')