Chris PeBenito a7ed44
Chris PeBenito 1b9099
policy_module(iptables, 1.0)
Chris PeBenito 1b9099
Chris PeBenito a7ed44
########################################
Chris PeBenito a7ed44
#
Chris PeBenito a7ed44
# Declarations
Chris PeBenito a7ed44
#
Chris PeBenito a7ed44
Chris PeBenito a7ed44
type iptables_t;
Chris PeBenito a7ed44
type iptables_exec_t;
Chris PeBenito ff3138
init_make_system_domain(iptables_t,iptables_exec_t)
Chris PeBenito 1e5c2a
role system_r types iptables_t;
Chris PeBenito a7ed44
Chris PeBenito a7ed44
type iptables_tmp_t;
Chris PeBenito 38e24a
files_make_temporary_file(iptables_tmp_t)
Chris PeBenito a7ed44
Chris PeBenito d25dd9
type iptables_var_run_t;
Chris PeBenito d25dd9
files_make_daemon_runtime_file(iptables_var_run_t)
Chris PeBenito a7ed44
Chris PeBenito a7ed44
########################################
Chris PeBenito a7ed44
#
Chris PeBenito a7ed44
# Iptables local policy
Chris PeBenito a7ed44
#
Chris PeBenito a7ed44
Chris PeBenito a7ed44
allow iptables_t self:capability { net_admin net_raw };
Chris PeBenito 1e5c2a
dontaudit iptables_t self:capability sys_tty_config;
Chris PeBenito 1e5c2a
allow iptables_t self:process { sigchld sigkill sigstop signull signal };
Chris PeBenito a7ed44
Chris PeBenito a7ed44
allow iptables_t iptables_var_run_t:dir { ioctl read getattr lock write append };
Chris PeBenito 1e5c2a
files_create_daemon_runtime_data(iptables_t,iptables_var_run_t)
Chris PeBenito a7ed44
Chris PeBenito a7ed44
allow iptables_t iptables_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito a7ed44
Chris PeBenito a7ed44
allow iptables_t iptables_tmp_t:dir { create read getattr lock setattr ioctl link unlink rename search add_name remove_name reparent write rmdir };
Chris PeBenito a7ed44
allow iptables_t iptables_tmp_t:file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito a7ed44
files_create_private_tmp_data(iptables_t, iptables_tmp_t, { file dir })
Chris PeBenito a7ed44
Chris PeBenito a7ed44
allow iptables_t self:rawip_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
Chris PeBenito a7ed44
Chris PeBenito a7ed44
kernel_read_system_state(iptables_t)
Chris PeBenito a7ed44
kernel_read_network_state(iptables_t)
Chris PeBenito 1e5c2a
kernel_read_hardware_state(iptables_t)
Chris PeBenito 1e5c2a
kernel_read_kernel_sysctl(iptables_t)
Chris PeBenito 1e5c2a
kernel_read_modprobe_sysctl(iptables_t)
Chris PeBenito 1e5c2a
kernel_use_file_descriptors(iptables_t)
Chris PeBenito a7ed44
Chris PeBenito a7ed44
filesystem_get_persistent_filesystem_attributes(iptables_t)
Chris PeBenito a7ed44
Chris PeBenito 1e5c2a
terminal_ignore_use_console(iptables_t)
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
domain_use_widely_inheritable_file_descriptors(iptables_t)
Chris PeBenito 1e5c2a
Chris PeBenito a7ed44
files_read_general_system_config(iptables_t)
Chris PeBenito a7ed44
Chris PeBenito daa0e0
init_use_file_descriptors(iptables_t)
Chris PeBenito daa0e0
init_script_use_pseudoterminal(iptables_t)
Chris PeBenito daa0e0
# to allow rules to be saved on reboot:
Chris PeBenito daa0e0
init_script_modify_temporary_data(iptables_t)
Chris PeBenito daa0e0
Chris PeBenito 1e5c2a
libraries_use_dynamic_loader(iptables_t)
Chris PeBenito dd14d0
libraries_use_shared_libraries(iptables_t)
Chris PeBenito 1e5c2a
Chris PeBenito a7ed44
logging_send_system_log_message(iptables_t)
Chris PeBenito a7ed44
# system-config-network appends to /var/log
Chris PeBenito a7ed44
#logging_append_system_logs(iptables_t)
Chris PeBenito a7ed44
Chris PeBenito a7ed44
miscfiles_read_localization(iptables_t)
Chris PeBenito a7ed44
Chris PeBenito 1e5c2a
sysnetwork_ifconfig_transition(iptables_t)
Chris PeBenito 1e5c2a
Chris PeBenito daa0e0
userdomain_use_all_users_file_descriptors(iptables_t)
Chris PeBenito daa0e0
Chris PeBenito daa0e0
tunable_policy(`use_dns',`
Chris PeBenito d115b2
	allow iptables_t self:udp_socket { create ioctl read getattr write setattr append bind getopt setopt shutdown connect };
Chris PeBenito d115b2
Chris PeBenito d11566
	corenetwork_sendrecv_udp_on_all_interfaces(iptables_t)
Chris PeBenito d11566
	corenetwork_sendrecv_raw_on_all_interfaces(iptables_t)
Chris PeBenito d11566
	corenetwork_sendrecv_udp_on_all_nodes(iptables_t)
Chris PeBenito d11566
	corenetwork_sendrecv_raw_on_all_nodes(iptables_t)
Chris PeBenito d115b2
	corenetwork_bind_udp_on_all_nodes(iptables_t)
Chris PeBenito d11566
	corenetwork_sendrecv_udp_on_dns_port(iptables_t)
Chris PeBenito d115b2
Chris PeBenito d115b2
	sysnetwork_read_network_config(iptables_t)
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito a7ed44
optional_policy(`modutils.te', `
Chris PeBenito d115b2
	corecommands_search_system_programs_directory(iptables_t)
Chris PeBenito d115b2
	modutils_insmod_transition(iptables_t)
Chris PeBenito a7ed44
')
Chris PeBenito a7ed44
Chris PeBenito 1e5c2a
optional_policy(`selinux.te',`
Chris PeBenito d115b2
	selinux_newrole_sigchld(iptables_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
optional_policy(`udev.te', `
Chris PeBenito d115b2
	udev_read_database(iptables_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 254bbc
ifdef(`targeted_policy', `
Chris PeBenito d115b2
	terminal_ignore_use_general_physical_terminal(iptables_t)
Chris PeBenito d115b2
	terminal_ignore_use_general_pseudoterminal(iptables_t)
Chris PeBenito d115b2
Chris PeBenito d115b2
	files_ignore_read_rootfs_file(iptables_t)
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito a7ed44
ifdef(`TODO',`
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
optional_policy(`rhgb.te', `
Chris PeBenito 1e5c2a
allow iptables_t rhgb_t:process sigchld;
Chris PeBenito 1e5c2a
allow iptables_t rhgb_t:fd use;
Chris PeBenito 1e5c2a
allow iptables_t rhgb_t:fifo_file { read write };
Chris PeBenito 1e5c2a
')
Chris PeBenito a7ed44
Chris PeBenito daa0e0
allow iptables_t autofs_t:dir { search getattr };
Chris PeBenito a7ed44
Chris PeBenito a7ed44
# for iptables -L
Chris PeBenito a7ed44
can_ypbind(iptables_t)
Chris PeBenito a7ed44
Chris PeBenito 25baab
optional_policy(`gnome-pty-helper.te',`
Chris PeBenito 0c73cd
	allow iptables_t sysadm_gph_t:fd use;
Chris PeBenito 25baab
')
Chris PeBenito a7ed44
Chris PeBenito 25baab
optional_policy(`firstboot.te', `
Chris PeBenito 0c73cd
	allow iptables_t firstboot_t:fifo_file write;
Chris PeBenito a7ed44
')
Chris PeBenito a7ed44
') dnl ifdef TODO