1semanage_selinux(8) SELinux Policy semanage semanage_selinux(8)
2
3
4
6 semanage_selinux - Security Enhanced Linux Policy for the semanage pro‐
7 cesses
8
10 Security-Enhanced Linux secures the semanage processes via flexible
11 mandatory access control.
12
13 The semanage processes execute with the semanage_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 semanage_t
20
21
22
24 The semanage_t SELinux type can be entered via the semanage_exec_t file
25 type.
26
27 The default entrypoint paths for the semanage_t domain are the follow‐
28 ing:
29
30 /usr/sbin/semanage, /usr/sbin/semodule, /usr/libexec/selinux/seman‐
31 age_migrate_store, /usr/share/system-config-selinux/selinux_server.py,
32 /usr/share/system-config-selinux/system-config-selinux-dbus.py
33
35 SELinux defines process types (domains) for each process running on the
36 system
37
38 You can see the context of a process using the -Z option to ps
39
40 Policy governs the access confined processes have to files. SELinux
41 semanage policy is very flexible allowing users to setup their semanage
42 processes in as secure a method as possible.
43
44 The following process types are defined for semanage:
45
46 semanage_t
47
48 Note: semanage permissive -a semanage_t can be used to make the process
49 type semanage_t permissive. SELinux does not deny access to permissive
50 process types, but the AVC (SELinux denials) messages are still gener‐
51 ated.
52
53
55 SELinux policy is customizable based on least access required. seman‐
56 age policy is extremely flexible and has several booleans that allow
57 you to manipulate the policy and run semanage with the tightest access
58 possible.
59
60
61
62 If you want to allow users to resolve user passwd entries directly from
63 ldap rather then using a sssd server, you must turn on the authlo‐
64 gin_nsswitch_use_ldap boolean. Disabled by default.
65
66 setsebool -P authlogin_nsswitch_use_ldap 1
67
68
69
70 If you want to deny user domains applications to map a memory region as
71 both executable and writable, this is dangerous and the executable
72 should be reported in bugzilla, you must turn on the deny_execmem bool‐
73 ean. Enabled by default.
74
75 setsebool -P deny_execmem 1
76
77
78
79 If you want to allow all domains to execute in fips_mode, you must turn
80 on the fips_mode boolean. Enabled by default.
81
82 setsebool -P fips_mode 1
83
84
85
86 If you want to allow confined applications to run with kerberos, you
87 must turn on the kerberos_enabled boolean. Enabled by default.
88
89 setsebool -P kerberos_enabled 1
90
91
92
93 If you want to control the ability to mmap a low area of the address
94 space, as configured by /proc/sys/vm/mmap_min_addr, you must turn on
95 the mmap_low_allowed boolean. Disabled by default.
96
97 setsebool -P mmap_low_allowed 1
98
99
100
101 If you want to allow system to run with NIS, you must turn on the
102 nis_enabled boolean. Disabled by default.
103
104 setsebool -P nis_enabled 1
105
106
107
108 If you want to allow confined applications to use nscd shared memory,
109 you must turn on the nscd_use_shm boolean. Disabled by default.
110
111 setsebool -P nscd_use_shm 1
112
113
114
115 If you want to disable kernel module loading, you must turn on the
116 secure_mode_insmod boolean. Enabled by default.
117
118 setsebool -P secure_mode_insmod 1
119
120
121
122 If you want to allow unconfined executables to make their heap memory
123 executable. Doing this is a really bad idea. Probably indicates a
124 badly coded executable, but could indicate an attack. This executable
125 should be reported in bugzilla, you must turn on the selin‐
126 uxuser_execheap boolean. Disabled by default.
127
128 setsebool -P selinuxuser_execheap 1
129
130
131
132 If you want to allow unconfined executables to make their stack exe‐
133 cutable. This should never, ever be necessary. Probably indicates a
134 badly coded executable, but could indicate an attack. This executable
135 should be reported in bugzilla, you must turn on the selinuxuser_exec‐
136 stack boolean. Enabled by default.
137
138 setsebool -P selinuxuser_execstack 1
139
140
141
143 The SELinux process type semanage_t can manage files labeled with the
144 following file types. The paths listed are the default paths for these
145 file types. Note the processes UID still need to have DAC permissions.
146
147 file_type
148
149 all files on the system
150
151
153 SELinux requires files to have an extended attribute to define the file
154 type.
155
156 You can see the context of a file using the -Z option to ls
157
158 Policy governs the access confined processes have to these files.
159 SELinux semanage policy is very flexible allowing users to setup their
160 semanage processes in as secure a method as possible.
161
162 EQUIVALENCE DIRECTORIES
163
164
165 semanage policy stores data with multiple different file context types
166 under the /var/lib/selinux directory. If you would like to store the
167 data in a different directory you can use the semanage command to cre‐
168 ate an equivalence mapping. If you wanted to store this data under the
169 /srv dirctory you would execute the following command:
170
171 semanage fcontext -a -e /var/lib/selinux /srv/selinux
172 restorecon -R -v /srv/selinux
173
174 STANDARD FILE CONTEXT
175
176 SELinux defines the file context types for the semanage, if you wanted
177 to store files with these types in a diffent paths, you need to execute
178 the semanage command to sepecify alternate labeling and then use
179 restorecon to put the labels on disk.
180
181 semanage fcontext -a -t semanage_trans_lock_t '/srv/mysemanage_con‐
182 tent(/.*)?'
183 restorecon -R -v /srv/mysemanage_content
184
185 Note: SELinux often uses regular expressions to specify labels that
186 match multiple files.
187
188 The following file types are defined for semanage:
189
190
191
192 semanage_exec_t
193
194 - Set files with the semanage_exec_t type, if you want to transition an
195 executable to the semanage_t domain.
196
197
198 Paths:
199 /usr/sbin/semanage, /usr/sbin/semodule, /usr/libexec/selinux/sem‐
200 anage_migrate_store, /usr/share/system-config-
201 selinux/selinux_server.py, /usr/share/system-config-selinux/sys‐
202 tem-config-selinux-dbus.py
203
204
205 semanage_read_lock_t
206
207 - Set files with the semanage_read_lock_t type, if you want to treat
208 the files as semanage read lock data, stored under the /var/lock direc‐
209 tory
210
211
212 Paths:
213 /etc/selinux/([^/]*/)?modules/semanage.read.LOCK,
214 /var/lib/selinux/[^/]+/semanage.read.LOCK
215
216
217 semanage_store_t
218
219 - Set files with the semanage_store_t type, if you want to treat the
220 files as semanage store data.
221
222
223 Paths:
224 /etc/selinux/([^/]*/)?policy(/.*)?, /etc/selinux/(minimum|mls|tar‐
225 geted)/active(/.*)?, /etc/selinux/([^/]*/)?mod‐
226 ules/(active|tmp|previous)(/.*)?, /var/lib/selinux(/.*)?,
227 /etc/share/selinux/mls(/.*)?, /etc/share/selinux/targeted(/.*)?
228
229
230 semanage_tmp_t
231
232 - Set files with the semanage_tmp_t type, if you want to store semanage
233 temporary files in the /tmp directories.
234
235
236
237 semanage_trans_lock_t
238
239 - Set files with the semanage_trans_lock_t type, if you want to treat
240 the files as semanage trans lock data, stored under the /var/lock
241 directory
242
243
244 Paths:
245 /etc/selinux/([^/]*/)?modules/semanage.trans.LOCK,
246 /var/lib/selinux/[^/]+/semanage.trans.LOCK
247
248
249 Note: File context can be temporarily modified with the chcon command.
250 If you want to permanently change the file context you need to use the
251 semanage fcontext command. This will modify the SELinux labeling data‐
252 base. You will need to use restorecon to apply the labels.
253
254
256 semanage fcontext can also be used to manipulate default file context
257 mappings.
258
259 semanage permissive can also be used to manipulate whether or not a
260 process type is permissive.
261
262 semanage module can also be used to enable/disable/install/remove pol‐
263 icy modules.
264
265 semanage boolean can also be used to manipulate the booleans
266
267
268 system-config-selinux is a GUI tool available to customize SELinux pol‐
269 icy settings.
270
271
273 This manual page was auto-generated using sepolicy manpage .
274
275
277 selinux(8), semanage(8), semanage(8), restorecon(8), chcon(1), sepol‐
278 icy(8), setsebool(8)
279
280
281
282semanage 19-05-30 semanage_selinux(8)