Complete Lab 7 security and PKI track

This commit is contained in:
2026-12-05 23:43:41 +03:00
parent 20afc2c790
commit d8ecd2aad9
93 changed files with 6714 additions and 133 deletions
+9
View File
@@ -0,0 +1,9 @@
FROM postgres:16.16-alpine3.24
# The upstream image bundles gosu built with Go 1.24.6. This service only
# needs its privilege-dropping behavior, which Alpine's small su-exec provides.
RUN apk upgrade --no-cache \
&& apk add --no-cache su-exec \
&& rm -f /usr/local/bin/gosu /usr/local/bin/su-exec \
&& ln -s /sbin/su-exec /usr/local/bin/gosu \
&& gosu nobody true
+13
View File
@@ -0,0 +1,13 @@
# Unix-domain socket is available only inside the database container and is
# used by its entrypoint for one-time role initialization.
local all all trust
# Applications authenticate with distinct client certificates and mapped CNs.
hostssl messenger messenger_api all cert map=lab7_services
hostssl messenger messenger_dispatcher all cert map=lab7_services
hostssl messenger messenger_worker all cert map=lab7_services
# Only the migration/bootstrap job uses the local operator password.
hostssl messenger postgres all scram-sha-256
hostnossl all all all reject
hostssl all all all reject
+4
View File
@@ -0,0 +1,4 @@
# MAPNAME SYSTEM-USERNAME DATABASE-USERNAME
lab7_services messenger-api messenger_api
lab7_services messenger-dispatcher messenger_dispatcher
lab7_services messenger-worker messenger_worker
+6
View File
@@ -0,0 +1,6 @@
listen_addresses = '*'
ssl = on
password_encryption = 'scram-sha-256'
ident_file = '/etc/postgresql/pg_ident.conf'
max_connections = 100
shared_buffers = '256MB'