Debian Codegraph @

policycoreutils/man/man5/selinux_config.5

raw
1 .TH "selinux_config" "5" "18 Nov 2011" "Security Enhanced Linux" "SELinux configuration file"
2
3 .SH "NAME"
4 config \- The SELinux sub-system configuration file.
5
6 .SH "DESCRIPTION"
7 The SELinux \fIconfig\fR file controls the state of SELinux regarding:
8 .RS
9 .IP "1." 4
10 The policy enforcement status \- \fIenforcing\fR, \fIpermissive\fR or \fIdisabled\fR.
11 .IP "2." 4
12 The policy name or type that forms a path to the policy to be loaded and its supporting configuration files.
13 .IP "3." 4
14 How local users and booleans will be managed when the policy is loaded (note that this function was used by older releases of SELinux and is now deprecated).
15 .IP "4." 4
16 How SELinux-aware login applications should behave if no valid SELinux users are configured.
17 .IP "5." 4
18 Whether the system is to be relabeled or not.
19 .RE
20
21 The entries controlling these functions are described in the \fBFILE FORMAT\fR section.
22 .sp
23 The fully qualified path name of the SELinux configuration file is \fI/etc/selinux/config\fR.
24 .sp
25 If the \fIconfig\fR file is missing or corrupt, then no SELinux policy is loaded (i.e. SELinux is disabled).
26 .sp
27 The \fBsestatus\fR (8) command and the libselinux function \fBselinux_path\fR (3) will return the location of the \fIconfig\fR file.
28
29 .SH "FILE FORMAT"
30 The \fIconfig\fR file supports the following parameters:
31 .sp
32 .RS
33 \fBSELINUX = \fIenforcing\fR | \fIpermissive\fR | \fIdisabled\fR
34 .br
35 \fBSELINUXTYPE = \fIpolicy_name\fR
36 .br
37 \fBSETLOCALDEFS = \fI0\fR | \fI1\fR
38 .br
39 \fBREQUIREUSERS = \fI0\fR | \fI1\fR
40 .br
41 \fBAUTORELABEL = \fI0\fR | \fI1\fR
42 .RE
43 .sp
44 Where:
45 .br
46 .B SELINUX
47 .RS
48 This entry can contain one of three values:
49 .RS
50 .IP \fIenforcing\fR 4
51 SELinux security policy is enforced.
52 .IP \fIpermissive\fR 4
53 SELinux security policy is not enforced but logs the warnings (i.e. the action is allowed to proceed).
54 .IP \fIdisabled\fR
55 SELinux is disabled and no policy is loaded.
56 .RE
57 .sp
58 The entry can be determined using the \fBsestatus\fR(8) command or \fBselinux_getenforcemode\fR(3).
59 .RE
60 .sp
61 .B SELINUXTYPE
62 .RS
63 The \fIpolicy_name\fR entry is used to identify the policy type, and becomes the directory name of where the policy and its configuration files are located.
64 .sp
65 The entry can be determined using the \fBsestatus\fR(8) command or \fBselinux_getpolicytype\fR(3).
66 .sp
67 The \fIpolicy_name\fR is relative to a path that is defined within the SELinux subsystem that can be retrieved by using \fBselinux_path\fR(3). An example entry retrieved by \fBselinux_path\fR(3) is:
68 .br
69 .RS
70 .I /etc/selinux/
71 .RE
72 .sp
73 The \fIpolicy_name\fR is then appended to this and becomes the 'policy root' location that can be retrieved by \fBselinux_policy_root_path\fR(3). An example entry retrieved is:
74 .RS
75 .I /etc/selinux/targeted
76 .RE
77 .sp
78 The actual binary policy is located relative to this directory and also has a policy name pre-allocated. This information can be retrieved using \fBselinux_binary_policy_path\fR(3). An example entry retrieved by \fBselinux_binary_policy_path\fR(3) is:
79 .br
80 .RS
81 .I /etc/selinux/targeted/policy/policy
82 .RE
83 .sp
84 The binary policy name has by convention the SELinux policy version that it supports appended to it. The maximum policy version supported by the kernel can be determined using the \fBsestatus\fR(8) command or \fBsecurity_policyvers\fR(3). An example binary policy file with the version is:
85 .br
86 .RS
87 .I /etc/selinux/targeted/policy/policy.24
88 .RE
89 .RE
90 .sp
91 .B SETLOCALDEFS
92 .RS
93 This entry is deprecated and should be removed or set to \fI0\fR.
94 .sp
95 If set to \fI1\fR, then \fBselinux_mkload_policy\fR(3) will read the local customization for booleans (see \fBbooleans\fR(5)) and users (see \fBlocal.users\fR(5)).
96 .RE
97 .sp
98 .B REQUIRESEUSERS
99 .RS
100 This optional entry can be used to fail a login if there is no matching or default entry in the
101 .BR seusers "(5) file or if the " seusers " file is missing. "
102 .sp
103 It is checked by \fBgetseuserbyname\fR(3) that is called by SELinux-aware login applications such as \fBPAM\fR(8).
104 .sp
105 If set to \fI0\fR or the entry missing:
106 .RS
107 .BR getseuserbyname "(3) will return the GNU / Linux user name as the SELinux user."
108 .RE
109 .sp
110 If set to \fI1\fR:
111 .RS
112 .BR getseuserbyname "(3) will fail."
113 .RE
114 .sp
115 The \fBgetseuserbyname\fR(3) man page should be consulted for its use. The format of the \fIseusers\fR file is shown in \fBseusers\fR(5).
116 .sp
117 .RE
118 .sp
119 .B AUTORELABEL
120 .RS
121 This is an optional entry that allows the file system to be relabeled.
122 .sp
123 If set to \fI0\fR and there is a file called \fI.autorelabel\fR in the root directory, then on a reboot, the loader will drop to a shell where a root login is required. An administrator can then manually relabel the file system.
124 .sp
125 If set to \fI1\fR or no entry present (the default) and there is a \fI.autorelabel\fR file in the root directory, then the file system will be automatically relabeled using \fBfixfiles \-F restore\fR
126 .sp
127 In both cases the \fI/.autorelabel\fR file will be removed so that relabeling is not done again.
128 .RE
129 .sp
130
131 .SH "EXAMPLE"
132 This example \fIconfig\fR file shows the minimum contents for a system to run SELinux in enforcing mode, with a \fIpolicy_name\fR of 'targeted':
133 .sp
134 .RS
135 SELINUX = enforcing
136 .br
137 SELINUXTYPE = targeted
138 .RE
139
140 .SH "SEE ALSO"
141 .BR selinux "(8), " sestatus "(8), " selinux_path "(3), " selinux_policy_root_path "(3), " selinux_binary_policy_path "(3), " getseuserbyname "(3), " PAM "(8), " fixfiles "(8), " selinux_mkload_policy "(3), " selinux_getpolicytype "(3), " security_policyvers "(3), " selinux_getenforcemode "(3), " seusers "(5), " booleans "(5), " local.users "(5) "