Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1819017 - selinux preventing sa-update.cron (SpamAssassin Updater) from restarting SpamAssassin
Summary: selinux preventing sa-update.cron (SpamAssassin Updater) from restarting Spam...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 33
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1831559 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-31 00:08 UTC by Ben Herrick
Modified: 2020-11-12 09:26 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ben Herrick 2020-03-31 00:08:45 UTC
Description of problem:
SpamAssassin installs a systemd timer called sa-update.timer. This timer runs sa-update.service.

Upon update, the sa-update service tries to check the status of, and restart, the spamassassin.service, but fails due to SELinux.

The following error messages are emitted per run:
type=USER_AVC msg=audit(03/30/2020 21:10:35.934:185392) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  denied  { start } for auid=root uid=root gid=root path=/usr/lib/systemd/system/spamassassin.service cmdline="" scontext=system_u:system_r:spamd_update_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=service permissive=0  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(03/30/2020 21:10:42.449:185395) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  denied  { status } for auid=root uid=root gid=root cmdline="" scontext=system_u:system_r:spamd_update_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=system permissive=0  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?'


Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.14.3-56.fc30.noarch
spamassassin-3.4.4-1.fc30.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install SpamAssassin.
2. Wait for sa-update.timer to fire.
3. Watch audit logs for AVC error.

Actual results:
sa-update.timer fails to restart spamassassin.service


Expected results:
sa-update.timer successully restarts spamassassin.service


Additional info:
N/A

Comment 1 Laurent Jacquot 2020-04-11 09:24:10 UTC
Hi,
I've the same problem and managed to cure it using this hand-made module:

before:
# sesearch -A -s spamd_update_t -c service
allow spamd_update_t antivirus_unit_file_t:service { disable enable reload start status stop };

the custom module:
# cat selinux/localSpam.te

module localSpam 1.0;

require {
	type spamd_update_t;
	type init_t;
	type systemd_unit_file_t;
	class service start;
	class system status;
}

#============= spamd_update_t ==============
allow spamd_update_t init_t:system status;
allow spamd_update_t systemd_unit_file_t:service start;

# semodule -i localSpam.pp

and after:
# sesearch -A -s spamd_update_t -c service
allow spamd_update_t antivirus_unit_file_t:service { disable enable reload start status stop };
allow spamd_update_t systemd_unit_file_t:service start;

Thank you Zdenek Pytela for your insights!
Laurent

Comment 2 Laurent Jacquot 2020-04-11 09:26:48 UTC
FYI, I'm on f31
regards
Laurent

Comment 3 Laurent Jacquot 2020-04-13 08:27:42 UTC
allow spamd_update_t systemd_unit_file_t:service status;

is also needed.
regards
Laurent Jacquot

Comment 4 Ben Cotton 2020-04-30 20:14:58 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-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
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2020-11-03 17:09:20 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
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
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Milos Malik 2020-11-04 08:43:53 UTC
----
type=USER_AVC msg=audit(11/04/2020 00:47:08.262:444) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  denied  { start } for auid=unset uid=root gid=root path=/usr/lib/systemd/system/spamassassin.service cmdline="" scontext=system_u:system_r:spamd_update_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=service permissive=0  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(11/04/2020 00:47:08.275:445) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  denied  { status } for auid=unset uid=root gid=root cmdline="" scontext=system_u:system_r:spamd_update_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=system permissive=0  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?' 
----

# rpm -qa selinux\* spam\* | sort
selinux-policy-3.14.6-29.fc33.noarch
selinux-policy-targeted-3.14.6-29.fc33.noarch
spamassassin-3.4.4-6.fc33.x86_64
#

Comment 8 Göran Uddeborg 2020-11-05 20:38:25 UTC
*** Bug 1831559 has been marked as a duplicate of this bug. ***

Comment 9 Göran Uddeborg 2020-11-05 20:43:04 UTC
I noticed this on F32 in my duplicate bug 1831559. Since @mmalik now found it on F33 too, I upgrade the version appropriately.


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