Giter Site home page Giter Site logo

selinux-pgsql-pgdg's Introduction

SELinux policy module for the PostgreSQL install of the PGDG

This modules adds the file contexts needed by the RPM of PostgreSQL provided by the PGDG (e.g. yum.postgresql.org). It requires the postgresql module of the ref policy, which is enabled by default.

RedHat Version / Support

Version up to 1.2.0 support RHEL/Centos 6 (policy version 24)

As of 1.3.0, it supports RHEL/Centos 7 (policy version 31).

It does not force you to enable sepgsql.

Boolean Provided

This policy provides a postgresql_pgdg_can_http similar to postgresql_can_rsync from refpolicy. When enabled, this boolean allows PostgreSQL to use HTTP ports in e.g. archive_command, recovery_end_command, etc.

# setsebool postgresql_pgdg_can_http on
# getsebool postgresql_pgdg_can_http
postgresql_pgdg_can_http --> on
#

Read/Write access to watchdog devices is provided by the postgresql_pgdg_use_watchdog boolean. The purpose of this boolean is to allow confining Patroni (a HA framework for PostgreSQL) with the postgresql_t type. Patroni being in charge of running the postmaster.

# setsebool postgresql_pgdg_use_watchdog on
# getsebool postgresql_pgdg_use_watchdog
postgresql_pgdg_use_watchdog --> on
#

When we want to archive WAL segments on mount NFS filesystem, access can be granted with the postgresql_pgdg_use_nfs boolean:

# setsebool postgresql_pgdg_use_nfs on
# getsebool postgresql_pgdg_use_nfs
postgresql_pgdg_use_nfs --> on
#

Permanent access shall be granted by setting boolean to on with the semanage boolean command:

# semanage boolean -m --on <boolean>

Notes

When running the postmaster on a TCP port different than 5432, you need to allow it to bind to the port by adding a semanage port rule to the local policy.

Appling postgresql_t to Patroni requires to :

  • enable postgresql_pgdg_can_http
  • label the DCS tcp port with http_port_t (tested with Etcd)
  • use a unregistered port for the API of Patroni and label it with postgresql_port_t

License

This is free software distributed under the PostgreSQL license.

Copyright (c) 2014-2020 Dalibo.

selinux-pgsql-pgdg's People

Contributors

bersace avatar mberglof avatar orgrim avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

selinux-pgsql-pgdg's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.