lab7: PKI, mTLS infra, OpenBao non-dev, hardening, lifecycle scripts
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Copies read-only mounted TLS material into container-private tmpfs with 0600
|
||||
# key permissions required by PostgreSQL under non-root UID 70:70.
|
||||
set -eu
|
||||
|
||||
cert_dir=/var/run/postgresql/certs
|
||||
mkdir -p "$cert_dir"
|
||||
chmod 0700 "$cert_dir"
|
||||
|
||||
cp /run/certs/ca.crt "$cert_dir/ca.crt"
|
||||
cp /run/certs/ca.crl "$cert_dir/ca.crl"
|
||||
cp /run/certs/server.crt "$cert_dir/server.crt"
|
||||
cp /run/certs/server.key "$cert_dir/server.key"
|
||||
|
||||
chmod 0644 "$cert_dir/ca.crt" "$cert_dir/ca.crl" "$cert_dir/server.crt"
|
||||
chmod 0600 "$cert_dir/server.key"
|
||||
|
||||
exec docker-entrypoint.sh "$@"
|
||||
Reference in New Issue
Block a user