1iptables_selinux(8) SELinux Policy iptables iptables_selinux(8)
2
3
4
6 iptables_selinux - Security Enhanced Linux Policy for the iptables pro‐
7 cesses
8
10 Security-Enhanced Linux secures the iptables processes via flexible
11 mandatory access control.
12
13 The iptables processes execute with the iptables_t SELinux type. You
14 can check if you have these processes running by executing the ps com‐
15 mand with the -Z qualifier.
16
17 For example:
18
19 ps -eZ | grep iptables_t
20
21
22
24 The iptables_t SELinux type can be entered via the iptables_exec_t file
25 type.
26
27 The default entrypoint paths for the iptables_t domain are the follow‐
28 ing:
29
30 /usr/sbin/ip6?tables.*, /usr/sbin/ipchains.*, /usr/libexec/ipta‐
31 bles/iptables.init, /usr/libexec/iptables/ip6tables.init,
32 /usr/sbin/nft, /usr/sbin/ipset, /usr/sbin/ipvsadm, /usr/libexec/ipset,
33 /usr/sbin/ebtables, /usr/sbin/arptables, /usr/sbin/conntrack,
34 /usr/sbin/ipvsadm-save, /usr/sbin/xtables-multi, /usr/sbin/arptables-
35 save, /usr/sbin/ebtables-legacy, /usr/sbin/ipvsadm-restore,
36 /usr/sbin/arptables-legacy, /usr/sbin/ebtables-restore, /usr/sbin/arpt‐
37 ables-restore, /usr/sbin/xtables-nft-multi, /usr/sbin/ebtables-legacy-
38 save, /usr/sbin/xtables-legacy-multi, /usr/sbin/ebtables-legacy-restore
39
41 SELinux defines process types (domains) for each process running on the
42 system
43
44 You can see the context of a process using the -Z option to ps
45
46 Policy governs the access confined processes have to files. SELinux
47 iptables policy is very flexible allowing users to setup their iptables
48 processes in as secure a method as possible.
49
50 The following process types are defined for iptables:
51
52 iptables_t
53
54 Note: semanage permissive -a iptables_t can be used to make the process
55 type iptables_t permissive. SELinux does not deny access to permissive
56 process types, but the AVC (SELinux denials) messages are still gener‐
57 ated.
58
59
61 SELinux policy is customizable based on least access required. ipta‐
62 bles policy is extremely flexible and has several booleans that allow
63 you to manipulate the policy and run iptables with the tightest access
64 possible.
65
66
67
68 If you want to allow dhcpc client applications to execute iptables com‐
69 mands, you must turn on the dhcpc_exec_iptables boolean. Disabled by
70 default.
71
72 setsebool -P dhcpc_exec_iptables 1
73
74
75
76 If you want to allow all domains to execute in fips_mode, you must turn
77 on the fips_mode boolean. Enabled by default.
78
79 setsebool -P fips_mode 1
80
81
82
83 If you want to allow system to run with NIS, you must turn on the
84 nis_enabled boolean. Disabled by default.
85
86 setsebool -P nis_enabled 1
87
88
89
91 The SELinux process type iptables_t can manage files labeled with the
92 following file types. The paths listed are the default paths for these
93 file types. Note the processes UID still need to have DAC permissions.
94
95 iptables_lock_t
96
97 /var/lock/subsys/iptables
98 /var/lock/subsys/ip6tables
99
100 iptables_var_lib_t
101
102 /var/lib/ebtables(/.*)?
103
104 iptables_var_run_t
105
106 /var/run/xtables.*
107 /var/run/ebtables.*
108
109 krb5_host_rcache_t
110
111 /var/tmp/krb5_0.rcache2
112 /var/cache/krb5rcache(/.*)?
113 /var/tmp/nfs_0
114 /var/tmp/DNS_25
115 /var/tmp/host_0
116 /var/tmp/imap_0
117 /var/tmp/HTTP_23
118 /var/tmp/HTTP_48
119 /var/tmp/ldap_55
120 /var/tmp/ldap_487
121 /var/tmp/ldapmap1_0
122
123 psad_var_log_t
124
125 /var/log/psad(/.*)?
126
127 shorewall_var_lib_t
128
129 /var/lib/shorewall(/.*)?
130 /var/lib/shorewall6(/.*)?
131 /var/lib/shorewall-lite(/.*)?
132 /var/lib/shorewall6-lite(/.*)?
133
134
136 SELinux requires files to have an extended attribute to define the file
137 type.
138
139 You can see the context of a file using the -Z option to ls
140
141 Policy governs the access confined processes have to these files.
142 SELinux iptables policy is very flexible allowing users to setup their
143 iptables processes in as secure a method as possible.
144
145 STANDARD FILE CONTEXT
146
147 SELinux defines the file context types for the iptables, if you wanted
148 to store files with these types in a different paths, you need to exe‐
149 cute the semanage command to specify alternate labeling and then use
150 restorecon to put the labels on disk.
151
152 semanage fcontext -a -t iptables_exec_t '/srv/iptables/content(/.*)?'
153 restorecon -R -v /srv/myiptables_content
154
155 Note: SELinux often uses regular expressions to specify labels that
156 match multiple files.
157
158 The following file types are defined for iptables:
159
160
161
162 iptables_exec_t
163
164 - Set files with the iptables_exec_t type, if you want to transition an
165 executable to the iptables_t domain.
166
167
168 Paths:
169 /usr/sbin/ip6?tables.*, /usr/sbin/ipchains.*, /usr/libexec/ipta‐
170 bles/iptables.init, /usr/libexec/iptables/ip6tables.init,
171 /usr/sbin/nft, /usr/sbin/ipset, /usr/sbin/ipvsadm,
172 /usr/libexec/ipset, /usr/sbin/ebtables, /usr/sbin/arptables,
173 /usr/sbin/conntrack, /usr/sbin/ipvsadm-save, /usr/sbin/xtables-
174 multi, /usr/sbin/arptables-save, /usr/sbin/ebtables-legacy,
175 /usr/sbin/ipvsadm-restore, /usr/sbin/arptables-legacy,
176 /usr/sbin/ebtables-restore, /usr/sbin/arptables-restore,
177 /usr/sbin/xtables-nft-multi, /usr/sbin/ebtables-legacy-save,
178 /usr/sbin/xtables-legacy-multi, /usr/sbin/ebtables-legacy-restore
179
180
181 iptables_initrc_exec_t
182
183 - Set files with the iptables_initrc_exec_t type, if you want to tran‐
184 sition an executable to the iptables_initrc_t domain.
185
186
187 Paths:
188 /etc/rc.d/init.d/ip6?tables, /etc/rc.d/init.d/ebtables,
189 /etc/rc.d/init.d/nftables
190
191
192 iptables_lock_t
193
194 - Set files with the iptables_lock_t type, if you want to treat the
195 files as iptables lock data, stored under the /var/lock directory
196
197
198 Paths:
199 /var/lock/subsys/iptables, /var/lock/subsys/ip6tables
200
201
202 iptables_tmp_t
203
204 - Set files with the iptables_tmp_t type, if you want to store iptables
205 temporary files in the /tmp directories.
206
207
208
209 iptables_unit_file_t
210
211 - Set files with the iptables_unit_file_t type, if you want to treat
212 the files as iptables unit content.
213
214
215 Paths:
216 /usr/lib/systemd/system/ppp.*, /usr/lib/systemd/system/ipset.*,
217 /usr/lib/systemd/system/iptables.*, /usr/lib/systemd/system/arpta‐
218 bles.*, /usr/lib/systemd/system/ip6tables.*
219
220
221 iptables_var_lib_t
222
223 - Set files with the iptables_var_lib_t type, if you want to store the
224 iptables files under the /var/lib directory.
225
226
227
228 iptables_var_run_t
229
230 - Set files with the iptables_var_run_t type, if you want to store the
231 iptables files under the /run or /var/run directory.
232
233
234 Paths:
235 /var/run/xtables.*, /var/run/ebtables.*
236
237
238 Note: File context can be temporarily modified with the chcon command.
239 If you want to permanently change the file context you need to use the
240 semanage fcontext command. This will modify the SELinux labeling data‐
241 base. You will need to use restorecon to apply the labels.
242
243
245 semanage fcontext can also be used to manipulate default file context
246 mappings.
247
248 semanage permissive can also be used to manipulate whether or not a
249 process type is permissive.
250
251 semanage module can also be used to enable/disable/install/remove pol‐
252 icy modules.
253
254 semanage boolean can also be used to manipulate the booleans
255
256
257 system-config-selinux is a GUI tool available to customize SELinux pol‐
258 icy settings.
259
260
262 This manual page was auto-generated using sepolicy manpage .
263
264
266 selinux(8), iptables(8), semanage(8), restorecon(8), chcon(1), sepol‐
267 icy(8), setsebool(8)
268
269
270
271iptables 23-10-20 iptables_selinux(8)