Bug 2457951 - Update SELinux policy so that 389ds supports NoNewPrileges in dirsrv service units
Summary: Update SELinux policy so that 389ds supports NoNewPrileges in dirsrv service ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 43
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/389ds/389-ds-base/...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-04-13 18:32 UTC by Pierre Rogier
Modified: 2026-04-30 01:21 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-43.7-1.fc43
Clone Of:
Environment:
Last Closed: 2026-04-30 01:21:06 UTC
Type: ---
Embargoed:
zpytela: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 3170 0 None open Allow init nnp domain transition do dirsrv_t and dirsrv_snmp_t 2026-04-24 09:46:11 UTC

Description Pierre Rogier 2026-04-13 18:32:33 UTC
Getting the following AVC when trying to harden dirsrv service units by setting NoNewPrivileges and MemoryDenyWriteExecute:



type=AVC msg=audit(1775741107.400:9691): avc:  denied  { nnp_transition } for  pid=980206 comm="(ns-slapd)" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:dirsrv_t:s0 tclass=process2 permissive=0
type=AVC msg=audit(1775833368.436:10776): avc:  denied  { nnp_transition } for  pid=1113882 comm="(ap-agent)" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:dirsrv_snmp_t:s0 tclass=process2 permissive=0
type=AVC msg=audit(1775833368.442:10778): avc:  denied  { read } for  pid=1113882 comm="ldap-agent" name="ldap-agent.conf" dev="dm-0" ino=12772110 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:dirsrv_config_t:s0 tclass=file permissive=0
type=AVC msg=audit(1775834425.008:10833): avc:  denied  { dac_override } for  pid=1114135 comm="ldap-agent" capability=1  scontext=system_u:system_r:dirsrv_snmp_t:s0 tcontext=system_u:system_r:dirsrv_snmp_t:s0 tclass=capability permissive=0

So we need the following rules:

;============= init_t ==============

;!!!! This avc is allowed in the current policy
(allow init_t dirsrv_config_t (file (read)))

;!!!! This avc is allowed in the current policy
(allow init_t dirsrv_snmp_t (process2 (nnp_transition)))

;!!!! This avc is allowed in the current policy
(allow init_t dirsrv_t (process2 (nnp_transition)))



What is the impact of this issue to you?

Please provide the package NVR for which the bug is seen:
I saw it first with selinux-policy-42.24-1.fc42 but our original target is RHEL 10.3 

How reproducible is this bug?:
systematic








Reproducible: Always

Steps to Reproduce:
# install ldap directory server package:
dnf install -y 389-ds-base
# Create an ldap directory server instance:
echo "
[general]
[slapd]
instance_name = i
root_password = secret12
create_suffix_entry = True
sample_entries = yes
suffix = dc=example,dc=com
" > dirsrv-i.conf
dscreate from-file $PWD/dirsrv-i.conf
# Stop dirsrv instance
systemctl dirsrv@i stop
# 
cp /usr/lib/systemd/system/dirsrv@.service.d/custom.conf /etc/systemd/system/dirsrv@.service.d/custom.conf
# Edit /etc/systemd/system/dirsrv@.service.d/custom.conf to add the following in [Service] Section:
NoNewPrivileges=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=~memfd_create
# - reload systemd configuration: 
systemctl daemon-reload
# - restart the dirsrv service: 
systemctl restart dirsrv
# Without the proper SELinux policy the service fails to start
# Delete ldap directory server instance i
dsctl i delete --do-it

Actual Results:
dirsrv@i service and dirsrv-snmp services fails to start once service units are hardened

Expected Results:
dirsrv@i service and dirsrv-snmp services should start successfully

Additional Information:
Prevent hardening security of dirsrv service by blocking issue https://github.com/389ds/389-ds-base/issues/7391
and RHEL 10.3 ticket https://redhat.atlassian.net/browse/RHEL-153372

Comment 1 Pierre Rogier 2026-04-13 18:35:08 UTC
Note: The dac_override AVC should not be fixed at SELinux policy level but at 389-ds-base level

Comment 2 Fedora Update System 2026-04-28 15:55:49 UTC
FEDORA-2026-80879d3dfe (selinux-policy-43.7-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-80879d3dfe

Comment 3 Fedora Update System 2026-04-29 03:12:24 UTC
FEDORA-2026-80879d3dfe has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-80879d3dfe`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-80879d3dfe

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2026-04-30 01:21:06 UTC
FEDORA-2026-80879d3dfe (selinux-policy-43.7-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.