Skip to main content
Provides operations to set SELinux file contexts, booleans and port types.

Functions

selinux.boolean

Set the specified SELinux boolean to the desired state.
This operation requires root privileges.

selinux.file_context

Set the SELinux type for the specified path to the specified value.

selinux.file_context_mapping

Set the SELinux file context mapping for paths matching the target.
file_context_mapping does not change the SELinux file context for existing files so restorecon may need to be run manually if the file contexts cannot be created before the related files.

selinux.port

Set the SELinux type for the specified protocol and port.
This operation requires root privileges.

Examples