Bug 1658568 - SELinux is preventing epylog from 'read' accesses on the fichier /epylog/__init__.pyc.
Summary: SELinux is preventing epylog from 'read' accesses on the fichier /epylog/__in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: epylog
Version: 29
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Konstantin Ryabitsev
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c61d6c406fc5ea64f942ce032d3...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-12 12:30 UTC by mathieu
Modified: 2019-01-25 02:40 UTC (History)
9 users (show)

Fixed In Version: epylog-1.0.7-25.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-25 02:40:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description mathieu 2018-12-12 12:30:33 UTC
Description of problem:
SELinux is preventing epylog from 'read' accesses on the fichier /epylog/__init__.pyc.

*****  Plugin catchall (100. confidence) suggests   **************************

Si vous pensez que epylog devrait être autorisé à accéder read sur __init__.pyc file par défaut.
Then vous devriez rapporter ceci en tant qu'anomalie.
Vous pouvez générer un module de stratégie local pour autoriser cet accès.
Do
autoriser cet accès pour le moment en exécutant :
# ausearch -c "epylog" --raw | audit2allow -M my-epylog
# semodule -X 300 -i my-epylog.pp

Additional Information:
Source Context                system_u:system_r:logwatch_t:s0-s0:c0.c1023
Target Context                system_u:object_r:default_t:s0
Target Objects                /epylog/__init__.pyc [ file ]
Source                        epylog
Source Path                   epylog
Port                          <Inconnu>
Host                          (removed)
Source RPM Packages           epylog-1.0.7-23.fc29.noarch
Target RPM Packages           epylog-1.0.7-23.fc29.noarch
Policy RPM                    selinux-policy-3.14.2-44.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.19.8-300.fc29.x86_64 #1 SMP Mon
                              Dec 10 15:23:11 UTC 2018 x86_64 x86_64
Alert Count                   2
First Seen                    2018-12-12 13:24:04 CET
Last Seen                     2018-12-12 13:24:04 CET
Local ID                      da2c5006-52f1-4825-bd62-81823d2e2a14

Raw Audit Messages
type=AVC msg=audit(1544617444.666:1346): avc:  denied  { read } for  pid=25676 comm="epylog" name="__init__.pyc" dev="dm-0" ino=262198 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=system_u:object_r:default_t:s0 tclass=file permissive=0


Hash: epylog,logwatch_t,default_t,file,read

Version-Release number of selected component:
selinux-policy-3.14.2-44.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.19.8-300.fc29.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2018-12-12 12:43:52 UTC
Hi, 

This is not bug in SELinux policy. You're using custom path for your sources. 

Please use:

# semanage fcontxt -a -t lib_t /epilog(/.*)? 
# restorecon -Rv /epilog

Thanks,
Lukas.

Comment 2 mathieu 2018-12-12 14:21:54 UTC
Bonjour,

la commande 
# semanage fcontxt -a -t lib_t /epilog(/.*)? 

me marque :

# bash: erreur de syntaxe près du symbole inattendu « ( »

celle ci à fonctionner :
# semanage fcontext -a -t lib_t /epilog 


mais la suivante

# restorecon -Rv /epilog

me marque 

# restorecon: lstat(/epilog) failed: No such file or directory




dois je essayer ?
Vous devriez rapporter ceci en tant qu'anomalie.
Vous pouvez générer un module de stratégie local pour autoriser cet accès.
Autoriser cet accès pour le moment en exécutant :
# ausearch -c "epylog" --raw | audit2allow -M my-epylog
# semodule -X 300 -i my-epylog.pp


Merci

Mathieu

Comment 3 Zdenek Pytela 2018-12-12 15:41:28 UTC
The commands should actually read:

  # semanage fcontext -a -t lib_t '/epylog(/.*)?'
  # restorecon -Rv /epylog

provided /epylog is a custom path for the python modules used by epylog.

Comment 4 mathieu 2018-12-12 17:51:44 UTC
thanks you 

commands accept

Comment 5 Zdenek Pytela 2019-01-15 07:59:31 UTC
It looks like a packaging issue in F29:

  $ rpm -ql epylog|more
/epylog
/epylog/__init__.py
/epylog/__init__.pyc
/epylog/helpers.py
/epylog/helpers.pyc
/epylog/log.py
/epylog/log.pyc
/epylog/module.py
/epylog/module.pyc
/epylog/mytempfile.py
/epylog/mytempfile.pyc
/epylog/publishers.py
/epylog/publishers.pyc
/epylog/report.py
/epylog/report.pyc
/etc/cron.daily/epylog.cron
..

  $ ls -ld /epylog /usr/lib/python2.7/site-packages/epylog
ls: cannot access '/usr/lib/python2.7/site-packages/epylog': No such file or directory
drwxr-xr-x. 2 root root 4096 Jan 14 18:26 /epylog

  $ rpm -q epylog
epylog-1.0.7-23.fc29.noarch


Additionally, on a fresh system the epylog package cannot be installed:

Error:
 Problem: conflicting requests
  - nothing provides python2-pygpgme needed by epylog-1.0.7-23.fc29.noarch

Existing F28 installation containing python2-pygpgme-0.3-26.fc28.x86_64 updates to F29 well; still, the updated F29 package contains libraries in the /epylog path.

Comment 6 Stephen John Smoogen 2019-01-16 00:55:15 UTC
My apologies. I really screwed up getting the F29 built. The problem is that F29 does not have a %{_python_sitelib}/ and that meant it stuck it in /

Comment 7 Fedora Update System 2019-01-16 17:24:08 UTC
epylog-1.0.7-25.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-72263f65e5

Comment 8 Fedora Update System 2019-01-17 02:11:27 UTC
epylog-1.0.7-25.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-72263f65e5

Comment 9 Fedora Update System 2019-01-25 02:40:11 UTC
epylog-1.0.7-25.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, 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.