lab7: безопасность, mTLS, OpenBao и PKI lifecycle
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
# PostgreSQL requires its private key to be owned by postgres and mode 0600.
|
||||
# The role mount remains read-only; this copy is in the container's tmpfs.
|
||||
umask 077
|
||||
cp /run/identity/current/tls.key /tmp/postgres.key
|
||||
chmod 600 /tmp/postgres.key
|
||||
exec /usr/local/bin/docker-entrypoint.sh postgres \
|
||||
-c ssl=on \
|
||||
-c ssl_cert_file=/run/identity/current/tls.crt \
|
||||
-c ssl_key_file=/tmp/postgres.key \
|
||||
-c ssl_ca_file=/run/identity/current/ca.crt \
|
||||
-c hba_file=/etc/postgresql/pg_hba.conf \
|
||||
-c password_encryption=scram-sha-256 \
|
||||
-c log_statement=none
|
||||
@@ -0,0 +1,7 @@
|
||||
# Only the operator inside this container can use the local Unix socket.
|
||||
# No PostgreSQL socket directory is mounted into application containers.
|
||||
local all all trust
|
||||
hostnossl all all 0.0.0.0/0 reject
|
||||
hostnossl all all ::/0 reject
|
||||
hostssl all all 0.0.0.0/0 scram-sha-256
|
||||
hostssl all all ::/0 scram-sha-256
|
||||
Reference in New Issue
Block a user