apache.te 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451
  1. policy_module(apache, 2.11.3)
  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. ifdef(`init_systemd', `
  439. systemd_manage_passwd_run(httpd_t)
  440. ')
  441. ifdef(`TODO',`
  442. tunable_policy(`allow_httpd_mod_auth_pam',`
  443. auth_domtrans_chk_passwd(httpd_t)
  444. logging_send_audit_msgs(httpd_t)
  445. ')
  446. ')
  447. ifdef(`hide_broken_symptoms',`
  448. libs_exec_lib_files(httpd_t)
  449. ')
  450. tunable_policy(`allow_httpd_anon_write',`
  451. miscfiles_manage_public_files(httpd_t)
  452. ')
  453. tunable_policy(`httpd_can_network_connect',`
  454. corenet_sendrecv_all_client_packets(httpd_t)
  455. corenet_tcp_connect_all_ports(httpd_t)
  456. corenet_tcp_sendrecv_all_ports(httpd_t)
  457. ')
  458. tunable_policy(`httpd_can_network_connect_db',`
  459. corenet_sendrecv_gds_db_client_packets(httpd_t)
  460. corenet_tcp_connect_gds_db_port(httpd_t)
  461. corenet_tcp_sendrecv_gds_db_port(httpd_t)
  462. corenet_sendrecv_mssql_client_packets(httpd_t)
  463. corenet_tcp_connect_mssql_port(httpd_t)
  464. corenet_tcp_sendrecv_mssql_port(httpd_t)
  465. corenet_sendrecv_oracledb_client_packets(httpd_t)
  466. corenet_tcp_connect_oracledb_port(httpd_t)
  467. corenet_tcp_sendrecv_oracledb_port(httpd_t)
  468. ')
  469. tunable_policy(`httpd_can_network_relay',`
  470. corenet_sendrecv_gopher_client_packets(httpd_t)
  471. corenet_tcp_connect_gopher_port(httpd_t)
  472. corenet_tcp_sendrecv_gopher_port(httpd_t)
  473. corenet_sendrecv_ftp_client_packets(httpd_t)
  474. corenet_tcp_connect_ftp_port(httpd_t)
  475. corenet_tcp_sendrecv_ftp_port(httpd_t)
  476. corenet_sendrecv_http_client_packets(httpd_t)
  477. corenet_tcp_connect_http_port(httpd_t)
  478. corenet_tcp_sendrecv_http_port(httpd_t)
  479. corenet_sendrecv_http_cache_client_packets(httpd_t)
  480. corenet_tcp_connect_http_cache_port(httpd_t)
  481. corenet_tcp_sendrecv_http_cache_port(httpd_t)
  482. corenet_sendrecv_squid_client_packets(httpd_t)
  483. corenet_tcp_connect_squid_port(httpd_t)
  484. corenet_tcp_sendrecv_squid_port(httpd_t)
  485. ')
  486. tunable_policy(`httpd_builtin_scripting',`
  487. exec_files_pattern(httpd_t, httpd_script_exec_type, httpd_script_exec_type)
  488. allow httpd_t httpdcontent:dir list_dir_perms;
  489. allow httpd_t httpdcontent:file read_file_perms;
  490. allow httpd_t httpdcontent:lnk_file read_lnk_file_perms;
  491. ')
  492. tunable_policy(`httpd_enable_cgi',`
  493. allow httpd_t httpd_script_domains:process { signal sigkill sigstop };
  494. allow httpd_t httpd_script_exec_type:dir list_dir_perms;
  495. allow httpd_t httpd_script_exec_type:lnk_file read_lnk_file_perms;
  496. ')
  497. tunable_policy(`httpd_enable_cgi && httpd_use_nfs',`
  498. fs_nfs_domtrans(httpd_t, httpd_sys_script_t)
  499. ')
  500. tunable_policy(`httpd_enable_cgi && httpd_use_cifs',`
  501. fs_cifs_domtrans(httpd_t, httpd_sys_script_t)
  502. ')
  503. # tunable_policy(`httpd_enable_cgi && httpd_use_fusefs',`
  504. # fs_fusefs_domtrans(httpd_t, httpd_sys_script_t)
  505. # ')
  506. tunable_policy(`httpd_enable_cgi && httpd_unified && httpd_builtin_scripting',`
  507. domtrans_pattern(httpd_t, httpdcontent, httpd_sys_script_t)
  508. manage_dirs_pattern(httpd_t, httpdcontent, httpdcontent)
  509. manage_files_pattern(httpd_t, httpdcontent, httpdcontent)
  510. manage_fifo_files_pattern(httpd_t, httpdcontent, httpdcontent)
  511. manage_lnk_files_pattern(httpd_t, httpdcontent, httpdcontent)
  512. manage_sock_files_pattern(httpd_t, httpdcontent, httpdcontent)
  513. ')
  514. tunable_policy(`httpd_enable_ftp_server',`
  515. corenet_sendrecv_ftp_server_packets(httpd_t)
  516. corenet_tcp_bind_ftp_port(httpd_t)
  517. corenet_tcp_sendrecv_ftp_port(httpd_t)
  518. ')
  519. tunable_policy(`httpd_enable_homedirs',`
  520. userdom_search_user_home_dirs(httpd_t)
  521. ')
  522. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  523. fs_list_auto_mountpoints(httpd_t)
  524. fs_read_nfs_files(httpd_t)
  525. fs_read_nfs_symlinks(httpd_t)
  526. ')
  527. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  528. fs_exec_nfs_files(httpd_t)
  529. ')
  530. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  531. fs_list_auto_mountpoints(httpd_t)
  532. fs_read_cifs_files(httpd_t)
  533. fs_read_cifs_symlinks(httpd_t)
  534. ')
  535. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  536. fs_exec_cifs_files(httpd_t)
  537. ')
  538. tunable_policy(`httpd_execmem',`
  539. allow httpd_t self:process { execmem execstack };
  540. ')
  541. tunable_policy(`httpd_can_sendmail',`
  542. corenet_sendrecv_smtp_client_packets(httpd_t)
  543. corenet_tcp_connect_smtp_port(httpd_t)
  544. corenet_tcp_sendrecv_smtp_port(httpd_t)
  545. corenet_sendrecv_pop_client_packets(httpd_t)
  546. corenet_tcp_connect_pop_port(httpd_t)
  547. corenet_tcp_sendrecv_pop_port(httpd_t)
  548. mta_send_mail(httpd_t)
  549. mta_signal_system_mail(httpd_t)
  550. ')
  551. optional_policy(`
  552. tunable_policy(`httpd_can_network_connect_zabbix',`
  553. zabbix_tcp_connect(httpd_t)
  554. ')
  555. ')
  556. optional_policy(`
  557. tunable_policy(`httpd_can_sendmail && httpd_can_check_spam',`
  558. spamassassin_domtrans_client(httpd_t)
  559. ')
  560. ')
  561. tunable_policy(`httpd_graceful_shutdown',`
  562. corenet_sendrecv_http_client_packets(httpd_t)
  563. corenet_tcp_connect_http_port(httpd_t)
  564. corenet_tcp_sendrecv_http_port(httpd_t)
  565. ')
  566. optional_policy(`
  567. tunable_policy(`httpd_enable_cgi && httpd_use_gpg',`
  568. gpg_spec_domtrans(httpd_t, httpd_gpg_t)
  569. ')
  570. ')
  571. optional_policy(`
  572. tunable_policy(`httpd_mod_auth_ntlm_winbind',`
  573. samba_domtrans_winbind_helper(httpd_t)
  574. ')
  575. ')
  576. tunable_policy(`httpd_read_user_content',`
  577. userdom_read_user_home_content_files(httpd_t)
  578. ')
  579. tunable_policy(`httpd_setrlimit',`
  580. allow httpd_t self:process setrlimit;
  581. allow httpd_t self:capability sys_resource;
  582. ')
  583. tunable_policy(`httpd_ssi_exec',`
  584. corecmd_shell_domtrans(httpd_t, httpd_sys_script_t)
  585. ')
  586. tunable_policy(`httpd_tmp_exec && httpd_builtin_scripting',`
  587. can_exec(httpd_t, httpd_tmp_t)
  588. ')
  589. tunable_policy(`httpd_tty_comm',`
  590. userdom_use_user_terminals(httpd_t)
  591. ',`
  592. userdom_dontaudit_use_user_terminals(httpd_t)
  593. ')
  594. tunable_policy(`httpd_use_cifs',`
  595. fs_list_auto_mountpoints(httpd_t)
  596. fs_manage_cifs_dirs(httpd_t)
  597. fs_manage_cifs_files(httpd_t)
  598. fs_manage_cifs_symlinks(httpd_t)
  599. ')
  600. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  601. fs_exec_cifs_files(httpd_t)
  602. ')
  603. tunable_policy(`httpd_use_fusefs',`
  604. fs_list_auto_mountpoints(httpd_t)
  605. fs_manage_fusefs_dirs(httpd_t)
  606. fs_manage_fusefs_files(httpd_t)
  607. fs_read_fusefs_symlinks(httpd_t)
  608. ')
  609. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  610. fs_exec_fusefs_files(httpd_t)
  611. ')
  612. tunable_policy(`httpd_use_nfs',`
  613. fs_list_auto_mountpoints(httpd_t)
  614. rpc_manage_nfs_rw_content(httpd_t)
  615. rpc_read_nfs_content(httpd_t)
  616. ')
  617. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  618. fs_exec_nfs_files(httpd_t)
  619. ')
  620. optional_policy(`
  621. calamaris_read_www_files(httpd_t)
  622. ')
  623. optional_policy(`
  624. ccs_read_config(httpd_t)
  625. ')
  626. optional_policy(`
  627. clamav_domtrans_clamscan(httpd_t)
  628. ')
  629. optional_policy(`
  630. cobbler_read_config(httpd_t)
  631. cobbler_read_lib_files(httpd_t)
  632. ')
  633. optional_policy(`
  634. cron_system_entry(httpd_t, httpd_exec_t)
  635. ')
  636. optional_policy(`
  637. cvs_read_data(httpd_t)
  638. ')
  639. optional_policy(`
  640. daemontools_service_domain(httpd_t, httpd_exec_t)
  641. ')
  642. optional_policy(`
  643. dbus_system_bus_client(httpd_t)
  644. tunable_policy(`httpd_dbus_avahi',`
  645. avahi_dbus_chat(httpd_t)
  646. ')
  647. ')
  648. optional_policy(`
  649. git_read_generic_sys_content_files(httpd_t)
  650. ')
  651. optional_policy(`
  652. gitosis_read_lib_files(httpd_t)
  653. ')
  654. optional_policy(`
  655. kerberos_manage_host_rcache(httpd_t)
  656. kerberos_read_keytab(httpd_t)
  657. kerberos_tmp_filetrans_host_rcache(httpd_t, file, "HTTP_23")
  658. kerberos_tmp_filetrans_host_rcache(httpd_t, file, "HTTP_48")
  659. kerberos_use(httpd_t)
  660. ')
  661. optional_policy(`
  662. ldap_stream_connect(httpd_t)
  663. tunable_policy(`httpd_can_network_connect_ldap',`
  664. ldap_tcp_connect(httpd_t)
  665. ')
  666. ')
  667. optional_policy(`
  668. mailman_signal_cgi(httpd_t)
  669. mailman_domtrans_cgi(httpd_t)
  670. mailman_read_data_files(httpd_t)
  671. mailman_search_data(httpd_t)
  672. mailman_read_archive(httpd_t)
  673. ')
  674. optional_policy(`
  675. memcached_stream_connect(httpd_t)
  676. tunable_policy(`httpd_can_network_connect_memcache',`
  677. memcached_tcp_connect(httpd_t)
  678. ')
  679. tunable_policy(`httpd_manage_ipa',`
  680. memcached_manage_pid_files(httpd_t)
  681. ')
  682. ')
  683. optional_policy(`
  684. mysql_read_config(httpd_t)
  685. mysql_stream_connect(httpd_t)
  686. tunable_policy(`httpd_can_network_connect_db',`
  687. mysql_tcp_connect(httpd_t)
  688. ')
  689. ')
  690. optional_policy(`
  691. nagios_read_config(httpd_t)
  692. ')
  693. optional_policy(`
  694. openca_domtrans(httpd_t)
  695. openca_signal(httpd_t)
  696. openca_sigstop(httpd_t)
  697. openca_kill(httpd_t)
  698. ')
  699. optional_policy(`
  700. pcscd_read_pid_files(httpd_t)
  701. ')
  702. optional_policy(`
  703. postgresql_stream_connect(httpd_t)
  704. postgresql_unpriv_client(httpd_t)
  705. tunable_policy(`httpd_can_network_connect_db',`
  706. postgresql_tcp_connect(httpd_t)
  707. ')
  708. ')
  709. optional_policy(`
  710. puppet_read_lib_files(httpd_t)
  711. ')
  712. optional_policy(`
  713. rpc_search_nfs_state_data(httpd_t)
  714. ')
  715. optional_policy(`
  716. seutil_sigchld_newrole(httpd_t)
  717. ')
  718. optional_policy(`
  719. shibboleth_read_config(httpd_t)
  720. shibboleth_stream_connect(httpd_t)
  721. ')
  722. optional_policy(`
  723. smokeping_read_lib_files(httpd_t)
  724. ')
  725. optional_policy(`
  726. snmp_dontaudit_read_snmp_var_lib_files(httpd_t)
  727. snmp_dontaudit_write_snmp_var_lib_files(httpd_t)
  728. ')
  729. optional_policy(`
  730. udev_read_db(httpd_t)
  731. ')
  732. optional_policy(`
  733. yam_read_content(httpd_t)
  734. ')
  735. ########################################
  736. #
  737. # Helper local policy
  738. #
  739. read_files_pattern(httpd_helper_t, httpd_config_t, httpd_config_t)
  740. append_files_pattern(httpd_helper_t, httpd_log_t, httpd_log_t)
  741. read_lnk_files_pattern(httpd_helper_t, httpd_log_t, httpd_log_t)
  742. files_search_etc(httpd_helper_t)
  743. logging_search_logs(httpd_helper_t)
  744. logging_send_syslog_msg(httpd_helper_t)
  745. tunable_policy(`httpd_tty_comm',`
  746. userdom_use_user_terminals(httpd_helper_t)
  747. ',`
  748. userdom_dontaudit_use_user_terminals(httpd_helper_t)
  749. ')
  750. ########################################
  751. #
  752. # Suexec local policy
  753. #
  754. allow httpd_suexec_t self:capability { setuid setgid };
  755. allow httpd_suexec_t self:process signal_perms;
  756. allow httpd_suexec_t self:fifo_file rw_fifo_file_perms;
  757. allow httpd_suexec_t self:tcp_socket { accept listen };
  758. allow httpd_suexec_t self:unix_stream_socket { accept listen };
  759. create_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  760. append_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  761. read_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  762. read_lnk_files_pattern(httpd_suexec_t, httpd_log_t, httpd_log_t)
  763. manage_dirs_pattern(httpd_suexec_t, httpd_suexec_tmp_t, httpd_suexec_tmp_t)
  764. manage_files_pattern(httpd_suexec_t, httpd_suexec_tmp_t, httpd_suexec_tmp_t)
  765. files_tmp_filetrans(httpd_suexec_t, httpd_suexec_tmp_t, { file dir })
  766. kernel_read_kernel_sysctls(httpd_suexec_t)
  767. kernel_list_proc(httpd_suexec_t)
  768. kernel_read_proc_symlinks(httpd_suexec_t)
  769. corenet_all_recvfrom_unlabeled(httpd_suexec_t)
  770. corenet_all_recvfrom_netlabel(httpd_suexec_t)
  771. corenet_tcp_sendrecv_generic_if(httpd_suexec_t)
  772. corenet_tcp_sendrecv_generic_node(httpd_suexec_t)
  773. corecmd_exec_bin(httpd_suexec_t)
  774. corecmd_exec_shell(httpd_suexec_t)
  775. dev_read_urand(httpd_suexec_t)
  776. fs_read_iso9660_files(httpd_suexec_t)
  777. fs_search_auto_mountpoints(httpd_suexec_t)
  778. files_read_usr_files(httpd_suexec_t)
  779. files_dontaudit_search_pids(httpd_suexec_t)
  780. files_search_home(httpd_suexec_t)
  781. auth_use_nsswitch(httpd_suexec_t)
  782. logging_search_logs(httpd_suexec_t)
  783. logging_send_syslog_msg(httpd_suexec_t)
  784. miscfiles_read_localization(httpd_suexec_t)
  785. miscfiles_read_public_files(httpd_suexec_t)
  786. tunable_policy(`httpd_builtin_scripting',`
  787. exec_files_pattern(httpd_suexec_t, httpd_script_exec_type, httpd_script_exec_type)
  788. allow httpd_suexec_t httpdcontent:dir list_dir_perms;
  789. allow httpd_suexec_t httpdcontent:file read_file_perms;
  790. allow httpd_suexec_t httpdcontent:lnk_file read_lnk_file_perms;
  791. ')
  792. tunable_policy(`httpd_can_network_connect',`
  793. corenet_tcp_connect_all_ports(httpd_suexec_t)
  794. corenet_sendrecv_all_client_packets(httpd_suexec_t)
  795. corenet_tcp_sendrecv_all_ports(httpd_suexec_t)
  796. ')
  797. tunable_policy(`httpd_can_network_connect_db',`
  798. corenet_sendrecv_gds_db_client_packets(httpd_suexec_t)
  799. corenet_tcp_connect_gds_db_port(httpd_suexec_t)
  800. corenet_tcp_sendrecv_gds_db_port(httpd_suexec_t)
  801. corenet_sendrecv_mssql_client_packets(httpd_suexec_t)
  802. corenet_tcp_connect_mssql_port(httpd_suexec_t)
  803. corenet_tcp_sendrecv_mssql_port(httpd_suexec_t)
  804. corenet_sendrecv_oracledb_client_packets(httpd_suexec_t)
  805. corenet_tcp_connect_oracledb_port(httpd_suexec_t)
  806. corenet_tcp_sendrecv_oracledb_port(httpd_suexec_t)
  807. ')
  808. tunable_policy(`httpd_can_sendmail',`
  809. corenet_sendrecv_smtp_client_packets(httpd_suexec_t)
  810. corenet_tcp_connect_smtp_port(httpd_suexec_t)
  811. corenet_tcp_sendrecv_smtp_port(httpd_suexec_t)
  812. corenet_sendrecv_pop_client_packets(httpd_suexec_t)
  813. corenet_tcp_connect_pop_port(httpd_suexec_t)
  814. corenet_tcp_sendrecv_pop_port(httpd_suexec_t)
  815. mta_send_mail(httpd_suexec_t)
  816. mta_signal_system_mail(httpd_suexec_t)
  817. ')
  818. tunable_policy(`httpd_enable_cgi && httpd_unified',`
  819. domtrans_pattern(httpd_suexec_t, httpdcontent, httpd_sys_script_t)
  820. ')
  821. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  822. fs_list_auto_mountpoints(httpd_suexec_t)
  823. fs_read_cifs_files(httpd_suexec_t)
  824. fs_read_cifs_symlinks(httpd_suexec_t)
  825. ')
  826. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  827. fs_exec_cifs_files(httpd_suexec_t)
  828. ')
  829. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  830. fs_list_auto_mountpoints(httpd_suexec_t)
  831. fs_read_nfs_files(httpd_suexec_t)
  832. fs_read_nfs_symlinks(httpd_suexec_t)
  833. ')
  834. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  835. fs_exec_nfs_files(httpd_suexec_t)
  836. ')
  837. tunable_policy(`httpd_execmem',`
  838. allow httpd_suexec_t self:process { execmem execstack };
  839. ')
  840. tunable_policy(`httpd_tmp_exec',`
  841. can_exec(httpd_suexec_t, httpd_suexec_tmp_t)
  842. ')
  843. tunable_policy(`httpd_tty_comm',`
  844. userdom_use_user_terminals(httpd_suexec_t)
  845. ',`
  846. userdom_dontaudit_use_user_terminals(httpd_suexec_t)
  847. ')
  848. tunable_policy(`httpd_use_cifs',`
  849. fs_list_auto_mountpoints(httpd_suexec_t)
  850. fs_manage_cifs_dirs(httpd_suexec_t)
  851. fs_manage_cifs_files(httpd_suexec_t)
  852. fs_manage_cifs_symlinks(httpd_suexec_t)
  853. ')
  854. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  855. fs_exec_cifs_files(httpd_suexec_t)
  856. ')
  857. tunable_policy(`httpd_use_fusefs',`
  858. fs_list_auto_mountpoints(httpd_suexec_t)
  859. fs_manage_fusefs_dirs(httpd_suexec_t)
  860. fs_manage_fusefs_files(httpd_suexec_t)
  861. fs_read_fusefs_symlinks(httpd_suexec_t)
  862. ')
  863. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  864. fs_exec_fusefs_files(httpd_suexec_t)
  865. ')
  866. tunable_policy(`httpd_use_nfs',`
  867. fs_list_auto_mountpoints(httpd_suexec_t)
  868. rpc_manage_nfs_rw_content(httpd_t)
  869. rpc_read_nfs_content(httpd_t)
  870. ')
  871. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  872. fs_exec_nfs_files(httpd_suexec_t)
  873. ')
  874. optional_policy(`
  875. mailman_domtrans_cgi(httpd_suexec_t)
  876. ')
  877. optional_policy(`
  878. mysql_stream_connect(httpd_suexec_t)
  879. mysql_read_config(httpd_suexec_t)
  880. tunable_policy(`httpd_can_network_connect_db',`
  881. mysql_tcp_connect(httpd_suexec_t)
  882. ')
  883. ')
  884. optional_policy(`
  885. postgresql_stream_connect(httpd_suexec_t)
  886. postgresql_unpriv_client(httpd_suexec_t)
  887. tunable_policy(`httpd_can_network_connect_db',`
  888. postgresql_tcp_connect(httpd_suexec_t)
  889. ')
  890. ')
  891. tunable_policy(`httpd_read_user_content',`
  892. userdom_read_user_home_content_files(httpd_suexec_t)
  893. ')
  894. tunable_policy(`httpd_enable_homedirs',`
  895. userdom_search_user_home_dirs(httpd_suexec_t)
  896. ')
  897. ########################################
  898. #
  899. # Common script local policy
  900. #
  901. allow httpd_script_domains self:fifo_file rw_file_perms;
  902. allow httpd_script_domains self:unix_stream_socket connectto;
  903. allow httpd_script_domains httpd_sys_content_t:dir search_dir_perms;
  904. append_files_pattern(httpd_script_domains, httpd_log_t, httpd_log_t)
  905. read_lnk_files_pattern(httpd_script_domains, httpd_log_t, httpd_log_t)
  906. kernel_dontaudit_search_sysctl(httpd_script_domains)
  907. kernel_dontaudit_search_kernel_sysctl(httpd_script_domains)
  908. corenet_all_recvfrom_unlabeled(httpd_script_domains)
  909. corenet_all_recvfrom_netlabel(httpd_script_domains)
  910. corenet_tcp_sendrecv_generic_if(httpd_script_domains)
  911. corenet_tcp_sendrecv_generic_node(httpd_script_domains)
  912. corecmd_exec_all_executables(httpd_script_domains)
  913. dev_read_rand(httpd_script_domains)
  914. dev_read_urand(httpd_script_domains)
  915. files_exec_etc_files(httpd_script_domains)
  916. files_read_etc_files(httpd_script_domains)
  917. files_search_home(httpd_script_domains)
  918. libs_exec_ld_so(httpd_script_domains)
  919. libs_exec_lib_files(httpd_script_domains)
  920. logging_search_logs(httpd_script_domains)
  921. miscfiles_read_fonts(httpd_script_domains)
  922. miscfiles_read_public_files(httpd_script_domains)
  923. seutil_dontaudit_search_config(httpd_script_domains)
  924. tunable_policy(`httpd_enable_cgi && httpd_unified',`
  925. allow httpd_script_domains httpdcontent:file entrypoint;
  926. manage_dirs_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  927. manage_files_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  928. manage_lnk_files_pattern(httpd_script_domains, httpdcontent, httpdcontent)
  929. can_exec(httpd_script_domains, httpdcontent)
  930. ')
  931. tunable_policy(`httpd_enable_cgi',`
  932. allow httpd_script_domains self:process { setsched signal_perms };
  933. allow httpd_script_domains self:unix_stream_socket create_stream_socket_perms;
  934. kernel_read_system_state(httpd_script_domains)
  935. fs_getattr_all_fs(httpd_script_domains)
  936. files_read_etc_runtime_files(httpd_script_domains)
  937. files_read_usr_files(httpd_script_domains)
  938. libs_read_lib_files(httpd_script_domains)
  939. miscfiles_read_localization(httpd_script_domains)
  940. ')
  941. optional_policy(`
  942. tunable_policy(`httpd_enable_cgi && allow_ypbind',`
  943. nis_use_ypbind_uncond(httpd_script_domains)
  944. ')
  945. ')
  946. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  947. corenet_sendrecv_gds_db_client_packets(httpd_script_domains)
  948. corenet_tcp_connect_gds_db_port(httpd_script_domains)
  949. corenet_tcp_sendrecv_gds_db_port(httpd_script_domains)
  950. corenet_sendrecv_mssql_client_packets(httpd_script_domains)
  951. corenet_tcp_connect_mssql_port(httpd_script_domains)
  952. corenet_tcp_sendrecv_mssql_port(httpd_script_domains)
  953. corenet_sendrecv_oracledb_client_packets(httpd_script_domains)
  954. corenet_tcp_connect_oracledb_port(httpd_script_domains)
  955. corenet_tcp_sendrecv_oracledb_port(httpd_script_domains)
  956. ')
  957. optional_policy(`
  958. mysql_read_config(httpd_script_domains)
  959. mysql_stream_connect(httpd_script_domains)
  960. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  961. mysql_tcp_connect(httpd_script_domains)
  962. ')
  963. ')
  964. optional_policy(`
  965. postgresql_stream_connect(httpd_script_domains)
  966. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect_db',`
  967. postgresql_tcp_connect(httpd_script_domains)
  968. ')
  969. ')
  970. optional_policy(`
  971. nscd_use(httpd_script_domains)
  972. ')
  973. ########################################
  974. #
  975. # System script local policy
  976. #
  977. allow httpd_sys_script_t self:tcp_socket { accept listen };
  978. allow httpd_sys_script_t self:unix_dgram_socket { create connect connected_socket_perms };
  979. allow httpd_sys_script_t httpd_t:tcp_socket { read write };
  980. allow httpd_sys_script_t httpd_t:unix_stream_socket { read write ioctl };
  981. dontaudit httpd_sys_script_t httpd_config_t:dir search;
  982. allow httpd_sys_script_t httpd_squirrelmail_t:file { append_file_perms read_file_perms };
  983. allow httpd_sys_script_t squirrelmail_spool_t:dir list_dir_perms;
  984. allow httpd_sys_script_t squirrelmail_spool_t:file read_file_perms;
  985. allow httpd_sys_script_t squirrelmail_spool_t:lnk_file read_lnk_file_perms;
  986. kernel_read_kernel_sysctls(httpd_sys_script_t)
  987. dev_read_sysfs(httpd_sys_script_t)
  988. fs_search_auto_mountpoints(httpd_sys_script_t)
  989. files_read_var_symlinks(httpd_sys_script_t)
  990. files_search_var_lib(httpd_sys_script_t)
  991. files_search_spool(httpd_sys_script_t)
  992. apache_domtrans_rotatelogs(httpd_sys_script_t)
  993. auth_use_nsswitch(httpd_sys_script_t)
  994. logging_send_syslog_msg(httpd_sys_script_t)
  995. ifdef(`init_systemd', `
  996. init_search_pid_dirs(httpd_sys_script_t)
  997. ')
  998. tunable_policy(`httpd_can_sendmail',`
  999. corenet_sendrecv_smtp_client_packets(httpd_sys_script_t)
  1000. corenet_tcp_connect_smtp_port(httpd_sys_script_t)
  1001. corenet_tcp_sendrecv_smtp_port(httpd_sys_script_t)
  1002. corenet_sendrecv_pop_client_packets(httpd_sys_script_t)
  1003. corenet_tcp_connect_pop_port(httpd_sys_script_t)
  1004. corenet_tcp_sendrecv_pop_port(httpd_sys_script_t)
  1005. mta_send_mail(httpd_sys_script_t)
  1006. mta_signal_system_mail(httpd_sys_script_t)
  1007. ')
  1008. tunable_policy(`httpd_enable_homedirs',`
  1009. userdom_search_user_home_dirs(httpd_sys_script_t)
  1010. ')
  1011. tunable_policy(`httpd_enable_cgi && httpd_can_network_connect',`
  1012. corenet_tcp_connect_all_ports(httpd_sys_script_t)
  1013. corenet_sendrecv_all_client_packets(httpd_sys_script_t)
  1014. corenet_tcp_sendrecv_all_ports(httpd_sys_script_t)
  1015. ')
  1016. tunable_policy(`httpd_execmem',`
  1017. allow httpd_sys_script_t self:process { execmem execstack };
  1018. ')
  1019. tunable_policy(`httpd_read_user_content',`
  1020. userdom_read_user_home_content_files(httpd_sys_script_t)
  1021. ')
  1022. tunable_policy(`httpd_use_cifs',`
  1023. fs_list_auto_mountpoints(httpd_sys_script_t)
  1024. fs_manage_cifs_dirs(httpd_sys_script_t)
  1025. fs_manage_cifs_files(httpd_sys_script_t)
  1026. fs_manage_cifs_symlinks(httpd_sys_script_t)
  1027. ')
  1028. tunable_policy(`httpd_use_cifs && httpd_builtin_scripting',`
  1029. fs_exec_cifs_files(httpd_sys_script_t)
  1030. ')
  1031. tunable_policy(`httpd_use_fusefs',`
  1032. fs_list_auto_mountpoints(httpd_sys_script_t)
  1033. fs_manage_fusefs_dirs(httpd_sys_script_t)
  1034. fs_manage_fusefs_files(httpd_sys_script_t)
  1035. fs_read_fusefs_symlinks(httpd_sys_script_t)
  1036. ')
  1037. tunable_policy(`httpd_use_fusefs && httpd_builtin_scripting',`
  1038. fs_exec_fusefs_files(httpd_sys_script_t)
  1039. ')
  1040. tunable_policy(`httpd_use_nfs',`
  1041. fs_list_auto_mountpoints(httpd_sys_script_t)
  1042. rpc_manage_nfs_rw_content(httpd_t)
  1043. rpc_read_nfs_content(httpd_t)
  1044. ')
  1045. tunable_policy(`httpd_use_nfs && httpd_builtin_scripting',`
  1046. fs_exec_nfs_files(httpd_sys_script_t)
  1047. ')
  1048. optional_policy(`
  1049. clamav_domtrans_clamscan(httpd_sys_script_t)
  1050. ')
  1051. optional_policy(`
  1052. postgresql_unpriv_client(httpd_sys_script_t)
  1053. ')
  1054. ########################################
  1055. #
  1056. # Rotatelogs local policy
  1057. #
  1058. allow httpd_rotatelogs_t self:capability dac_override;
  1059. manage_files_pattern(httpd_rotatelogs_t, httpd_log_t, httpd_log_t)
  1060. read_lnk_files_pattern(httpd_rotatelogs_t, httpd_log_t, httpd_log_t)
  1061. kernel_read_kernel_sysctls(httpd_rotatelogs_t)
  1062. kernel_dontaudit_list_proc(httpd_rotatelogs_t)
  1063. files_read_etc_files(httpd_rotatelogs_t)
  1064. logging_search_logs(httpd_rotatelogs_t)
  1065. miscfiles_read_localization(httpd_rotatelogs_t)
  1066. ########################################
  1067. #
  1068. # Unconfined script local policy
  1069. #
  1070. optional_policy(`
  1071. apache_content_template(unconfined)
  1072. unconfined_domain(httpd_unconfined_script_t)
  1073. ')
  1074. ########################################
  1075. #
  1076. # User content local policy
  1077. #
  1078. tunable_policy(`httpd_enable_homedirs',`
  1079. userdom_search_user_home_dirs(httpd_user_script_t)
  1080. ')
  1081. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs',`
  1082. fs_list_auto_mountpoints(httpd_user_script_t)
  1083. fs_read_cifs_files(httpd_user_script_t)
  1084. fs_read_cifs_symlinks(httpd_user_script_t)
  1085. ')
  1086. tunable_policy(`httpd_enable_homedirs && use_samba_home_dirs && httpd_builtin_scripting',`
  1087. fs_exec_cifs_files(httpd_user_script_t)
  1088. ')
  1089. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs',`
  1090. fs_list_auto_mountpoints(httpd_user_script_t)
  1091. fs_read_nfs_files(httpd_user_script_t)
  1092. fs_read_nfs_symlinks(httpd_user_script_t)
  1093. ')
  1094. tunable_policy(`httpd_enable_homedirs && use_nfs_home_dirs && httpd_builtin_scripting',`
  1095. fs_exec_nfs_files(httpd_user_script_t)
  1096. ')
  1097. tunable_policy(`httpd_read_user_content',`
  1098. userdom_read_user_home_content_files(httpd_user_script_t)
  1099. ')
  1100. optional_policy(`
  1101. postgresql_unpriv_client(httpd_user_script_t)
  1102. ')
  1103. ########################################
  1104. #
  1105. # Passwd local policy
  1106. #
  1107. allow httpd_passwd_t self:fifo_file manage_fifo_file_perms;
  1108. allow httpd_passwd_t self:unix_stream_socket create_stream_socket_perms;
  1109. allow httpd_passwd_t self:unix_dgram_socket create_socket_perms;
  1110. dontaudit httpd_passwd_t httpd_config_t:file read_file_perms;
  1111. kernel_read_system_state(httpd_passwd_t)
  1112. corecmd_exec_bin(httpd_passwd_t)
  1113. corecmd_exec_shell(httpd_passwd_t)
  1114. dev_read_urand(httpd_passwd_t)
  1115. domain_use_interactive_fds(httpd_passwd_t)
  1116. auth_use_nsswitch(httpd_passwd_t)
  1117. miscfiles_read_generic_certs(httpd_passwd_t)
  1118. miscfiles_read_localization(httpd_passwd_t)
  1119. ########################################
  1120. #
  1121. # GPG local policy
  1122. #
  1123. allow httpd_gpg_t self:process setrlimit;
  1124. allow httpd_gpg_t httpd_t:fd use;
  1125. allow httpd_gpg_t httpd_t:fifo_file rw_fifo_file_perms;
  1126. allow httpd_gpg_t httpd_t:process sigchld;
  1127. dev_read_rand(httpd_gpg_t)
  1128. dev_read_urand(httpd_gpg_t)
  1129. files_read_usr_files(httpd_gpg_t)
  1130. miscfiles_read_localization(httpd_gpg_t)
  1131. tunable_policy(`httpd_gpg_anon_write',`
  1132. miscfiles_manage_public_files(httpd_gpg_t)
  1133. ')
  1134. optional_policy(`
  1135. apache_manage_sys_rw_content(httpd_gpg_t)
  1136. ')
  1137. optional_policy(`
  1138. gpg_entry_type(httpd_gpg_t)
  1139. gpg_exec(httpd_gpg_t)
  1140. ')