iptables.te 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. policy_module(iptables, 1.15.1)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. attribute_role iptables_roles;
  7. roleattribute system_r iptables_roles;
  8. type iptables_t;
  9. type iptables_exec_t;
  10. init_system_domain(iptables_t, iptables_exec_t)
  11. role iptables_roles types iptables_t;
  12. type iptables_initrc_exec_t;
  13. init_script_file(iptables_initrc_exec_t)
  14. type iptables_conf_t;
  15. files_config_file(iptables_conf_t)
  16. type iptables_tmp_t;
  17. files_tmp_file(iptables_tmp_t)
  18. type iptables_var_run_t;
  19. files_pid_file(iptables_var_run_t)
  20. type iptables_unit_file_t;
  21. systemd_unit_file(iptables_unit_file_t)
  22. ########################################
  23. #
  24. # Iptables local policy
  25. #
  26. allow iptables_t self:capability { dac_read_search dac_override net_admin net_raw };
  27. dontaudit iptables_t self:capability sys_tty_config;
  28. allow iptables_t self:fifo_file rw_fifo_file_perms;
  29. allow iptables_t self:process { sigchld sigkill sigstop signull signal };
  30. allow iptables_t self:netlink_socket create_socket_perms;
  31. allow iptables_t self:rawip_socket create_socket_perms;
  32. manage_files_pattern(iptables_t, iptables_conf_t, iptables_conf_t)
  33. files_etc_filetrans(iptables_t, iptables_conf_t, file)
  34. manage_files_pattern(iptables_t, iptables_var_run_t, iptables_var_run_t)
  35. files_pid_filetrans(iptables_t, iptables_var_run_t, file)
  36. can_exec(iptables_t, iptables_exec_t)
  37. allow iptables_t iptables_tmp_t:dir manage_dir_perms;
  38. allow iptables_t iptables_tmp_t:file manage_file_perms;
  39. files_tmp_filetrans(iptables_t, iptables_tmp_t, { file dir })
  40. kernel_getattr_proc(iptables_t)
  41. kernel_request_load_module(iptables_t)
  42. kernel_read_system_state(iptables_t)
  43. kernel_read_network_state(iptables_t)
  44. kernel_read_kernel_sysctls(iptables_t)
  45. kernel_read_modprobe_sysctls(iptables_t)
  46. kernel_use_fds(iptables_t)
  47. # needed by ipvsadm
  48. corecmd_exec_bin(iptables_t)
  49. corecmd_exec_shell(iptables_t)
  50. corenet_relabelto_all_packets(iptables_t)
  51. corenet_dontaudit_rw_tun_tap_dev(iptables_t)
  52. dev_read_sysfs(iptables_t)
  53. fs_getattr_xattr_fs(iptables_t)
  54. fs_search_auto_mountpoints(iptables_t)
  55. fs_list_inotifyfs(iptables_t)
  56. mls_file_read_all_levels(iptables_t)
  57. term_dontaudit_use_console(iptables_t)
  58. domain_use_interactive_fds(iptables_t)
  59. files_read_etc_files(iptables_t)
  60. files_read_etc_runtime_files(iptables_t)
  61. auth_use_nsswitch(iptables_t)
  62. init_use_fds(iptables_t)
  63. init_use_script_ptys(iptables_t)
  64. # to allow rules to be saved on reboot:
  65. init_rw_script_tmp_files(iptables_t)
  66. init_rw_script_stream_sockets(iptables_t)
  67. logging_send_syslog_msg(iptables_t)
  68. miscfiles_read_localization(iptables_t)
  69. sysnet_run_ifconfig(iptables_t, iptables_roles)
  70. sysnet_dns_name_resolve(iptables_t)
  71. userdom_use_user_terminals(iptables_t)
  72. userdom_use_all_users_fds(iptables_t)
  73. dev_read_urand(iptables_t)
  74. ifdef(`hide_broken_symptoms',`
  75. dev_dontaudit_write_mtrr(iptables_t)
  76. ')
  77. optional_policy(`
  78. fail2ban_append_log(iptables_t)
  79. ')
  80. optional_policy(`
  81. firewalld_read_config_files(iptables_t)
  82. firewalld_dontaudit_rw_tmp_files(iptables_t)
  83. ')
  84. optional_policy(`
  85. firstboot_use_fds(iptables_t)
  86. firstboot_rw_pipes(iptables_t)
  87. ')
  88. optional_policy(`
  89. modutils_run_insmod(iptables_t, iptables_roles)
  90. ')
  91. optional_policy(`
  92. # for iptables -L
  93. nis_use_ypbind(iptables_t)
  94. ')
  95. optional_policy(`
  96. ppp_dontaudit_use_fds(iptables_t)
  97. ')
  98. optional_policy(`
  99. psad_rw_tmp_files(iptables_t)
  100. ')
  101. optional_policy(`
  102. rhgb_dontaudit_use_ptys(iptables_t)
  103. ')
  104. optional_policy(`
  105. seutil_sigchld_newrole(iptables_t)
  106. ')
  107. optional_policy(`
  108. shorewall_read_tmp_files(iptables_t)
  109. shorewall_rw_lib_files(iptables_t)
  110. shorewall_read_config(iptables_t)
  111. ')
  112. optional_policy(`
  113. udev_read_db(iptables_t)
  114. ')