Projekt

Allgemein

Profil

PostgreSQL Netzwerkkonfiguration (pg hbaconf) » Historie » Version 31

[E] Rocco Kreutz, 16.12.2025 12:51

1 26 [E] Axel S
h1. PostgreSQL Netzwerkkonfiguration (pg_hba.conf) 
2
3
 * APPS/Sys.dblink/syncro IMMER passwort, da sonst kein dblink funktinoiert. 
4
 * postgres lokal trust wegen scripten und konsole. 
5
 * SQL-Abfrage der aktuellen pg_hba.conf: <code class="sql">SELECT * FROM pg_hba_file_rules ORDER BY rule_number;</code> "pg_hba_file_rules":https://www.postgresql.org/docs/current/view-pg-hba-file-rules.html 
6 27 [E] Axel S
<pre>
7 1 [X] Daniel S
# aktuelle Vorlage im Wiki: https://redmine.prodat-sql.de/projects/prodat-v12-public/wiki/PostgreSQL_Netzwerkkonfiguration_(pg_hbaconf)
8
9 25 [E] Axel S
# TYPE  DATABASE        USER                                 ADDRESS                 METHOD
10 1 [X] Daniel S
11
# "local" is for Unix domain socket connections only
12
#local   all             all                                                   scram-sha-256
13 16 [E] Axel S
14 25 [E] Axel S
# PRODAT local & loopback
15
# SYS.ProdatAddOns-Connect hat keine Rechte auf den DBs, aber als Mitglieder die wirklichen DB-Benutzer (z.B. sys_postgrest_auth) der Prodat AddOns
16 31 [E] Rocco Kreutz
hostssl    all             postgres,+SYS.ProdatAddOns-Connect   127.0.0.1/32            trust  
17
hostnossl  all             postgres,+SYS.ProdatAddOns-Connect   127.0.0.1/32            trust  
18
hostssl    all             postgres,+SYS.ProdatAddOns-Connect   ::1/128                 trust
19
hostnossl  all             postgres,+SYS.ProdatAddOns-Connect   ::1/128                 trust
20 1 [X] Daniel S
21 31 [E] Rocco Kreutz
        #hostssl   all             APPS,SYS.dblink,syncro               all                     md5
22
        #hostnossl all             APPS,SYS.dblink,syncro               all                     md5
23
hostssl    all             APPS,SYS.dblink,syncro               127.0.0.1/32            md5
24
hostnossl  all             APPS,SYS.dblink,syncro               127.0.0.1/32            md5
25
hostssl    all             APPS,SYS.dblink,syncro               ::1/128                 md5
26
hostnossl  all             APPS,SYS.dblink,syncro               ::1/128                 md5
27
28 1 [X] Daniel S
# local loopback: von lokaler IP mit LoopBack außen (locale IP)
29 31 [E] Rocco Kreutz
# hostssl    all             postgres,+SYS.ProdatAddOns-Connect x.x.X.X/32            trust  
30
# hostnossl  all             postgres,+SYS.ProdatAddOns-Connect x.x.X.X/32            trust  
31
# hostssl    all             APPS,SYS.dblink,syncro             192.168.X.X/32            md5
32
# hostnossl  all             APPS,SYS.dblink,syncro             192.168.X.X/32            md5
33 1 [X] Daniel S
34
# zB Grafana und sonstiges von localhost
35 31 [E] Rocco Kreutz
#hostssl    all             all                                  127.0.0.1/32            md5
36
#hostnossl  all             all                                  127.0.0.1/32            md5
37
#hostssl    all             all                                  ::1/128                 md5
38
#hostnossl  all             all                                  ::1/128                 md5
39 30 [X] Daniel S
40 1 [X] Daniel S
# IPv4 local & remote connections:
41
# lokal auf dem Server = immer trust
42 31 [E] Rocco Kreutz
#hostssl   all            all                                   127.0.0.1/32            trust
43
#hostnossl all            all                                   127.0.0.1/32            trust
44
#hostssl   all            all                                   ::1/128                 trust
45
#hostnossl all            all                                   ::1/128                 trust
46 8 [X] Daniel S
47 25 [E] Axel S
# Zugriffe von außen:
48 31 [E] Rocco Kreutz
host      all             root,postgres,SYS.dblink,APPS        0.0.0.0/0               reject          # Standard-Super-User restrict by default from outside
49
hostssl   all             root,postgres,SYS.dblink,APPS        0.0.0.0/0               reject          # Standard-Super-User restrict by default from outside
50
hostnossl all             root,postgres,SYS.dblink,APPS        0.0.0.0/0               reject          # Standard-Super-User restrict by default from outside
51 25 [E] Axel S
52 6 [X] Daniel S
# Netzwerk Netzwerkfilter für Zugriffe der Clients!!!!!!!!!!
53 31 [E] Rocco Kreutz
#hostssl   all             all                                 192.168.X.X/16          md5 # nur auf das Subnetz eingeschänkt!
54
#hostnossl all             all                                 192.168.X.X/16          md5 # nur auf das Subnetz eingeschänkt!
55 4 [X] Daniel S
56 31 [E] Rocco Kreutz
#### hostssl   all             all             all                     md5 # Von überall aus zugänglich via md5
57
#### hostnossl all             all             all                     md5 # Von überall aus zugänglich via md5
58 1 [X] Daniel S
</pre>