If SELinux is available for the running system, the mode can be managed and booleans can be set.
enforcing:
selinux.mode
samba_create_home_dirs:
selinux.boolean:
- value: True
- persist: True
nginx:
selinux.module:
- enabled: False
Note
Use of these states require that the selinux
execution module is available.
Set up an SELinux boolean
The name of the boolean to set
The value to set on the boolean
Defaults to False, set persist to true to make the boolean apply on a reboot
New in version 2017.7.0.
Makes sure an SELinux file context policy for a given filespec (name), filetype and SELinux context type is absent.
filespec of the file or directory. Regex syntax is allowed.
The SELinux filetype specification. Use one of [a, f, d, c, b, s, l, p]. See also man semanage-fcontext. Defaults to 'a' (all files).
The SELinux context type. There are many.
The SELinux user.
The SELinux MLS range.
New in version 2017.7.0.
Checks and makes sure the SELinux policies for a given filespec are applied.
New in version 2017.7.0.
Makes sure a SELinux policy for a given filespec (name), filetype and SELinux context type is present.
filespec of the file or directory. Regex syntax is allowed.
SELinux context type. There are many.
The SELinux filetype specification. Use one of [a, f, d, c, b, s, l, p]. See also man semanage-fcontext. Defaults to 'a' (all files).
The SELinux user.
The SELinux MLS range.
Verifies the mode SELinux is running in, can be set to enforcing, permissive, or disabled
Note
A change to or from disabled mode requires a system reboot. You will need to perform this yourself.
The mode to run SELinux in, permissive, enforcing, or disabled.
Enable/Disable and optionally force a specific version for an SELinux module
The name of the module to control
Should the module be enabled or disabled?
Defaults to no preference, set to a specified value if required. Currently can only alert if the version is incorrect.
Setting to True installs module
Points to module source file, used only when install is True
Setting to True removes module
New in version 2016.3.0.
Installs custom SELinux module from given file
Path to file with module to install
New in version 2016.11.6.
Removes SELinux module
The name of the module to remove
New in version 2016.11.6.
New in version 2019.2.0.
Makes sure an SELinux port policy for a given port, protocol and SELinux context type is absent.
The protocol and port spec. Can be formatted as (tcp|udp)/(port|port-range)
.
The SELinux Type. Optional; can be used in determining if policy is present,
ignored by semanage port --delete
.
The protocol for the port, tcp
or udp
. Required if name is not formatted.
The port or port range. Required if name is not formatted.
New in version 2019.2.0.
Makes sure an SELinux port policy for a given port, protocol and SELinux context type is present.
The protocol and port spec. Can be formatted as (tcp|udp)/(port|port-range)
.
The SELinux Type.
The protocol for the port, tcp
or udp
. Required if name is not formatted.
The port or port range. Required if name is not formatted.
The SELinux MLS/MCS Security Range.