forked from mtusi2026/mtusi2026lab7
feat: require TLS to PostgreSQL, Valkey and S3
Storage servers accept only TLS 1.3 (pg_hba hostssl / hostnossl reject, Valkey port 0, S3 gateway HTTPS only) with stand identities postgres, valkey and s3. Clients trust only the stand CA from [client_tls] ca_file and check the host name; no switch to disable verification. Processes exit with code 2 without a CA or with an IP storage address. Temporary stands, CI and bench/ run on TLS storages; make storage_tls_check adds negative checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -74,10 +74,13 @@ for arg in "$@"; do
|
||||
ids+=("${arg#*=}")
|
||||
done
|
||||
|
||||
# PostgreSQL стенда по сети — только TLS (change storage-tls): проверка
|
||||
# сервера по CA прогона (/pki/ca.crt, bind на чтение) и имени postgres
|
||||
if [[ $mode == list ]]; then
|
||||
export PGPASSWORD="$POSTGRES_PASSWORD"
|
||||
psql "host=postgres user=$POSTGRES_USER dbname=$POSTGRES_DB \
|
||||
application_name=bench-sampler" -XAtq -F '|' >/work/pg-samples.log 2>&1 <<SQL &
|
||||
application_name=bench-sampler sslmode=verify-full sslrootcert=/pki/ca.crt" \
|
||||
-XAtq -F '|' >/work/pg-samples.log 2>&1 <<SQL &
|
||||
WITH t AS (
|
||||
SELECT (extract(epoch FROM clock_timestamp()) * 1000)::bigint AS ts
|
||||
)
|
||||
@@ -106,7 +109,8 @@ fi
|
||||
if [[ $mode == queue ]]; then
|
||||
export PGPASSWORD="$POSTGRES_PASSWORD"
|
||||
psql "host=postgres user=$POSTGRES_USER dbname=$POSTGRES_DB \
|
||||
application_name=bench-sampler" -XAtq -F '|' >/work/jobs.log 2>&1 <<SQL &
|
||||
application_name=bench-sampler sslmode=verify-full sslrootcert=/pki/ca.crt" \
|
||||
-XAtq -F '|' >/work/jobs.log 2>&1 <<SQL &
|
||||
SELECT 'jobs', (extract(epoch FROM clock_timestamp()) * 1000)::bigint,
|
||||
count(*) FILTER (WHERE state = 'queued' AND published_at IS NULL
|
||||
AND coalesce(next_attempt_at, created_at) <= clock_timestamp()),
|
||||
|
||||
Reference in New Issue
Block a user