docker-postgresql icon indicating copy to clipboard operation
docker-postgresql copied to clipboard

disallow POSTGRES user from logging remotely

Open CzechJiri opened this issue 9 years ago • 1 comments

disallow POSTGRES user from logging remotely. This is a safety measure, I personally always disable it explicitly in pg_hba.conf regardless how is postgres user password set

This can be optional switch

PG_TRUST_REMOTE_POSTGRES=${PG_TRUST_REMOTE_POSTGRES:-false}

with a function

trust_remote_postgres_user() {
  if [[ ${PG_TRUST_REMOTE_POSTGRES} == false ]]; then
    echo "Removing trust for POSTGRES user connecting from non-local host..."
    set_hba_param "host all postgres  0.0.0.0/0 reject"
  fi
}

CzechJiri avatar Jun 06 '16 18:06 CzechJiri

https://github.com/sameersbn/docker-postgresql#command-line-arguments

LongLiveCHIEF avatar Oct 30 '16 19:10 LongLiveCHIEF