1container_selinux(8) SELinux Policy container container_selinux(8)
2
3
4
6 container_selinux - Security Enhanced Linux Policy for the container
7 processes
8
10 Security-Enhanced Linux secures the container processes via flexible
11 mandatory access control.
12
13 The container processes execute with the container_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 container_t
20
21
22
24 SELinux defines process types (domains) for each process running on the
25 system
26
27 You can see the context of a process using the -Z option to ps
28
29 Policy governs the access confined processes have to files. SELinux
30 container policy is very flexible allowing users to setup their con‐
31 tainer processes in as secure a method as possible.
32
33 The following process types are defined for container:
34
35 container_t
36
37 Note: semanage permissive -a container_t can be used to make the
38 process type container_t permissive. SELinux does not deny access to
39 permissive process types, but the AVC (SELinux denials) messages are
40 still generated.
41
42
44 The SELinux process type container_t is an MCS (Multi Category Secu‐
45 rity) constrained type. Sometimes this separation is referred to as
46 sVirt. These types are usually used for securing multi-tenant environ‐
47 ments, such as virtualization, containers or separation of users. The
48 tools used to launch MCS types, pick out a different MCS label for each
49 process group.
50
51 For example one process might be launched with container_t:s0:c1,c2,
52 and another process launched with container_t:s0:c3,c4. The SELinux
53 kernel only allows these processes can only write to content with a
54 matching MCS label, or a MCS Label of s0. A process running with the
55 MCS level of s0:c1,c2 is not allowed to write to content with the MCS
56 label of s0:c3,c4
57
58
60 SELinux policy is customizable based on least access required. con‐
61 tainer policy is extremely flexible and has several booleans that allow
62 you to manipulate the policy and run container with the tightest access
63 possible.
64
65
66
67 If you want to deny any process from ptracing or debugging any other
68 processes, you must turn on the deny_ptrace boolean. Enabled by
69 default.
70
71 setsebool -P deny_ptrace 1
72
73
74
75 If you want to allow all domains to execute in fips_mode, you must turn
76 on the fips_mode boolean. Enabled by default.
77
78 setsebool -P fips_mode 1
79
80
81
83 The SELinux process type container_t can manage files labeled with the
84 following file types. The paths listed are the default paths for these
85 file types. Note the processes UID still need to have DAC permissions.
86
87 cephfs_t
88
89
90 cifs_t
91
92
93 container_file_t
94
95 /var/lib/rkt/cas(/.*)?
96
97 fusefs_t
98
99 /var/run/user/[^/]*/gvfs
100
101 hugetlbfs_t
102
103 /dev/hugepages
104 /usr/lib/udev/devices/hugepages
105
106 nfs_t
107
108
109
111 SELinux requires files to have an extended attribute to define the file
112 type.
113
114 You can see the context of a file using the -Z option to ls
115
116 Policy governs the access confined processes have to these files.
117 SELinux container policy is very flexible allowing users to setup their
118 container processes in as secure a method as possible.
119
120 STANDARD FILE CONTEXT
121
122 SELinux defines the file context types for the container, if you wanted
123 to store files with these types in a diffent paths, you need to execute
124 the semanage command to sepecify alternate labeling and then use
125 restorecon to put the labels on disk.
126
127 semanage fcontext -a -t container_ro_file_t '/srv/mycontainer_con‐
128 tent(/.*)?'
129 restorecon -R -v /srv/mycontainer_content
130
131 Note: SELinux often uses regular expressions to specify labels that
132 match multiple files.
133
134 The following file types are defined for container:
135
136
137
138 container_file_t
139
140 - Set files with the container_file_t type, if you want to treat the
141 files as container content.
142
143
144
145 container_ro_file_t
146
147 - Set files with the container_ro_file_t type, if you want to treat the
148 files as container ro content.
149
150
151
152 Note: File context can be temporarily modified with the chcon command.
153 If you want to permanently change the file context you need to use the
154 semanage fcontext command. This will modify the SELinux labeling data‐
155 base. You will need to use restorecon to apply the labels.
156
157
159 semanage fcontext can also be used to manipulate default file context
160 mappings.
161
162 semanage permissive can also be used to manipulate whether or not a
163 process type is permissive.
164
165 semanage module can also be used to enable/disable/install/remove pol‐
166 icy modules.
167
168 semanage boolean can also be used to manipulate the booleans
169
170
171 system-config-selinux is a GUI tool available to customize SELinux pol‐
172 icy settings.
173
174
176 This manual page was auto-generated using sepolicy manpage .
177
178
180 selinux(8), container(8), semanage(8), restorecon(8), chcon(1), sepol‐
181 icy(8), setsebool(8)
182
183
184
185container 19-10-08 container_selinux(8)