Security enhanced Linux
Define on every file what are they allowed to access ## Contianers
[Selinux Containers]({{\< ref
“posts/redhat/selinux_containers.md”>}})
Policies
[Selinux Policies]({{\< ref “posts/redhat/selinux_policies.md”>}})
Modes
- Enforcing checking the attribute of the files does’t let them access it
- Permissive Only logs the check
- Disabled
Types
-
Targeted Targeted processes are protected
-
Minimum Only selected processes are targeted
-
Mls Multi Level security protection >[!example]- >
### Labels >[!example] It’s a label on the file >
-
User User mapped to the Selinux
-
Role What a user or daemon can do with the file
-
Type What kind of object is it
- It’t insert context on a new file not if the file is moved
-
Sensitivity level Only in Mls
-
To display it
Changing context
- chcon Changes the type for new
- restorecon
- set’s the proper context for the file
[!tip] To change the conetex for all the files add /.autorelable
Logging
Hole SELinux message can usually be spotted via journalctl and searching for SELinux.
Or to use what journalctl uses under the hood, which is
/var/log/messages
.
The other way around is if the auditd is enabled.
Updating Policies
[Selinux Policies]({{\< ref “posts/redhat/selinux_policies.md”>}})
Occasionally, programs may attempt to access different user contents using their policies. However, SELinux may block such attempts, even when the set option is correct. In such cases, you need to adjust the SELinux boolean settings.