Bug 2222910 - Confine the openarc service
Summary: Confine the openarc service
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2217139
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-14 12:51 UTC by Zdenek Pytela
Modified: 2024-11-27 21:15 UTC (History)
9 users (show)

Fixed In Version:
Clone Of: 2217139
Environment:
Last Closed: 2024-11-27 21:15:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zdenek Pytela 2023-07-14 12:51:16 UTC
+++ This bug was initially created as a clone of Bug #2217139 +++
SELinux blocks openarc / dkim_milter_data_t missing from /run/openarc

Description of problem:

SELinux blocks postfix from connecting to the openarc milter.

Version-Release number of selected component (if applicable):

selinux-policy-38.1.11-2.el9_2.3.noarch


How reproducible:

Always

Steps to Reproduce:
1. Configure postfix to add the openarc milter
2.
3.

Actual results:

type=AVC msg=audit(1687527199.794:156): avc:  denied  { write } for  pid=4174 comm="smtpd" name="openarc.sock" dev="tmpfs" ino=1105 scontext=system_u:system_r:postfix_smtpd_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1


Expected results:

Successful connection.


Additional info:

Current dkim_milter_data_t is as follows.

[root@seawitch ~]# semanage fcontext -l | grep dkim_milter_data_t
/var/lib/dkim-milter(/.*)?                         all files          system_u:object_r:dkim_milter_data_t:s0 
/var/run/dkim-milter(/.*)?                         all files          system_u:object_r:dkim_milter_data_t:s0 
/var/run/opendkim(/.*)?                            all files          system_u:object_r:dkim_milter_data_t:s0 
/var/run/opendmarc(/.*)?                           all files          system_u:object_r:dkim_milter_data_t:s0 
/var/spool/opendkim(/.*)?                          all files          system_u:object_r:dkim_milter_data_t:s0 
/var/spool/opendmarc(/.*)?                         all files          system_u:object_r:dkim_milter_data_t:s0 

The /run/openarc directory is missing:

[root@seawitch ~]# ls -alZ /run/openarc
total 4
drwxr-x---.  2 openarc openarc system_u:object_r:var_run_t:s0   80 Jun 24 10:43 .
drwxr-xr-x. 60 root    root    system_u:object_r:var_run_t:s0 1480 Jun 24 10:44 ..
-rw-rw----.  1 openarc openarc system_u:object_r:var_run_t:s0    5 Jun 24 10:43 openarc.pid
srwxrwx---.  1 openarc openarc system_u:object_r:var_run_t:s0    0 Jun 24 10:43 openarc.sock

Workaround:

semanage fcontext -a -t dkim_milter_data_t '/var/run/openarc(/.*)?'

--- Additional comment from Milos Malik on 2023-06-26 16:25:55 CEST ---

The openarc service is not confined by SELinux. The openarc package comes from EPEL.

# rpm -q openarc
openarc-1.0.0-0.15.Beta3.el9.x86_64
# rpm -ql openarc | xargs matchpathcon
/etc/openarc	system_u:object_r:etc_t:s0
/etc/openarc.conf	system_u:object_r:etc_t:s0
/etc/openarc/PeerList	system_u:object_r:etc_t:s0
/run/openarc	system_u:object_r:var_run_t:s0
/usr/lib/.build-id	system_u:object_r:lib_t:s0
/usr/lib/.build-id/60	system_u:object_r:lib_t:s0
/usr/lib/.build-id/60/c1ee5243451e9e8c2dae2f8e903e29ef117c92	system_u:object_r:lib_t:s0
/usr/lib/systemd/system/openarc.service	system_u:object_r:systemd_unit_file_t:s0
/usr/lib/tmpfiles.d/openarc.conf	system_u:object_r:lib_t:s0
/usr/sbin/openarc	system_u:object_r:bin_t:s0
/usr/share/doc/openarc	system_u:object_r:usr_t:s0
/usr/share/doc/openarc/README	system_u:object_r:usr_t:s0
/usr/share/doc/openarc/RELEASE_NOTES	system_u:object_r:usr_t:s0
/usr/share/doc/openarc/openarc.conf.sample	system_u:object_r:usr_t:s0
/usr/share/licenses/openarc	system_u:object_r:usr_t:s0
/usr/share/licenses/openarc/LICENSE	system_u:object_r:usr_t:s0
/usr/share/licenses/openarc/LICENSE.Sendmail	system_u:object_r:usr_t:s0
/usr/share/man/man5/openarc.conf.5.gz	system_u:object_r:man_t:s0
/usr/share/man/man8/openarc.8.gz	system_u:object_r:man_t:s0
#

Comment 1 Graham Leggett 2023-07-21 18:33:13 UTC
> The openarc service is not confined by SELinux. The openarc package comes from EPEL.

Openarc is a milter, which by definition can only be connected to by postfix/sendmail if openarc is confined by selinux.

Please either:

- Add openarc to dkim_milter_data_t as requested; or
- remove selinux from postfix/sendmail, as the config is not usable without switching selinux off.

Comment 2 Fedora Release Engineering 2023-08-16 08:12:51 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 3 Aoife Moloney 2024-11-08 10:55:43 UTC
This message is a reminder that Fedora Linux 39 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '39'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 39 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Aoife Moloney 2024-11-27 21:15:50 UTC
Fedora Linux 39 entered end-of-life (EOL) status on 2024-11-26.

Fedora Linux 39 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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