Bug 1262909 - SELinux is preventing PCP's PostgreSQL PMDA to collect metrics
SELinux is preventing PCP's PostgreSQL PMDA to collect metrics
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
22
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-14 11:20 EDT by Tadej Janež
Modified: 2016-07-19 16:37 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-19 16:37:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tadej Janež 2015-09-14 11:20:11 EDT
Description of problem:
Current SELinux policy is preventing the Performance Metrics Domain Agent (PMDA) for PostgreSQL (part of the Performance Co-Pilot (PCP) suite) access to PostgreSQL's metrics.

Version-Release number of selected components:
selinux-policy-targeted-3.13.1-128.12.fc22.noarch
pcp-pmda-postgresql-3.10.6-1.fc22.x86_64
postgresql-server-9.4.4-1.fc22.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. sudo dnf install postgresql-server
2. sudo postgresql-setup --initdb
3. sudo systemctl enable postgresql.service
4. sudo systemctl restart postgresql.service
5. sudo dnf install "perl(DBI)" "perl(DBD::Pg)" pcp-collector
6. sudo touch /var/lib/pcp/pmdas/postgresql/.NeedInstall
7. sudo systemctl restart pmcd.service
8. sudo pmval postgresql.stat.database.blks_read

Actual results:
[root@collector vagrant]# pmval postgresql.stat.database.blks_read

metric:    postgresql.stat.database.blks_read
host:      collector
semantics: cumulative counter (converting to rate)
units:     count (converting to count / sec)
samples:   all
No values available
No values available
No values available

The relevant lines from /var/log/audit/audit.log:
type=AVC msg=audit(1442243822.349:478): avc:  denied  { search } for  pid=491 comm="perl" name="pgsql" dev="sda1" ino=15399 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postgresql_db_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1442243822.349:479): avc:  denied  { write } for  pid=491 comm="perl" name=".s.PGSQL.5432" dev="tmpfs" ino=13323 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postgresql_var_run_t:s0 tclass=sock_file permissive=0
type=AVC msg=audit(1442243837.356:482): avc:  denied  { connectto } for  pid=491 comm="perl" path="/run/postgresql/.s.PGSQL.5432" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:postgresql_t:s0 tclass=unix_stream_socket permissive=1

Expected results:
[root@collector vagrant]# pmval postgresql.stat.database.blks_read

metric:    postgresql.stat.database.blks_read
host:      collector
semantics: cumulative counter (converting to rate)
units:     count (converting to count / sec)
samples:   all

  template1   template0    postgres 
     0.0         0.0         0.0    
     0.0         0.0         0.0    
     0.0         0.0         0.0
Comment 1 Fedora End Of Life 2016-07-19 16:37:41 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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 please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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.