apache.te 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460
  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. optional_policy(`
  737. gen_require(`
  738. type phpfpm_tmp_t;
  739. ')
  740. allow httpd_t phpfpm_tmp_t:file { read getattr open };
  741. ')
  742. ########################################
  743. #
  744. # Helper local policy
  745. #
  746. read_files_pattern(httpd_helper_t, httpd_config_t, httpd_config_t)
  747. append_files_pattern(httpd_helper_t, httpd_log_t, httpd_log_t)
  748. read_lnk_files_pattern(httpd_helper_t, httpd_log_t, httpd_log_t)
  749. files_search_etc(httpd_helper_t)
  750. logging_search_logs(httpd_helper_t)
  751. logging_send_syslog_msg(httpd_helper_t)
  752. tunable_policy(`httpd_tty_comm',`
  753. userdom_use_user_terminals(httpd_helper_t)
  754. ',`
  755. userdom_dontaudit_use_user_terminals(httpd_helper_t)
  756. ')
  757. ########################################
  758. #
  759. # Suexec local policy
  760. #
  761. allow httpd_suexec_t self:capability { setuid setgid };
  762. allow httpd_suexec_t self:process signal_perms;
  763. allow httpd_suexec_t self:fifo_file rw_fifo_file_perms;
  764. allow httpd_suexec_t self:tcp_socket { accept listen };
  765. allow httpd_suexec_t self:unix_stream_socket { accept listen };
  766. create_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  767. append_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  768. read_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  769. read_lnk_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  770. manage_dirs_pattern(httpd_suexec_t, httpd_suexec_tmp_t, httpd_suexec_tmp_t)
  771. manage_files_pattern(httpd_suexec_t, httpd_suexec_tmp_t, httpd_suexec_tmp_t)
  772. files_tmp_filetrans(httpd_suexec_t, httpd_suexec_tmp_t, { file dir })
  773. kernel_read_kernel_sysctls(httpd_suexec_t)
  774. kernel_list_proc(httpd_suexec_t)
  775. kernel_read_proc_symlinks(httpd_suexec_t)
  776. corenet_all_recvfrom_unlabeled(httpd_suexec_t)
  777. corenet_all_recvfrom_netlabel(httpd_suexec_t)
  778. corenet_tcp_sendrecv_generic_if(httpd_suexec_t)
  779. corenet_tcp_sendrecv_generic_node(httpd_suexec_t)
  780. corecmd_exec_bin(httpd_suexec_t)
  781. corecmd_exec_shell(httpd_suexec_t)
  782. dev_read_urand(httpd_suexec_t)
  783. fs_read_iso9660_files(httpd_suexec_t)
  784. fs_search_auto_mountpoints(httpd_suexec_t)
  785. files_read_usr_files(httpd_suexec_t)
  786. files_dontaudit_search_pids(httpd_suexec_t)
  787. files_search_home(httpd_suexec_t)
  788. auth_use_nsswitch(httpd_suexec_t)
  789. logging_search_logs(httpd_suexec_t)
  790. logging_send_syslog_msg(httpd_suexec_t)
  791. miscfiles_read_localization(httpd_suexec_t)
  792. miscfiles_read_public_files(httpd_suexec_t)
  793. tunable_policy(`httpd_builtin_scripting',`
  794. exec_files_pattern(httpd_suexec_t, httpd_script_exec_type, httpd_script_exec_type)
  795. allow httpd_suexec_t httpdcontent:dir list_dir_perms;
  796. allow httpd_suexec_t httpdcontent:file read_file_perms;
  797. allow httpd_suexec_t httpdcontent:lnk_file read_lnk_file_perms;
  798. ')
  799. tunable_policy(`httpd_can_network_connect',`
  800. corenet_tcp_connect_all_ports(httpd_suexec_t)
  801. corenet_sendrecv_all_client_packets(httpd_suexec_t)
  802. corenet_tcp_sendrecv_all_ports(httpd_suexec_t)
  803. ')
  804. tunable_policy(`httpd_can_network_connect_db',`
  805. corenet_sendrecv_gds_db_client_packets(httpd_suexec_t)
  806. corenet_tcp_connect_gds_db_port(httpd_suexec_t)
  807. corenet_tcp_sendrecv_gds_db_port(httpd_suexec_t)
  808. corenet_sendrecv_mssql_client_packets(httpd_suexec_t)
  809. corenet_tcp_connect_mssql_port(httpd_suexec_t)
  810. corenet_tcp_sendrecv_mssql_port(httpd_suexec_t)
  811. corenet_sendrecv_oracledb_client_packets(httpd_suexec_t)
  812. corenet_tcp_connect_oracledb_port(httpd_suexec_t)
  813. corenet_tcp_sendrecv_oracledb_port(httpd_suexec_t)
  814. ')
  815. tunable_policy(`httpd_can_sendmail',`
  816. corenet_sendrecv_smtp_client_packets(httpd_suexec_t)
  817. corenet_tcp_connect_smtp_port(httpd_suexec_t)
  818. corenet_tcp_sendrecv_smtp_port(httpd_suexec_t)
  819. corenet_sendrecv_pop_client_packets(httpd_suexec_t)
  820. corenet_tcp_connect_pop_port(httpd_suexec_t)
  821. corenet_tcp_sendrecv_pop_port(httpd_suexec_t)
  822. mta_send_mail(httpd_suexec_t)
  823. mta_signal_system_mail(httpd_suexec_t)
  824. ')
  825. tunable_policy(`httpd_enable_cgi && httpd_unified',`
  826. domtrans_pattern(httpd_suexec_t, httpdcontent, httpd_sys_script_t)
  827. ')
  828. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  829. fs_list_auto_mountpoints(httpd_suexec_t)
  830. fs_read_cifs_files(httpd_suexec_t)
  831. fs_read_cifs_symlinks(httpd_suexec_t)
  832. ')
  833. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  834. fs_exec_cifs_files(httpd_suexec_t)
  835. ')
  836. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  837. fs_list_auto_mountpoints(httpd_suexec_t)
  838. fs_read_nfs_files(httpd_suexec_t)
  839. fs_read_nfs_symlinks(httpd_suexec_t)
  840. ')
  841. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  842. fs_exec_nfs_files(httpd_suexec_t)
  843. ')
  844. tunable_policy(`httpd_execmem',`
  845. allow httpd_suexec_t self:process { execmem execstack };
  846. ')
  847. tunable_policy(`httpd_tmp_exec',`
  848. can_exec(httpd_suexec_t, httpd_suexec_tmp_t)
  849. ')
  850. tunable_policy(`httpd_tty_comm',`
  851. userdom_use_user_terminals(httpd_suexec_t)
  852. ',`
  853. userdom_dontaudit_use_user_terminals(httpd_suexec_t)
  854. ')
  855. tunable_policy(`httpd_use_cifs',`
  856. fs_list_auto_mountpoints(httpd_suexec_t)
  857. fs_manage_cifs_dirs(httpd_suexec_t)
  858. fs_manage_cifs_files(httpd_suexec_t)
  859. fs_manage_cifs_symlinks(httpd_suexec_t)
  860. ')
  861. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  862. fs_exec_cifs_files(httpd_suexec_t)
  863. ')
  864. tunable_policy(`httpd_use_fusefs',`
  865. fs_list_auto_mountpoints(httpd_suexec_t)
  866. fs_manage_fusefs_dirs(httpd_suexec_t)
  867. fs_manage_fusefs_files(httpd_suexec_t)
  868. fs_read_fusefs_symlinks(httpd_suexec_t)
  869. ')
  870. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  871. fs_exec_fusefs_files(httpd_suexec_t)
  872. ')
  873. tunable_policy(`httpd_use_nfs',`
  874. fs_list_auto_mountpoints(httpd_suexec_t)
  875. rpc_manage_nfs_rw_content(httpd_t)
  876. rpc_read_nfs_content(httpd_t)
  877. ')
  878. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  879. fs_exec_nfs_files(httpd_suexec_t)
  880. ')
  881. optional_policy(`
  882. mailman_domtrans_cgi(httpd_suexec_t)
  883. ')
  884. optional_policy(`
  885. mysql_stream_connect(httpd_suexec_t)
  886. mysql_read_config(httpd_suexec_t)
  887. tunable_policy(`httpd_can_network_connect_db',`
  888. mysql_tcp_connect(httpd_suexec_t)
  889. ')
  890. ')
  891. optional_policy(`
  892. postgresql_stream_connect(httpd_suexec_t)
  893. postgresql_unpriv_client(httpd_suexec_t)
  894. tunable_policy(`httpd_can_network_connect_db',`
  895. postgresql_tcp_connect(httpd_suexec_t)
  896. ')
  897. ')
  898. tunable_policy(`httpd_read_user_content',`
  899. userdom_read_user_home_content_files(httpd_suexec_t)
  900. ')
  901. tunable_policy(`httpd_enable_homedirs',`
  902. userdom_search_user_home_dirs(httpd_suexec_t)
  903. ')
  904. ########################################
  905. #
  906. # Common script local policy
  907. #
  908. allow httpd_script_domains self:fifo_file rw_file_perms;
  909. allow httpd_script_domains self:unix_stream_socket connectto;
  910. allow httpd_script_domains httpd_sys_content_t:dir search_dir_perms;
  911. append_files_pattern(httpd_script_domains, httpd_log_t, httpd_log_t)
  912. read_lnk_files_pattern(httpd_script_domains, httpd_log_t, httpd_log_t)
  913. kernel_dontaudit_search_sysctl(httpd_script_domains)
  914. kernel_dontaudit_search_kernel_sysctl(httpd_script_domains)
  915. corenet_all_recvfrom_unlabeled(httpd_script_domains)
  916. corenet_all_recvfrom_netlabel(httpd_script_domains)
  917. corenet_tcp_sendrecv_generic_if(httpd_script_domains)
  918. corenet_tcp_sendrecv_generic_node(httpd_script_domains)
  919. corecmd_exec_all_executables(httpd_script_domains)
  920. dev_read_rand(httpd_script_domains)
  921. dev_read_urand(httpd_script_domains)
  922. files_exec_etc_files(httpd_script_domains)
  923. files_read_etc_files(httpd_script_domains)
  924. files_search_home(httpd_script_domains)
  925. libs_exec_ld_so(httpd_script_domains)
  926. libs_exec_lib_files(httpd_script_domains)
  927. logging_search_logs(httpd_script_domains)
  928. miscfiles_read_fonts(httpd_script_domains)
  929. miscfiles_read_public_files(httpd_script_domains)
  930. seutil_dontaudit_search_config(httpd_script_domains)
  931. tunable_policy(`httpd_enable_cgi && httpd_unified',`
  932. allow httpd_script_domains httpdcontent:file entrypoint;
  933. manage_dirs_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  934. manage_files_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  935. manage_lnk_files_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  936. can_exec(httpd_script_domains, httpdcontent)
  937. ')
  938. tunable_policy(`httpd_enable_cgi',`
  939. allow httpd_script_domains self:process { setsched signal_perms };
  940. allow httpd_script_domains self:unix_stream_socket create_stream_socket_perms;
  941. kernel_read_system_state(httpd_script_domains)
  942. fs_getattr_all_fs(httpd_script_domains)
  943. files_read_etc_runtime_files(httpd_script_domains)
  944. files_read_usr_files(httpd_script_domains)
  945. libs_read_lib_files(httpd_script_domains)
  946. miscfiles_read_localization(httpd_script_domains)
  947. ')
  948. optional_policy(`
  949. tunable_policy(`httpd_enable_cgi && allow_ypbind',`
  950. nis_use_ypbind_uncond(httpd_script_domains)
  951. ')
  952. ')
  953. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  954. corenet_sendrecv_gds_db_client_packets(httpd_script_domains)
  955. corenet_tcp_connect_gds_db_port(httpd_script_domains)
  956. corenet_tcp_sendrecv_gds_db_port(httpd_script_domains)
  957. corenet_sendrecv_mssql_client_packets(httpd_script_domains)
  958. corenet_tcp_connect_mssql_port(httpd_script_domains)
  959. corenet_tcp_sendrecv_mssql_port(httpd_script_domains)
  960. corenet_sendrecv_oracledb_client_packets(httpd_script_domains)
  961. corenet_tcp_connect_oracledb_port(httpd_script_domains)
  962. corenet_tcp_sendrecv_oracledb_port(httpd_script_domains)
  963. ')
  964. optional_policy(`
  965. mysql_read_config(httpd_script_domains)
  966. mysql_stream_connect(httpd_script_domains)
  967. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  968. mysql_tcp_connect(httpd_script_domains)
  969. ')
  970. ')
  971. optional_policy(`
  972. postgresql_stream_connect(httpd_script_domains)
  973. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  974. postgresql_tcp_connect(httpd_script_domains)
  975. ')
  976. ')
  977. optional_policy(`
  978. nscd_use(httpd_script_domains)
  979. ')
  980. ########################################
  981. #
  982. # System script local policy
  983. #
  984. allow httpd_sys_script_t self:tcp_socket { accept listen };
  985. allow httpd_sys_script_t self:unix_dgram_socket { create connect connected_socket_perms };
  986. allow httpd_sys_script_t httpd_t:tcp_socket { read write };
  987. allow httpd_sys_script_t httpd_t:unix_stream_socket { read write ioctl };
  988. dontaudit httpd_sys_script_t httpd_config_t:dir search;
  989. allow httpd_sys_script_t httpd_squirrelmail_t:file { append_file_perms read_file_perms };
  990. allow httpd_sys_script_t squirrelmail_spool_t:dir list_dir_perms;
  991. allow httpd_sys_script_t squirrelmail_spool_t:file read_file_perms;
  992. allow httpd_sys_script_t squirrelmail_spool_t:lnk_file read_lnk_file_perms;
  993. kernel_read_kernel_sysctls(httpd_sys_script_t)
  994. dev_read_sysfs(httpd_sys_script_t)
  995. fs_search_auto_mountpoints(httpd_sys_script_t)
  996. files_read_var_symlinks(httpd_sys_script_t)
  997. files_search_var_lib(httpd_sys_script_t)
  998. files_search_spool(httpd_sys_script_t)
  999. apache_domtrans_rotatelogs(httpd_sys_script_t)
  1000. auth_use_nsswitch(httpd_sys_script_t)
  1001. logging_send_syslog_msg(httpd_sys_script_t)
  1002. ifdef(`init_systemd', `
  1003. init_search_pid_dirs(httpd_sys_script_t)
  1004. ')
  1005. tunable_policy(`httpd_can_sendmail',`
  1006. corenet_sendrecv_smtp_client_packets(httpd_sys_script_t)
  1007. corenet_tcp_connect_smtp_port(httpd_sys_script_t)
  1008. corenet_tcp_sendrecv_smtp_port(httpd_sys_script_t)
  1009. corenet_sendrecv_pop_client_packets(httpd_sys_script_t)
  1010. corenet_tcp_connect_pop_port(httpd_sys_script_t)
  1011. corenet_tcp_sendrecv_pop_port(httpd_sys_script_t)
  1012. mta_send_mail(httpd_sys_script_t)
  1013. mta_signal_system_mail(httpd_sys_script_t)
  1014. ')
  1015. tunable_policy(`httpd_enable_homedirs',`
  1016. userdom_search_user_home_dirs(httpd_sys_script_t)
  1017. ')
  1018. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect',`
  1019. corenet_tcp_connect_all_ports(httpd_sys_script_t)
  1020. corenet_sendrecv_all_client_packets(httpd_sys_script_t)
  1021. corenet_tcp_sendrecv_all_ports(httpd_sys_script_t)
  1022. ')
  1023. tunable_policy(`httpd_execmem',`
  1024. allow httpd_sys_script_t self:process { execmem execstack };
  1025. ')
  1026. tunable_policy(`httpd_read_user_content',`
  1027. userdom_read_user_home_content_files(httpd_sys_script_t)
  1028. ')
  1029. tunable_policy(`httpd_use_cifs',`
  1030. fs_list_auto_mountpoints(httpd_sys_script_t)
  1031. fs_manage_cifs_dirs(httpd_sys_script_t)
  1032. fs_manage_cifs_files(httpd_sys_script_t)
  1033. fs_manage_cifs_symlinks(httpd_sys_script_t)
  1034. ')
  1035. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  1036. fs_exec_cifs_files(httpd_sys_script_t)
  1037. ')
  1038. tunable_policy(`httpd_use_fusefs',`
  1039. fs_list_auto_mountpoints(httpd_sys_script_t)
  1040. fs_manage_fusefs_dirs(httpd_sys_script_t)
  1041. fs_manage_fusefs_files(httpd_sys_script_t)
  1042. fs_read_fusefs_symlinks(httpd_sys_script_t)
  1043. ')
  1044. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  1045. fs_exec_fusefs_files(httpd_sys_script_t)
  1046. ')
  1047. tunable_policy(`httpd_use_nfs',`
  1048. fs_list_auto_mountpoints(httpd_sys_script_t)
  1049. rpc_manage_nfs_rw_content(httpd_t)
  1050. rpc_read_nfs_content(httpd_t)
  1051. ')
  1052. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  1053. fs_exec_nfs_files(httpd_sys_script_t)
  1054. ')
  1055. optional_policy(`
  1056. clamav_domtrans_clamscan(httpd_sys_script_t)
  1057. ')
  1058. optional_policy(`
  1059. postgresql_unpriv_client(httpd_sys_script_t)
  1060. ')
  1061. ########################################
  1062. #
  1063. # Rotatelogs local policy
  1064. #
  1065. allow httpd_rotatelogs_t self:capability dac_override;
  1066. manage_files_pattern(httpd_rotatelogs_t, httpd_log_t, httpd_log_t)
  1067. read_lnk_files_pattern(httpd_rotatelogs_t, httpd_log_t, httpd_log_t)
  1068. kernel_read_kernel_sysctls(httpd_rotatelogs_t)
  1069. kernel_dontaudit_list_proc(httpd_rotatelogs_t)
  1070. files_read_etc_files(httpd_rotatelogs_t)
  1071. logging_search_logs(httpd_rotatelogs_t)
  1072. miscfiles_read_localization(httpd_rotatelogs_t)
  1073. ########################################
  1074. #
  1075. # Unconfined script local policy
  1076. #
  1077. optional_policy(`
  1078. apache_content_template(unconfined)
  1079. unconfined_domain(httpd_unconfined_script_t)
  1080. ')
  1081. ########################################
  1082. #
  1083. # User content local policy
  1084. #
  1085. tunable_policy(`httpd_enable_homedirs',`
  1086. userdom_search_user_home_dirs(httpd_user_script_t)
  1087. ')
  1088. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  1089. fs_list_auto_mountpoints(httpd_user_script_t)
  1090. fs_read_cifs_files(httpd_user_script_t)
  1091. fs_read_cifs_symlinks(httpd_user_script_t)
  1092. ')
  1093. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  1094. fs_exec_cifs_files(httpd_user_script_t)
  1095. ')
  1096. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  1097. fs_list_auto_mountpoints(httpd_user_script_t)
  1098. fs_read_nfs_files(httpd_user_script_t)
  1099. fs_read_nfs_symlinks(httpd_user_script_t)
  1100. ')
  1101. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  1102. fs_exec_nfs_files(httpd_user_script_t)
  1103. ')
  1104. tunable_policy(`httpd_read_user_content',`
  1105. userdom_read_user_home_content_files(httpd_user_script_t)
  1106. ')
  1107. optional_policy(`
  1108. postgresql_unpriv_client(httpd_user_script_t)
  1109. ')
  1110. ########################################
  1111. #
  1112. # Passwd local policy
  1113. #
  1114. allow httpd_passwd_t self:fifo_file manage_fifo_file_perms;
  1115. allow httpd_passwd_t self:unix_stream_socket create_stream_socket_perms;
  1116. allow httpd_passwd_t self:unix_dgram_socket create_socket_perms;
  1117. dontaudit httpd_passwd_t httpd_config_t:file read_file_perms;
  1118. kernel_read_system_state(httpd_passwd_t)
  1119. corecmd_exec_bin(httpd_passwd_t)
  1120. corecmd_exec_shell(httpd_passwd_t)
  1121. dev_read_urand(httpd_passwd_t)
  1122. domain_use_interactive_fds(httpd_passwd_t)
  1123. auth_use_nsswitch(httpd_passwd_t)
  1124. miscfiles_read_generic_certs(httpd_passwd_t)
  1125. miscfiles_read_localization(httpd_passwd_t)
  1126. ########################################
  1127. #
  1128. # GPG local policy
  1129. #
  1130. allow httpd_gpg_t self:process setrlimit;
  1131. allow httpd_gpg_t httpd_t:fd use;
  1132. allow httpd_gpg_t httpd_t:fifo_file rw_fifo_file_perms;
  1133. allow httpd_gpg_t httpd_t:process sigchld;
  1134. dev_read_rand(httpd_gpg_t)
  1135. dev_read_urand(httpd_gpg_t)
  1136. files_read_usr_files(httpd_gpg_t)
  1137. miscfiles_read_localization(httpd_gpg_t)
  1138. tunable_policy(`httpd_gpg_anon_write',`
  1139. miscfiles_manage_public_files(httpd_gpg_t)
  1140. ')
  1141. optional_policy(`
  1142. apache_manage_sys_rw_content(httpd_gpg_t)
  1143. ')
  1144. optional_policy(`
  1145. gpg_entry_type(httpd_gpg_t)
  1146. gpg_exec(httpd_gpg_t)
  1147. ')