RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 858406 - PostgreSQL PITR setup with SELinux feature request
Summary: PostgreSQL PITR setup with SELinux feature request
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Michal Trunecka
URL:
Whiteboard:
Depends On:
Blocks: 873350
TreeView+ depends on / blocked
 
Reported: 2012-09-18 22:02 UTC by Dmitry S. Makovey
Modified: 2014-09-30 23:33 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.7.19-168.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 873350 (view as bug list)
Environment:
Last Closed: 2013-02-21 08:29:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Sample module outlining all the permissions required for PITR implementation with SSH and RSync (643 bytes, application/octet-stream)
2012-09-18 22:02 UTC, Dmitry S. Makovey
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0314 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2013-02-20 20:35:01 UTC

Description Dmitry S. Makovey 2012-09-18 22:02:19 UTC
Created attachment 614140 [details]
Sample module outlining all the permissions required for PITR implementation with SSH and RSync

Description of problem:

Currently RHEL-shipped SELinux policy is not set up to work with PostgreSQL's PITR (point-in-time recovery). In order to apply most common methods for PITR implementation one needs to manually generate corresponding module. From information I've gathered implementation ends up being fairly similar in each case thus may warrant a tunable implemented in default policies to allow PostgreSQL to transfer WAL files to the secondary node[s]. 

In my particular case I'm implementing PGPool-II replication with PITR. (Following documentation at: http://www.pgpool.net/docs/latest/pgpool-en.html#online-recovery ). 

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

selinux-policy-targeted-3.7.19-155.el6_3.noarch
selinux-policy-3.7.19-155.el6_3.noarch

How reproducible:

Always.

Steps to Reproduce:
1. setup PGPool-II and PITR recovery as per http://www.pgpool.net/docs/latest/pgpool-en.html#online-recovery
1a. namely add to /var/lib/pgsql/data/postgresql.conf:

archive_mode = on 
archive_command = '/usr/bin/rsync %p postgres.3.4:/var/spool/pgsql/wal/%f < /dev/null'

which essentially asks postgres to send WAL files over to the secondary machine whenever it reaches checkpoint.

2. launch "psql -U postgres template1" on one of the nodes
3. => select pg_backup_start("backup_test");
4. => select pg_backup_stop()
  
Actual results:

WARNING:  pg_stop_backup still waiting for archive to complete (60 seconds elapsed)

and a lot of SELinux denials

Expected results:

operation to succeed.

Additional info:

PGPool-II used is built using SPEC file in bug #847357 which essentially is a Fedora package rebuilt and tweaked to work in RHEL

Comment 2 Miroslav Grepl 2012-09-19 12:54:53 UTC
Ok, I added a new

sepgsql_enable_pitr_implementation

boolean to Fedora. Will backport to RHEL6.

Comment 3 Miroslav Grepl 2012-09-20 06:15:56 UTC
Ok

optional_policy(`
    tunable_policy(`postgresql_can_rsync',`
        rsync_exec(postgresql_t)
    ')
')

optional_policy(`
    tunable_policy(`postgresql_can_rsync',`
        ssh_exec(postgresql_t)
        ssh_read_user_home_files(postgresql_t)
        corenet_tcp_connect_ssh_port(postgresql_t)
    ')
')

I like this solution more than was my first.

Comment 7 errata-xmlrpc 2013-02-21 08:29:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0314.html


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