{"id":4491,"date":"2022-12-20T18:08:48","date_gmt":"2022-12-20T21:08:48","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/selinux_config-man5\/"},"modified":"2022-12-20T18:08:48","modified_gmt":"2022-12-20T21:08:48","slug":"selinux_config-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/selinux_config-man5\/","title":{"rendered":"selinux_config (man5)"},"content":{"rendered":"<h1 align=\"center\">selinux_config<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#FILE FORMAT\">FILE FORMAT<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">config \u2212 The SELinux sub-system configuration file.<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The SELinux <i>config<\/i> file controls the state of SELinux regarding:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"3%\">\n<p>1.<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"72%\">\n<p>The policy enforcement status \u2212 <i>enforcing<\/i>, <i>permissive<\/i> or <i>disabled<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"3%\">\n<p>2.<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"72%\">\n<p>The policy name or type that forms a path to the policy to be loaded and its supporting configuration files.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"3%\">\n<p>3.<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"72%\">\n<p>How SELinux-aware login applications should behave if no valid SELinux users are configured.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"22%\"><\/td>\n<td width=\"3%\">\n<p>4.<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"72%\">\n<p>Whether the system is to be relabeled or not.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The entries controlling these functions are described in the <b>FILE FORMAT<\/b> section.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The fully qualified path name of the SELinux configuration file is <i>\/etc\/selinux\/config<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>config<\/i> file is missing or corrupt, then no SELinux policy is loaded (i.e. SELinux is disabled).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>sestatus<\/b> (8) command and the libselinux function <b>selinux_path<\/b> (3) will return the location of the <i>config<\/i> file.<\/p>\n<h2>FILE FORMAT <a name=\"FILE FORMAT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>config<\/i> file supports the following parameters:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>SELINUX =<\/b> <i>enforcing<\/i> | <i>permissive<\/i> | <i>disabled<\/i> <b><br \/> SELINUXTYPE =<\/b> <i>policy_name<\/i> <b><br \/> REQUIREUSERS =<\/b> <i>0<\/i> | <i>1<\/i> <b><br \/> AUTORELABEL =<\/b> <i>0<\/i> | <i>1<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Where: <b><br \/> SELINUX<\/b><\/p>\n<p style=\"margin-left:22%;\">This entry can contain one of three values:<\/p>\n<p style=\"margin-left:32%;\"><i>enforcing<\/i><\/p>\n<p style=\"margin-left:38%;\">SELinux security policy is enforced.<\/p>\n<p style=\"margin-left:32%;\"><i>permissive<\/i><\/p>\n<p style=\"margin-left:38%;\">SELinux security policy is not enforced but logs the warnings (i.e. the action is allowed to proceed).<\/p>\n<p style=\"margin-left:32%;\"><i>disabled<\/i><\/p>\n<p style=\"margin-left:38%;\">No SELinux policy is loaded. This option was used to disable SELinux completely, which is now deprecated. Use the <b>selinux=0<\/b> kernel boot option instead (see <b>selinux<\/b>(8)).<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The entry can be determined using the <b>sestatus<\/b>(8) command or <b>selinux_getenforcemode<\/b>(3).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>SELINUXTYPE<\/b><\/p>\n<p style=\"margin-left:22%;\">The <i>policy_name<\/i> entry is used to identify the policy type, and becomes the directory name of where the policy and its configuration files are located.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The entry can be determined using the <b>sestatus<\/b>(8) command or <b>selinux_getpolicytype<\/b>(3).<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The <i>policy_name<\/i> is relative to a path that is defined within the SELinux subsystem that can be retrieved by using <b>selinux_path<\/b>(3). An example entry retrieved by <b>selinux_path<\/b>(3) is:<\/p>\n<p style=\"margin-left:32%;\"><i>\/etc\/selinux\/<\/i><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The <i>policy_name<\/i> is then appended to this and becomes the \u2019policy root\u2019 location that can be retrieved by <b>selinux_policy_root_path<\/b>(3). An example entry retrieved is:<\/p>\n<p style=\"margin-left:32%;\"><i>\/etc\/selinux\/targeted<\/i><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The actual binary policy is located relative to this directory and also has a policy name pre-allocated. This information can be retrieved using <b>selinux_binary_policy_path<\/b>(3). An example entry retrieved by <b>selinux_binary_policy_path<\/b>(3) is:<\/p>\n<p style=\"margin-left:32%;\"><i>\/etc\/selinux\/targeted\/policy\/policy<\/i><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">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 <b>sestatus<\/b>(8) command or <b>security_policyvers<\/b>(3). An example binary policy file with the version is:<\/p>\n<p style=\"margin-left:32%;\"><i>\/etc\/selinux\/targeted\/policy\/policy.24<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>REQUIRESEUSERS<\/b><\/p>\n<p style=\"margin-left:22%;\">This optional entry can be used to fail a login if there is no matching or default entry in the <b>seusers<\/b>(5) file or if the <b>seusers<\/b> file is missing.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">It is checked by <b>getseuserbyname<\/b>(3) that is called by SELinux-aware login applications such as <b>PAM<\/b>(8).<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If set to <i>0<\/i> or the entry missing:<\/p>\n<p style=\"margin-left:32%;\"><b>getseuserbyname<\/b>(3) will return the GNU \/ Linux user name as the SELinux user.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If set to <i>1<\/i>:<\/p>\n<p style=\"margin-left:32%;\"><b>getseuserbyname<\/b>(3) will fail.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The <b>getseuserbyname<\/b>(3) man page should be consulted for its use. The format of the <i>seusers<\/i> file is shown in <b>seusers<\/b>(5).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>AUTORELABEL<\/b><\/p>\n<p style=\"margin-left:22%;\">This is an optional entry that allows the file system to be relabeled.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If set to <i>0<\/i> and there is a file called <i>.autorelabel<\/i> 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.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">If set to <i>1<\/i> or no entry present (the default) and there is a <i>.autorelabel<\/i> file in the root directory, then the file system will be automatically relabeled using <b>fixfiles \u2212F restore<\/b><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">In both cases the <i>\/.autorelabel<\/i> file will be removed so that relabeling is not done again.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This example <i>config<\/i> file shows the minimum contents for a system to run SELinux in enforcing mode, with a <i>policy_name<\/i> of \u2019targeted\u2019:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">SELINUX = enforcing <br \/> SELINUXTYPE = targeted<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>selinux<\/b>(8), <b>sestatus<\/b>(8), <b>selinux_path<\/b>(3), <b>selinux_policy_root_path<\/b>(3), <b>selinux_binary_policy_path<\/b>(3), <b>getseuserbyname<\/b>(3), <b>PAM<\/b>(8), <b>fixfiles<\/b>(8), <b>selinux_mkload_policy<\/b>(3), <b>selinux_getpolicytype<\/b>(3), <b>security_policyvers<\/b>(3), <b>selinux_getenforcemode<\/b>(3), <b>seusers<\/b>(5)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  config \u2212 The SELinux sub-system configuration file. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1463],"class_list":["post-4491","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-selinux_config"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4491"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4491\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}