forked from mtusi2026/mtusi2026lab7
19 lines
1.2 KiB
Plaintext
19 lines
1.2 KiB
Plaintext
# PostgreSQL client authentication, lab 7 (passed with -c hba_file=..., compose service postgres).
|
|
# First matching line wins.
|
|
#
|
|
# Unix socket inside the container only (docker compose exec): the superuser `postgres` by peer
|
|
# (OS user postgres), everyone else by password. initdb scripts and the operator use this path.
|
|
# TYPE DATABASE USER ADDRESS METHOD
|
|
local all postgres peer
|
|
local all all scram-sha-256
|
|
# Network: TLS ONLY and only the service roles, password = SCRAM. The superuser never logs in
|
|
# over the network. Clients verify the server with sslmode=verify-full (internal CA, SAN postgres).
|
|
hostssl messenger messenger_migrate all scram-sha-256
|
|
hostssl messenger messenger_api all scram-sha-256
|
|
hostssl messenger messenger_relay all scram-sha-256
|
|
hostssl messenger messenger_worker all scram-sha-256
|
|
hostssl messenger messenger_jobctl all scram-sha-256
|
|
hostssl messenger messenger_auditor all scram-sha-256
|
|
# Everything else - any plaintext connection, any other role/database - is refused.
|
|
host all all all reject
|