| 202 | } |
| 203 | |
| 204 | func postgresqlHBAs() []*postgres.HostBasedAuthentication { |
| 205 | // PgBouncer must connect over TLS using a SCRAM password. Other network |
| 206 | // connections are forbidden. |
| 207 | // - https://www.postgresql.org/docs/current/auth-pg-hba-conf.html |
| 208 | // - https://www.postgresql.org/docs/current/auth-password.html |
| 209 | |
| 210 | return []*postgres.HostBasedAuthentication{ |
| 211 | postgres.NewHBA().Users(PostgresqlUser).TLS().Method("scram-sha-256"), |
| 212 | postgres.NewHBA().Users(PostgresqlUser).TCP().Method("reject"), |
| 213 | } |
| 214 | } |