{"id":1852,"date":"2018-10-28T05:47:35","date_gmt":"2018-10-28T05:47:35","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=1852"},"modified":"2018-10-28T06:06:18","modified_gmt":"2018-10-28T06:06:18","slug":"selinux-introduction-in-centos-7","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/28\/selinux-introduction-in-centos-7\/","title":{"rendered":"SELinux Introduction In CentOS 7"},"content":{"rendered":"<h3>What is SELinux?<\/h3>\n<p>Security-Enhanced Linux (SELinux) was developed to provide access control for linux. It goes beyond file permissions and ACLs to create a more secure environment by limiting access. It is based on subjects, objects, and actions. A subject is the running command or application(example proftpd), the object is anything that can be accessed by that object, and the action is what can be done to that object by the subject.<\/p>\n<h3>Modes of Operation<\/h3>\n<p>There are 3 different modes that cause the protection to be different.<\/p>\n<p>Enforcing \u2013 The configuration will actively be enforced<br \/>\nPermissive \u2013 The configuration will be monitored but not enforced<br \/>\nDisabled \u2013 The configuration with neither be monitored or enforced, essentially the service is completely disabled<\/p>\n<p>To change modes without a reboot you would want to use setenforce, for example to make it permissive you would do<\/p>\n<p>setenforce permissive<\/p>\n<p>To change modes permanently you would want to update \/etc\/selinux\/config and uncomment the appropriate one.<\/p>\n<p># SELINUX= can take one of these three values:<br \/>\n# enforcing &#8211; SELinux security policy is enforced.<br \/>\n# permissive &#8211; SELinux prints warnings instead of enforcing.<br \/>\n# disabled &#8211; No SELinux policy is loaded.<br \/>\nSELINUX=enforcing<\/p>\n<p>A reboot will be needed to make the change take effect.<\/p>\n<h3>Configure Users<\/h3>\n<p>to check current users type the following:<\/p>\n<p># semanage login -l<\/p>\n<p>Login Name SELinux User MLS\/MCS Range Service<\/p>\n<p>__default__ unconfined_u s0-s0:c0.c1023 *<br \/>\nroot unconfined_u s0-s0:c0.c1023 *<br \/>\nsystem_u system_u s0-s0:c0.c1023 *<\/p>\n<p>To add a new user, replacing newusername with the user<\/p>\n<p>semanage login -a -s user_u newusername<\/p>\n<h3>Boolean Settings<\/h3>\n<p>Boolean settings are either turned on by setting them to a 1(on) or off (0), they give access to numerous utilities and functions within the system<\/p>\n<p>To view all of the possible settings type<\/p>\n<p>getsebool<\/p>\n<p>To enable or disable one of them use<\/p>\n<p>setsebool &lt;setting_name&gt; on<\/p>\n<p>or<\/p>\n<p>setsebool &lt;setting_name&gt; off<\/p>\n<p>We will be adding another section on file management which is another control system of SELinux shortly.<\/p>\n<p><a href=\"https:\/\/linuxadmin.io\/selinux-introduction-centos-7\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is SELinux? Security-Enhanced Linux (SELinux) was developed to provide access control for linux. It goes beyond file permissions and ACLs to create a more secure environment by limiting access. It is based on subjects, objects, and actions. A subject is the running command or application(example proftpd), the object is anything that can be accessed &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/28\/selinux-introduction-in-centos-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SELinux Introduction In CentOS 7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1852","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=1852"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1852\/revisions"}],"predecessor-version":[{"id":1882,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1852\/revisions\/1882"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=1852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=1852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=1852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}