]> git.somenet.org - root/pub/somesible.git/blob - roles/server/postgresql/files/default/pg_hba.conf
[roles/server/postgresql] setup postgresql server
[root/pub/somesible.git] / roles / server / postgresql / files / default / pg_hba.conf
1 #
2 ################################################
3 ### Managed by someone's ansible provisioner ###
4 ################################################
5 # Part of: https://git.somenet.org/root/pub/somesible.git
6 # 2017-2024 by someone <someone@somenet.org>
7 #
8 # PostgreSQL Client Authentication Configuration File
9 # ===================================================
10 #
11 # Refer to the "Client Authentication" section in the PostgreSQL
12 # documentation for a complete description of this file.  A short
13 # synopsis follows.
14 #
15 # This file controls: which hosts are allowed to connect, how clients
16 # are authenticated, which PostgreSQL user names they can use, which
17 # databases they can access.  Records take one of these forms:
18 #
19 # local         DATABASE  USER  METHOD  [OPTIONS]
20 # host          DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
21 # hostssl       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
22 # hostnossl     DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
23 # hostgssenc    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
24 # hostnogssenc  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
25 #
26 # (The uppercase items must be replaced by actual values.)
27 #
28 # The first field is the connection type:
29 # - "local" is a Unix-domain socket
30 # - "host" is a TCP/IP socket (encrypted or not)
31 # - "hostssl" is a TCP/IP socket that is SSL-encrypted
32 # - "hostnossl" is a TCP/IP socket that is not SSL-encrypted
33 # - "hostgssenc" is a TCP/IP socket that is GSSAPI-encrypted
34 # - "hostnogssenc" is a TCP/IP socket that is not GSSAPI-encrypted
35 #
36 # DATABASE can be "all", "sameuser", "samerole", "replication", a
37 # database name, or a comma-separated list thereof. The "all"
38 # keyword does not match "replication". Access to replication
39 # must be enabled in a separate record (see example below).
40 #
41 # USER can be "all", a user name, a group name prefixed with "+", or a
42 # comma-separated list thereof.  In both the DATABASE and USER fields
43 # you can also write a file name prefixed with "@" to include names
44 # from a separate file.
45 #
46 # ADDRESS specifies the set of hosts the record matches.  It can be a
47 # host name, or it is made up of an IP address and a CIDR mask that is
48 # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
49 # specifies the number of significant bits in the mask.  A host name
50 # that starts with a dot (.) matches a suffix of the actual host name.
51 # Alternatively, you can write an IP address and netmask in separate
52 # columns to specify the set of hosts.  Instead of a CIDR-address, you
53 # can write "samehost" to match any of the server's own IP addresses,
54 # or "samenet" to match any address in any subnet that the server is
55 # directly connected to.
56 #
57 # METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
58 # "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
59 # Note that "password" sends passwords in clear text; "md5" or
60 # "scram-sha-256" are preferred since they send encrypted passwords.
61 #
62 # OPTIONS are a set of options for the authentication in the format
63 # NAME=VALUE.  The available options depend on the different
64 # authentication methods -- refer to the "Client Authentication"
65 # section in the documentation for a list of which options are
66 # available for which authentication methods.
67 #
68 # Database and user names containing spaces, commas, quotes and other
69 # special characters must be quoted.  Quoting one of the keywords
70 # "all", "sameuser", "samerole" or "replication" makes the name lose
71 # its special character, and just match a database or username with
72 # that name.
73 #
74 # This file is read on server startup and when the server receives a
75 # SIGHUP signal.  If you edit the file on a running system, you have to
76 # SIGHUP the server for the changes to take effect, run "pg_ctl reload",
77 # or execute "SELECT pg_reload_conf()".
78 #
79 # Put your actual configuration here
80 # ----------------------------------
81 #
82 # If you want to allow non-local connections, you need to add more
83 # "host" records.  In that case you will also need to make PostgreSQL
84 # listen on a non-local interface via the listen_addresses
85 # configuration parameter, or via the -i or -h command line switches.
86
87
88
89
90 # DO NOT DISABLE!
91 # If you change this first entry you will need to make sure that the
92 # database superuser can access the database using some other method.
93 # Noninteractive access to all databases is required during automatic
94 # maintenance (custom daily cronjobs, replication, and similar tasks).
95 #
96 # Database administrative login by Unix domain socket
97 local   all             postgres                                peer
98
99 # TYPE  DATABASE        USER            ADDRESS                 METHOD
100 local   all             all                                     peer
101 host    all             all             0.0.0.0/0               md5
102 host    all             all             ::/0                    md5
103
104 # Allow replication connections from localhost, by a user with the
105 # replication privilege.
106 #local   replication     all                                     peer
107 #host    replication     all             127.0.0.1/32            md5
108 #host    replication     all             ::1/128                 md5