The wikis are now using the new authentication system.
If you did not migrate your account yet, visit https://idp-portal-info.suse.com/

Portal:MicroOS/SELinux

Jump to: navigation, search

SELinux is a security enhancement to Linux which allows users and administrators more control over access control.

It consist of a policy loaded on the system at boot time which constrained the access of users and applications to resources.

Quick Start

After installing openSUSE MicroOS, just run:

 transactional-update setup-selinux

and reboot the system.

The output of sestatus should be something like:

 SELinux status:                 enabled
 SELinuxfs mount:                /sys/fs/selinux
 SELinux root directory:         /etc/selinux
 Loaded policy name:             targeted
 Current mode:                   enforcing
 Mode from config file:          enforcing
 Policy MLS status:              enabled
 Policy deny_unknown status:     allowed
 Memory protection checking:     requested (insecure)
 Max kernel policy version:      31

Configuration

Kernel commandline options

SELinux can only be enabled or disabled during boot via kernel commandline options. The deprecated interface to disable it from userland got disabled.

  • Enable SELinux in enforcing mode: security=selinux selinux=1
  • Enable SELinux in permissive mode: security=selinux selinux=1 enforcing=0
  • Disable SELinux: selinux=0

Configuration file

The configuration file /etc/selinux/config contains:

  • SELINUX=[enforcing|permissive] to configure enforcing or permissive mode.
  • SELINUXTYPE=targeted to specify the to be loaded policy. Currently only targeted is supported.

Relabel of filesystem

During boot, the filesystem can be relabed. There are two ways to start this process during the next reboot: touch /etc/selinux/.autorelabel and reboot or use the autorelabel kernel commandline option at the next reboot.

The standard file /.autorelabel can not be used, as the root filesystem is read-only and thus not writeable. To enforce the relabeling of all files, use echo "-F" > /etc/selinux/.autorelabel.


Container

Volumes

Using volumes with podman or docker:

  •  :z will relabel with a shared label so other containers ran read and write the volume.
  •  :Z will relabel with a private label so that only this specific container can read and write the volume.

Documentation

Mailing List

The SELinux mailing list for openSUSE is: selinux@lists.opensuse.org

To subscribe visit https://lists.opensuse.org/manage/lists/selinux.lists.opensuse.org/ or send a mail to selinux-join@lists.opensuse.org

List Archive: https://lists.opensuse.org/archives/list/selinux@lists.opensuse.org