1mongod_selinux(8) SELinux Policy mongod mongod_selinux(8)
2
3
4
6 mongod_selinux - Security Enhanced Linux Policy for the mongod pro‐
7 cesses
8
10 Security-Enhanced Linux secures the mongod processes via flexible
11 mandatory access control.
12
13 The mongod processes execute with the mongod_t SELinux type. You can
14 check if you have these processes running by executing the ps command
15 with the -Z qualifier.
16
17 For example:
18
19 ps -eZ | grep mongod_t
20
21
22
24 The mongod_t SELinux type can be entered via the mongod_exec_t file
25 type.
26
27 The default entrypoint paths for the mongod_t domain are the following:
28
29 /usr/bin/mongod, /usr/bin/mongos, /usr/libexec/mongodb-scl-helper,
30 /usr/share/aeolus-conductor/dbomatic/dbomatic
31
33 SELinux defines process types (domains) for each process running on the
34 system
35
36 You can see the context of a process using the -Z option to ps
37
38 Policy governs the access confined processes have to files. SELinux
39 mongod policy is very flexible allowing users to setup their mongod
40 processes in as secure a method as possible.
41
42 The following process types are defined for mongod:
43
44 mongod_t
45
46 Note: semanage permissive -a mongod_t can be used to make the process
47 type mongod_t permissive. SELinux does not deny access to permissive
48 process types, but the AVC (SELinux denials) messages are still gener‐
49 ated.
50
51
53 SELinux policy is customizable based on least access required. mongod
54 policy is extremely flexible and has several booleans that allow you to
55 manipulate the policy and run mongod with the tightest access possible.
56
57
58
59 If you want to allow all domains to execute in fips_mode, you must turn
60 on the fips_mode boolean. Enabled by default.
61
62 setsebool -P fips_mode 1
63
64
65
67 SELinux defines port types to represent TCP and UDP ports.
68
69 You can see the types associated with a port by using the following
70 command:
71
72 semanage port -l
73
74
75 Policy governs the access confined processes have to these ports.
76 SELinux mongod policy is very flexible allowing users to setup their
77 mongod processes in as secure a method as possible.
78
79 The following port types are defined for mongod:
80
81
82 mongod_port_t
83
84
85
86 Default Defined Ports:
87 tcp 27017-27019,28017-28019
88
90 The SELinux process type mongod_t can manage files labeled with the
91 following file types. The paths listed are the default paths for these
92 file types. Note the processes UID still need to have DAC permissions.
93
94 cluster_conf_t
95
96 /etc/cluster(/.*)?
97
98 cluster_var_lib_t
99
100 /var/lib/pcsd(/.*)?
101 /var/lib/cluster(/.*)?
102 /var/lib/openais(/.*)?
103 /var/lib/pengine(/.*)?
104 /var/lib/corosync(/.*)?
105 /usr/lib/heartbeat(/.*)?
106 /var/lib/heartbeat(/.*)?
107 /var/lib/pacemaker(/.*)?
108
109 cluster_var_run_t
110
111 /var/run/crm(/.*)?
112 /var/run/cman_.*
113 /var/run/rsctmp(/.*)?
114 /var/run/aisexec.*
115 /var/run/heartbeat(/.*)?
116 /var/run/corosync-qnetd(/.*)?
117 /var/run/corosync-qdevice(/.*)?
118 /var/run/corosync.pid
119 /var/run/cpglockd.pid
120 /var/run/rgmanager.pid
121 /var/run/cluster/rgmanager.sk
122
123 mongod_log_t
124
125 /var/log/mongo.*
126 /var/log/aeolus-conductor/dbomatic.log.*
127
128 mongod_var_lib_t
129
130 /var/lib/mongo.*
131
132 mongod_var_run_t
133
134 /var/run/mongo.*
135 /var/run/aeolus/dbomatic.pid
136
137 root_t
138
139 /sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
140 /
141 /initrd
142
143
145 SELinux requires files to have an extended attribute to define the file
146 type.
147
148 You can see the context of a file using the -Z option to ls
149
150 Policy governs the access confined processes have to these files.
151 SELinux mongod policy is very flexible allowing users to setup their
152 mongod processes in as secure a method as possible.
153
154 STANDARD FILE CONTEXT
155
156 SELinux defines the file context types for the mongod, if you wanted to
157 store files with these types in a diffent paths, you need to execute
158 the semanage command to sepecify alternate labeling and then use
159 restorecon to put the labels on disk.
160
161 semanage fcontext -a -t mongod_tmp_t '/srv/mymongod_content(/.*)?'
162 restorecon -R -v /srv/mymongod_content
163
164 Note: SELinux often uses regular expressions to specify labels that
165 match multiple files.
166
167 The following file types are defined for mongod:
168
169
170
171 mongod_exec_t
172
173 - Set files with the mongod_exec_t type, if you want to transition an
174 executable to the mongod_t domain.
175
176
177 Paths:
178 /usr/bin/mongod, /usr/bin/mongos, /usr/libexec/mongodb-scl-helper,
179 /usr/share/aeolus-conductor/dbomatic/dbomatic
180
181
182 mongod_initrc_exec_t
183
184 - Set files with the mongod_initrc_exec_t type, if you want to transi‐
185 tion an executable to the mongod_initrc_t domain.
186
187
188 Paths:
189 /etc/rc.d/init.d/mongod, /etc/rc.d/init.d/mongos
190
191
192 mongod_log_t
193
194 - Set files with the mongod_log_t type, if you want to treat the data
195 as mongod log data, usually stored under the /var/log directory.
196
197
198 Paths:
199 /var/log/mongo.*, /var/log/aeolus-conductor/dbomatic.log.*
200
201
202 mongod_tmp_t
203
204 - Set files with the mongod_tmp_t type, if you want to store mongod
205 temporary files in the /tmp directories.
206
207
208
209 mongod_unit_file_t
210
211 - Set files with the mongod_unit_file_t type, if you want to treat the
212 files as mongod unit content.
213
214
215 Paths:
216 /usr/lib/systemd/system/mongod.*, /usr/lib/systemd/system/mongos.*
217
218
219 mongod_var_lib_t
220
221 - Set files with the mongod_var_lib_t type, if you want to store the
222 mongod files under the /var/lib directory.
223
224
225
226 mongod_var_run_t
227
228 - Set files with the mongod_var_run_t type, if you want to store the
229 mongod files under the /run or /var/run directory.
230
231
232 Paths:
233 /var/run/mongo.*, /var/run/aeolus/dbomatic.pid
234
235
236 Note: File context can be temporarily modified with the chcon command.
237 If you want to permanently change the file context you need to use the
238 semanage fcontext command. This will modify the SELinux labeling data‐
239 base. You will need to use restorecon to apply the labels.
240
241
243 semanage fcontext can also be used to manipulate default file context
244 mappings.
245
246 semanage permissive can also be used to manipulate whether or not a
247 process type is permissive.
248
249 semanage module can also be used to enable/disable/install/remove pol‐
250 icy modules.
251
252 semanage port can also be used to manipulate the port definitions
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), mongod(8), semanage(8), restorecon(8), chcon(1), sepol‐
267 icy(8), setsebool(8)
268
269
270
271mongod 20-05-05 mongod_selinux(8)