Using SELinux with SAP Workloads
SUSE Linux Enterprise Server 16.0 automatically configures SELinux to support SAP workloads out of the box. The default configuration ensures a seamless deployment process and allows administrators to safely validate security policies.
1 How does SLES handle SELinux for SAP workloads? #
By default, SUSE Linux Enterprise Server 16.0 enhances security by enabling SELinux in enforcing mode. When SAP patterns are installed, the operating system automatically adjusts its security policies:
The SELinux mode changes from enforcing to permissive. In the permissive mode, SELinux is active and access denial entries are logged, but no access is denied. This configuration allows administrators to review their local setup and adjust SELinux policies before switching to enforcing mode.
SAP software runs in an unconfined domain. Unconfined domain means that there are no restrictions on the SAP software. It can access system resources without SELinux control.
This configuration ensures that the operating system is fully prepared for SAP software installations.
For more information about SELinux, see Understanding SELinux Basics.
2 SELinux support with SAP software #
By default, after installing any SAP pattern, SUSE Linux Enterprise Server is automatically configured with SELinux enabled in permissive mode and SAP software in the unconfined domain. No further action is required before the installation.
Validation states differ depending on the SAP workload:
SAP HANA is validated on SLES 16.0 in both permissive and enforcing modes. For more information, see SAP Note 3577842.
Other SAP software is validated on SLES 16.0 in permissive mode only. For more information, see SAP Note 3565382.
3 Relabeling the system after SAP software installations #
After installing SAP software, relabel the freshly installed files so they receive the correct security contexts.
To relabel the system, choose one of the following methods:
Use the
restoreconcommand:>sudorestorecon -Rv /Then restart all SAP services.
Create the
.autorelabelfile in the root (/) partition and reboot the system. The system will automatically relabel all files during the next reboot:>sudotouch /.autorelabel>sudoreboot
4 Resolving SELinux access violations #
When SELinux denies permission to access an object, it creates an audit log using Access Vector Cache (AVC) denials.
Because SUSE Linux Enterprise Server defaults to permissive mode after installing SAP patterns, administrators can identify and resolve potential security issues without disrupting the system. If you are running SAP HANA, resolving these violations is a required step before you transition the system to enforcing mode.
Search for the AVC denials with the ausearch utility by running the
following command:
>sudoausearch -m AVC -ts boottype=AVC msg=audit(1784184190.493:34): avc: denied { name_connect } for pid=857 comm="erts_sched_1" dest=5432 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:postgresql_port_t:s0 tclass=tcp_socket permissive=1
For more information on how to address the AVC denials, see SELinux troubleshooting.
5 Switching to enforcing mode #
An administrator can switch to enforcing mode after the SAP HANA setup is tested and no access violations occur.
Switching to enforcing mode is currently supported for SAP HANA workloads only. Other SAP software must remain in permissive mode.
To change to SELinux enforcing mode, follow the steps described in Changing the SELinux mode.
6 Troubleshooting the SAP SELinux configuration #
If you encounter issues with running SAP software under SELinux, first verify that the selinux-policy-sapenablement package is installed. This package is automatically installed as part of any SAP pattern.
>rpm -q selinux-policy-sapenablementselinux-policy-sapenablement-1-160000.2.3.noarch
For additional troubleshooting, see SELinux troubleshooting.
7 Legal Notice #
Copyright© 2006– 2026 SUSE LLC and contributors. All rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”.
For SUSE trademarks, see https://www.suse.com/company/legal/. All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its affiliates. Asterisks (*) denote third-party trademarks.
All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its affiliates, the authors, nor the translators shall be held liable for possible errors or the consequences thereof.