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 deny user domains applications to map a memory region as
63 both executable and writable, this is dangerous and the executable
64 should be reported in bugzilla, you must turn on the deny_execmem bool‐
65 ean. Enabled by default.
66
67 setsebool -P deny_execmem 1
68
69
70
71 If you want to control the ability to mmap a low area of the address
72 space, as configured by /proc/sys/vm/mmap_min_addr, you must turn on
73 the mmap_low_allowed boolean. Disabled by default.
74
75 setsebool -P mmap_low_allowed 1
76
77
78
79 If you want to disable kernel module loading, you must turn on the
80 secure_mode_insmod boolean. Enabled by default.
81
82 setsebool -P secure_mode_insmod 1
83
84
85
86 If you want to allow unconfined executables to make their heap memory
87 executable. Doing this is a really bad idea. Probably indicates a
88 badly coded executable, but could indicate an attack. This executable
89 should be reported in bugzilla, you must turn on the selin‐
90 uxuser_execheap boolean. Disabled by default.
91
92 setsebool -P selinuxuser_execheap 1
93
94
95
96 If you want to allow unconfined executables to make their stack exe‐
97 cutable. This should never, ever be necessary. Probably indicates a
98 badly coded executable, but could indicate an attack. This executable
99 should be reported in bugzilla, you must turn on the selinuxuser_exec‐
100 stack boolean. Disabled by default.
101
102 setsebool -P selinuxuser_execstack 1
103
104
105
107 The SELinux process type semanage_t can manage files labeled with the
108 following file types. The paths listed are the default paths for these
109 file types. Note the processes UID still need to have DAC permissions.
110
111 file_type
112
113 all files on the system
114
115
117 SELinux requires files to have an extended attribute to define the file
118 type.
119
120 You can see the context of a file using the -Z option to ls
121
122 Policy governs the access confined processes have to these files.
123 SELinux semanage policy is very flexible allowing users to setup their
124 semanage processes in as secure a method as possible.
125
126 EQUIVALENCE DIRECTORIES
127
128
129 semanage policy stores data with multiple different file context types
130 under the /var/lib/selinux directory. If you would like to store the
131 data in a different directory you can use the semanage command to cre‐
132 ate an equivalence mapping. If you wanted to store this data under the
133 /srv directory you would execute the following command:
134
135 semanage fcontext -a -e /var/lib/selinux /srv/selinux
136 restorecon -R -v /srv/selinux
137
138 STANDARD FILE CONTEXT
139
140 SELinux defines the file context types for the semanage, if you wanted
141 to store files with these types in a diffent paths, you need to execute
142 the semanage command to sepecify alternate labeling and then use
143 restorecon to put the labels on disk.
144
145 semanage fcontext -a -t semanage_trans_lock_t '/srv/mysemanage_con‐
146 tent(/.*)?'
147 restorecon -R -v /srv/mysemanage_content
148
149 Note: SELinux often uses regular expressions to specify labels that
150 match multiple files.
151
152 The following file types are defined for semanage:
153
154
155
156 semanage_exec_t
157
158 - Set files with the semanage_exec_t type, if you want to transition an
159 executable to the semanage_t domain.
160
161
162 Paths:
163 /usr/sbin/semanage, /usr/sbin/semodule, /usr/libexec/selinux/sem‐
164 anage_migrate_store, /usr/share/system-config-
165 selinux/selinux_server.py, /usr/share/system-config-selinux/sys‐
166 tem-config-selinux-dbus.py
167
168
169 semanage_read_lock_t
170
171 - Set files with the semanage_read_lock_t type, if you want to treat
172 the files as semanage read lock data, stored under the /var/lock direc‐
173 tory
174
175
176 Paths:
177 /etc/selinux/([^/]*/)?modules/semanage.read.LOCK,
178 /var/lib/selinux/[^/]+/semanage.read.LOCK
179
180
181 semanage_store_t
182
183 - Set files with the semanage_store_t type, if you want to treat the
184 files as semanage store data.
185
186
187 Paths:
188 /etc/selinux/([^/]*/)?policy(/.*)?, /etc/selinux/(minimum|mls|tar‐
189 geted)/active(/.*)?, /etc/selinux/([^/]*/)?mod‐
190 ules/(active|tmp|previous)(/.*)?, /var/lib/selinux(/.*)?,
191 /etc/share/selinux/mls(/.*)?, /etc/share/selinux/targeted(/.*)?
192
193
194 semanage_tmp_t
195
196 - Set files with the semanage_tmp_t type, if you want to store semanage
197 temporary files in the /tmp directories.
198
199
200
201 semanage_trans_lock_t
202
203 - Set files with the semanage_trans_lock_t type, if you want to treat
204 the files as semanage trans lock data, stored under the /var/lock
205 directory
206
207
208 Paths:
209 /etc/selinux/([^/]*/)?modules/semanage.trans.LOCK,
210 /var/lib/selinux/[^/]+/semanage.trans.LOCK
211
212
213 Note: File context can be temporarily modified with the chcon command.
214 If you want to permanently change the file context you need to use the
215 semanage fcontext command. This will modify the SELinux labeling data‐
216 base. You will need to use restorecon to apply the labels.
217
218
220 semanage fcontext can also be used to manipulate default file context
221 mappings.
222
223 semanage permissive can also be used to manipulate whether or not a
224 process type is permissive.
225
226 semanage module can also be used to enable/disable/install/remove pol‐
227 icy modules.
228
229 semanage boolean can also be used to manipulate the booleans
230
231
232 system-config-selinux is a GUI tool available to customize SELinux pol‐
233 icy settings.
234
235
237 This manual page was auto-generated using sepolicy manpage .
238
239
241 selinux(8), semanage(8), semanage(8), restorecon(8), chcon(1), sepol‐
242 icy(8), setsebool(8)
243
244
245
246semanage 20-05-05 semanage_selinux(8)