Bug 1648539 - SELinux is preventing vnstatd from 'read' accesses on the directory /var/lib/vnstat.
Summary: SELinux is preventing vnstatd from 'read' accesses on the directory /var/lib/...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
medium
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a89b82c27851c06f4f7a53bfb1b...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-10 12:40 UTC by Dirk Deimeke
Modified: 2018-12-19 12:52 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.14.2-44.fc29
Clone Of:
Environment:
Last Closed: 2018-12-19 12:52:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dirk Deimeke 2018-11-10 12:40:38 UTC
Description of problem:
SELinux is preventing vnstatd from 'read' accesses on the directory /var/lib/vnstat.

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

If you believe that vnstatd should be allowed read access on the vnstat directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'vnstatd' --raw | audit2allow -M my-vnstatd
# semodule -X 300 -i my-vnstatd.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:vnstatd_var_lib_t:s0
Target Objects                /var/lib/vnstat [ dir ]
Source                        vnstatd
Source Path                   vnstatd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           vnstat-1.18-1.fc29.x86_64
Policy RPM                    selinux-policy-3.14.2-40.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.18.16-300.fc29.x86_64 #1 SMP Sat
                              Oct 20 23:24:08 UTC 2018 x86_64 x86_64
Alert Count                   5
First Seen                    2018-11-05 15:39:38 CET
Last Seen                     2018-11-05 15:39:40 CET
Local ID                      438d1144-5449-426b-9c82-cdf2e57a6419

Raw Audit Messages
type=AVC msg=audit(1541428780.465:238): avc:  denied  { read } for  pid=1361 comm="vnstatd" name="vnstat" dev="dm-0" ino=270508 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:vnstatd_var_lib_t:s0 tclass=dir permissive=0


Hash: vnstatd,init_t,vnstatd_var_lib_t,dir,read

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

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

Comment 1 Lukas Vrabec 2018-12-19 12:51:42 UTC
Hi, 

This should be fixed in the latest selinux-policy rpm package. 

sesearch -A -s init_t -t vnstatd_t -c process2
allow init_t vnstatd_t:process2 { nnp_transition nosuid_transition };


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