Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| selinux [2019/03/15 10:26] – [General] dani | selinux [2024/11/30 11:28] (current) – [Creation of selinux module] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== SELinux ====== | ====== SELinux ====== | ||
| + | This document applies to Fedora 29. But, all should work on CentOS/REL 7. | ||
| ===== General ===== | ===== General ===== | ||
| Before you can work with all the selinux tools, you must install the following packages first: | Before you can work with all the selinux tools, you must install the following packages first: | ||
| <code bash> | <code bash> | ||
| - | dnf -y install python3-policycoreutils policycoreutils-python-utils policycoreutils setroubleshoot-server setools-console libselinux-utils | + | dnf -y install python3-policycoreutils policycoreutils-python-utils policycoreutils setroubleshoot-server setools-console libselinux-utils |
| </ | </ | ||
| ==== File contexts ==== | ==== File contexts ==== | ||
| Line 382: | Line 382: | ||
| * **autorelabel=1** \\ This parameter will force the system to relabel. It does the same thing as “touch / | * **autorelabel=1** \\ This parameter will force the system to relabel. It does the same thing as “touch / | ||
| - | ==== Creation of selinux module ==== | + | ===== Creation of selinux module |
| Sometimes not all rules apply to a application. Then, you need to create your own '' | Sometimes not all rules apply to a application. Then, you need to create your own '' | ||
| Line 420: | Line 420: | ||
| cp local_$p.pp / | cp local_$p.pp / | ||
| </ | </ | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | It's a good idea to use a prefix for the module name (in my case: '' | ||
| + | </ | ||
| + | |||
| <WRAP center round tip 60%> | <WRAP center round tip 60%> | ||
| If you want to create a module for more than one binary (because they are part of an application), | If you want to create a module for more than one binary (because they are part of an application), | ||
| </ | </ | ||
| + | ===== States of selinux ===== | ||
| + | * State of '' | ||
| + | sestatus | ||
| + | SELinux status: | ||
| + | SELinuxfs mount: | ||
| + | SELinux root directory: | ||
| + | Loaded policy name: | ||
| + | Current mode: | ||
| + | Mode from config file: permissive | ||
| + | Policy MLS status: | ||
| + | Policy deny_unknown status: | ||
| + | Memory protection checking: | ||
| + | Max kernel policy version: | ||
| + | </ | ||
| + | * List all loaded '' | ||
| + | semodule -l | ||
| + | </ | ||