forked from mtusi2026/mtusi2026lab7
lab 7 openbao
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# PostgreSQL refuses a key that is not owned by the server user with mode 0600: copy the mounted key into a private tmpfs first.
|
||||
set -eu
|
||||
install -d -m 700 -o postgres -g postgres /tls
|
||||
install -m 644 -o postgres -g postgres /pki/tls.crt /tls/server.crt
|
||||
install -m 600 -o postgres -g postgres /pki/tls.key /tls/server.key
|
||||
install -m 644 -o postgres -g postgres /pki/ca.crt /tls/ca.crt
|
||||
exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/tls/server.crt -c ssl_key_file=/tls/server.key \
|
||||
-c ssl_ca_file=/tls/ca.crt -c ssl_min_protocol_version=TLSv1.2 -c hba_file=/etc/postgresql/pg_hba.conf -c password_encryption=scram-sha-256
|
||||
@@ -0,0 +1,4 @@
|
||||
# Lab 7: TLS + SCRAM only. Plain-text TCP connections are rejected. The unix socket exists only inside the container (operator docker exec).
|
||||
local all all trust
|
||||
hostssl all all 0.0.0.0/0 scram-sha-256
|
||||
host all all 0.0.0.0/0 reject
|
||||
Reference in New Issue
Block a user