Files
mtusi2026lab7/compose.yaml

1030 lines
44 KiB
YAML

# Lab 7 stand = lab 6 + security on every trust boundary (contracts/trust-matrix.md):
# client --HTTPS :8443 (public CA)--> lb (HAProxy) --mTLS (internal CA, SAN allowlist lb)--> api x2
# api/relay/worker --TLS verify-full--> postgres (own role per service, GRANT only what it does)
# api --TLS (rediss)--> valkey (ACL user api) api/worker --HTTPS--> s3 (own key pair each)
# relay/worker --AMQPS 5671--> broker (publish-only / consume-only users)
# api/relay/worker --OTLP/HTTPS + client cert--> otel-collector --mTLS--> prometheus/loki/tempo
# grafana (https://localhost:3000, public CA) --mTLS--> the three datasources
# Nothing speaks plaintext over a container network. Plaintext remains only on a container's own
# loopback (healthchecks, the internal hops of SeaweedFS/Loki/Tempo): closed local hops.
#
# Lab 6 part: api x2 / relay / worker --OTLP--> otel-collector --> prometheus (metrics + alert rules)
# --> loki (logs) --> tempo (traces); grafana: provisioned datasources + dashboard.
# The application never waits for telemetry: no depends_on on it, bounded SDK queues.
# Lab 5 part: PostgreSQL (metadata, jobs, outbox: source of truth) + Valkey (sessions)
# + SeaweedFS S3 (staging bucket and final bucket, both private)
# relay : outbox in PostgreSQL -> RabbitMQ (publisher confirms) [service `relay`]
# broker : RabbitMQ 4.3, durable quorum queue + dead-letter queue [service `broker`]
# worker : RabbitMQ -> variants -> final bucket + PostgreSQL, then ack [service `worker`]
# From a clean clone: docs/OPERATOR.md (Windows: docs/WINDOWS.md).
# .venv/Scripts/python scripts/init_secrets.py # once: credentials + PKI into ./secrets (git-ignored)
# docker compose up -d --build --wait
# Order: postgres/valkey/s3/broker healthy -> migrate + s3-init (ONE run each, exit 0)
# -> api healthy -> lb; relay and worker start after migrate/s3-init.
# Images are pinned by version AND digest. Passwords/keys are passed only as secret files, and
# every service gets only the secrets it needs. Only the LB (8443) and Grafana (3000) publish
# ports, both HTTPS, both on loopback only.
# Networks: `edge` (lb <-> api); internal (no route outside): `data` (postgres/valkey),
# `storage` (s3), `queue` (broker), `telemetry`. The API is NOT on `queue`.
name: ${COMPOSE_PROJECT_NAME:-mtusi-lab7}
# Lab 7: how a service gets its secrets: AppRole login to OpenBao with ITS role_id/secret_id
# (Docker secrets of that service only), read ITS path messenger/data/<service>, revoke the token.
# database_url, cache_url, broker_url and the S3 key pair are NOT mounted as files into api, relay,
# worker any more (src/messenger/bao.py).
x-bao-env: &bao-env
# Not a secret: the random X-Instance-Id alias of the process (config.py), for the operator's
# alias -> container mapping (scripts/stop-one.sh).
INSTANCE_ID_FILE: /tmp/instance_id
BAO_ADDR: https://openbao:8200
BAO_CACERT: /run/secrets/internal-ca.crt
BAO_ROLE_ID_FILE: /run/secrets/bao_role_id
BAO_SECRET_ID_FILE: /run/secrets/bao_secret_id
BAO_STARTUP_TIMEOUT_SECONDS: ${BAO_STARTUP_TIMEOUT_SECONDS:-60}
x-api-env: &api-env
APP_ENV: ${APP_ENV:-lab}
LOG_LEVEL: ${LOG_LEVEL:-info}
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
SESSION_STORE: ${SESSION_STORE:-valkey}
DB_POOL_MIN: ${DB_POOL_MIN:-1}
DB_POOL_MAX: ${DB_POOL_MAX:-10}
DB_TIMEOUT_SECONDS: ${DB_TIMEOUT_SECONDS:-3}
# Lab 7: 1.0 s (was 0.5): the budget now includes the TLS handshake of a cold connection to Valkey;
# 0.5 s was exceeded once by a replica that had just started (test_graceful_stop..., 568 ms).
CACHE_TIMEOUT_SECONDS: ${CACHE_TIMEOUT_SECONDS:-1.0}
PASSWORD_HASH_CONCURRENCY: ${PASSWORD_HASH_CONCURRENCY:-2}
# Lab 7: Argon2id parameters, chosen by a measurement on this stand (bench/argon2_bench.py,
# REPORT.md); the application refuses values below m=19456 KiB, t=2, p=1.
ARGON2_MEMORY_KIB: ${ARGON2_MEMORY_KIB:-19456}
ARGON2_ITERATIONS: ${ARGON2_ITERATIONS:-2}
ARGON2_PARALLELISM: ${ARGON2_PARALLELISM:-1}
# Lab 7: failed-login limits (src/messenger/ratelimit.py) -> 429 + Retry-After.
LOGIN_RATE_LIMIT_USER: ${LOGIN_RATE_LIMIT_USER:-5}
LOGIN_RATE_LIMIT_USER_WINDOW_SECONDS: ${LOGIN_RATE_LIMIT_USER_WINDOW_SECONDS:-60}
LOGIN_RATE_LIMIT_IP: ${LOGIN_RATE_LIMIT_IP:-50}
LOGIN_RATE_LIMIT_IP_WINDOW_SECONDS: ${LOGIN_RATE_LIMIT_IP_WINDOW_SECONDS:-300}
IDEMPOTENCY_TTL_SECONDS: ${IDEMPOTENCY_TTL_SECONDS:-86400}
# Graceful stop: 3 s drain (readiness 503, still serving) + up to 8 s for in-flight requests.
DRAIN_SECONDS: ${DRAIN_SECONDS:-3}
SHUTDOWN_TIMEOUT_SECONDS: ${SHUTDOWN_TIMEOUT_SECONDS:-8}
DOCS_ENABLED: ${DOCS_ENABLED:-true}
MESSAGE_WRITE_PATH: ${MESSAGE_WRITE_PATH:-function}
# S3: the API's own key pair (Write staging + Read final, see infra/seaweedfs/start.sh).
S3_ENDPOINT: ${S3_ENDPOINT:-https://s3:8333}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
S3_STAGING_BUCKET: ${S3_STAGING_BUCKET:-messenger-staging}
S3_TIMEOUT_SECONDS: ${S3_TIMEOUT_SECONDS:-3}
MAX_UPLOAD_BYTES: ${MAX_UPLOAD_BYTES:-10485760}
MAX_IMAGE_PIXELS: ${MAX_IMAGE_PIXELS:-40000000}
UPLOAD_CONCURRENCY: ${UPLOAD_CONCURRENCY:-4}
UPLOAD_QUEUE_TIMEOUT_SECONDS: ${UPLOAD_QUEUE_TIMEOUT_SECONDS:-5}
UPLOAD_READ_TIMEOUT_SECONDS: ${UPLOAD_READ_TIMEOUT_SECONDS:-30}
IMAGE_VERIFY_TIMEOUT_SECONDS: ${IMAGE_VERIFY_TIMEOUT_SECONDS:-10}
IMAGE_VERIFY_CONCURRENCY: ${IMAGE_VERIFY_CONCURRENCY:-1}
JPEG_MAX_MEMORY_MB: ${JPEG_MAX_MEMORY_MB:-256}
PENDING_GRACE_SECONDS: ${PENDING_GRACE_SECONDS:-900}
JANITOR_INTERVAL_SECONDS: ${JANITOR_INTERVAL_SECONDS:-60}
# Lab 5: pipeline version and attempt budget of the jobs created by uploads.
PIPELINE_VERSION: ${PIPELINE_VERSION:-1}
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
# Failure experiments only (student-tests); empty = no injected failures.
FAULT_POINTS: ${API_FAULT_POINTS:-}
# Lab 7: the CA every outgoing TLS connection (S3, Valkey) verifies the server with.
TLS_CA_FILE: /run/secrets/internal-ca.crt
# Lab 6: OpenTelemetry SDK settings shared by api, relay and worker (src/messenger/telemetry.py).
# Exporter timeout 3 s and bounded batch queues (2048 spans / log records): a dead Collector costs
# dropped telemetry, not memory or request latency.
# Lab 7: OTLP over HTTPS; the SDK verifies the Collector (internal CA, hostname otel-collector) and
# presents the service's own certificate (/run/secrets/service.crt: SAN api / relay / worker).
x-otel-env: &otel-env
OTEL_SDK_DISABLED: ${OTEL_SDK_DISABLED:-false}
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_CERTIFICATE: /run/secrets/internal-ca.crt
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /run/secrets/service.crt
OTEL_EXPORTER_OTLP_CLIENT_KEY: /run/secrets/service.key
OTEL_EXPORTER_OTLP_TIMEOUT: ${OTEL_EXPORTER_OTLP_TIMEOUT:-3}
OTEL_RESOURCE_ATTRIBUTES: ${OTEL_RESOURCE_ATTRIBUTES:-deployment.environment.name=lab}
OTEL_TRACES_SAMPLER: ${OTEL_TRACES_SAMPLER:-parentbased_always_on}
OTEL_TRACES_SAMPLER_ARG: ${OTEL_TRACES_SAMPLER_ARG:-1.0}
OTEL_METRIC_EXPORT_INTERVAL: ${OTEL_METRIC_EXPORT_INTERVAL:-5000}
OTEL_BSP_MAX_QUEUE_SIZE: ${OTEL_BSP_MAX_QUEUE_SIZE:-2048}
OTEL_BSP_SCHEDULE_DELAY: ${OTEL_BSP_SCHEDULE_DELAY:-1000}
OTEL_BLRP_MAX_QUEUE_SIZE: ${OTEL_BLRP_MAX_QUEUE_SIZE:-2048}
OTEL_BLRP_SCHEDULE_DELAY: ${OTEL_BLRP_SCHEDULE_DELAY:-1000}
# Settings of the pipeline shared by relay and worker (docs/PIPELINE.md).
x-pipeline-env: &pipeline-env
APP_ENV: ${APP_ENV:-lab}
LOG_LEVEL: ${LOG_LEVEL:-info}
DB_POOL_MAX: ${PIPELINE_DB_POOL_MAX:-6}
DB_TIMEOUT_SECONDS: ${DB_TIMEOUT_SECONDS:-3}
S3_ENDPOINT: ${S3_ENDPOINT:-https://s3:8333}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
S3_STAGING_BUCKET: ${S3_STAGING_BUCKET:-messenger-staging}
S3_TIMEOUT_SECONDS: ${S3_TIMEOUT_SECONDS:-3}
MAX_UPLOAD_BYTES: ${MAX_UPLOAD_BYTES:-10485760}
MAX_IMAGE_PIXELS: ${MAX_IMAGE_PIXELS:-40000000}
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
JOB_LEASE_SECONDS: ${JOB_LEASE_SECONDS:-30}
JOB_RETRY_BASE_SECONDS: ${JOB_RETRY_BASE_SECONDS:-2}
JOB_RETRY_MAX_SECONDS: ${JOB_RETRY_MAX_SECONDS:-60}
QUEUED_REPUBLISH_SECONDS: ${QUEUED_REPUBLISH_SECONDS:-300}
TLS_CA_FILE: /run/secrets/internal-ca.crt
services:
# PostgreSQL 18. Lab 7: TLS (internal CA, SAN postgres), pg_hba accepts ONLY hostssl logins of the
# service roles; the superuser `postgres` exists for initdb and the operator (local socket).
# The server key must be 0600 and owned by postgres: it is copied from the secret into a tmpfs
# at start (the bind-mounted secret cannot be chowned), then the image's entrypoint drops root.
# pg_hba.conf (infra/postgres, the source of truth in Git) is copied there too, so the lab 3
# failure test can add a temporary reject line and reload (student-tests/test_balancing.py).
postgres:
image: postgres:18.6-bookworm@sha256:afc7e2d441324c0388fa80c3d24f733b4194a4eb7f47dd8ee2b08eb1a24a647c
environment:
POSTGRES_DB: messenger
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
command:
- sh
- -c
- >-
install -o postgres -g postgres -m 600 /run/secrets/postgres.key /run/pgtls/server.key &&
install -m 644 /etc/postgresql/pg_hba.conf /run/pgtls/pg_hba.conf &&
exec docker-entrypoint.sh postgres
-c ssl=on -c ssl_cert_file=/run/secrets/postgres.crt -c ssl_key_file=/run/pgtls/server.key
-c ssl_min_protocol_version=TLSv1.2 -c hba_file=/run/pgtls/pg_hba.conf
-c password_encryption=scram-sha-256
-c shared_preload_libraries=pg_stat_statements -c max_connections=${PG_MAX_CONNECTIONS:-100}
secrets:
- postgres_password
- pg_migrate_password
- pg_api_password
- pg_relay_password
- pg_worker_password
- pg_jobctl_password
- pg_auditor_password
- {source: pki_postgres_crt, target: postgres.crt}
- {source: pki_postgres_key, target: postgres.key}
- {source: pki_internal_ca, target: internal-ca.crt} # operator/tests: psql verify-full inside
tmpfs:
- /run/pgtls:size=1m,mode=0755
volumes:
- pgdata:/var/lib/postgresql # PostgreSQL 18 image keeps PGDATA under this path
- ./infra/postgres/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
- ./infra/postgres/initdb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d messenger -q"]
interval: 2s
timeout: 3s
retries: 30
start_period: 10s
stop_grace_period: 30s # clean shutdown checkpoint instead of crash recovery
restart: unless-stopped
# Lab 7 hardening: the image starts as root only to chown its data and drop to its own user
# (gosu/su-exec): exactly the capabilities for that, nothing else (no NET_RAW, MKNOD, ...).
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETGID, SETUID]
security_opt: ["no-new-privileges:true"]
networks: [data]
deploy:
resources:
limits: {cpus: "${PG_CPUS:-2.0}", memory: "${PG_MEMORY:-1g}"}
# Valkey: sessions + login rate limit. Lab 7: TLS only (port 0, tls-port 6379), ACL user `api`
# (infra/valkey/start.sh), `default` user off.
valkey:
image: valkey/valkey:8.1.3-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571
entrypoint: ["/bin/sh", "/etc/valkey/start.sh"]
secrets:
- valkey_api_password
- {source: pki_valkey_crt, target: valkey.crt}
- {source: pki_valkey_key, target: valkey.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/valkey/valkey.conf:/etc/valkey/valkey.conf:ro
- ./infra/valkey/start.sh:/etc/valkey/start.sh:ro
- valkeydata:/data
healthcheck:
test: ["CMD-SHELL", "REDISCLI_AUTH=\"$$(cat /run/secrets/valkey_api_password)\" valkey-cli --tls --cacert /run/secrets/internal-ca.crt -h localhost --user api ping | grep -q PONG"]
interval: 2s
timeout: 3s
retries: 30
start_period: 5s
restart: unless-stopped
# Lab 7 hardening: the image starts as root only to chown its data and drop to its own user
# (gosu/su-exec): exactly the capabilities for that, nothing else (no NET_RAW, MKNOD, ...).
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETGID, SETUID]
security_opt: ["no-new-privileges:true"]
networks: [data]
deploy:
resources:
limits: {cpus: "${VALKEY_CPUS:-0.5}", memory: 256m}
# S3-compatible object storage (SeaweedFS: master + volume + filer + S3 gateway in one process).
# Bytes live ONLY here, on the named volume s3data. Identities: infra/seaweedfs/start.sh.
# Lab 7: the S3 port is HTTPS only (internal CA, SAN s3).
s3:
image: chrislusf/seaweedfs:4.46@sha256:08d516132314207d10c8e37cbffc1f32b147d870169688734cc61c6231625b62
entrypoint: ["/bin/sh", "/etc/seaweedfs/start.sh"]
environment:
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
S3_STAGING_BUCKET: ${S3_STAGING_BUCKET:-messenger-staging}
# Go heap target below the container limit: the GC returns memory before the cgroup OOM.
GOMEMLIMIT: ${S3_GOMEMLIMIT:-600MiB}
secrets:
- s3_admin_access_key_id
- s3_admin_secret_access_key
- s3_api_access_key_id
- s3_api_secret_access_key
- s3_worker_access_key_id
- s3_worker_secret_access_key
- s3_auditor_access_key_id
- s3_auditor_secret_access_key
- {source: pki_s3_crt, target: s3.crt}
- {source: pki_s3_key, target: s3.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/seaweedfs/start.sh:/etc/seaweedfs/start.sh:ro
- s3data:/data
healthcheck:
# Unauthenticated health endpoint of the S3 gateway, over HTTPS with full verification.
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "--cacert", "/run/secrets/internal-ca.crt", "https://localhost:8333/healthz"]
interval: 2s
timeout: 3s
retries: 30
start_period: 10s
stop_grace_period: 30s
restart: unless-stopped
# Lab 7 hardening: the image starts as root only to chown its data and drop to its own user
# (gosu/su-exec): exactly the capabilities for that, nothing else (no NET_RAW, MKNOD, ...).
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETGID, SETUID]
security_opt: ["no-new-privileges:true"]
networks: [storage]
deploy:
resources:
limits: {cpus: "${S3_CPUS:-1.0}", memory: "${S3_MEMORY:-1g}"}
# RabbitMQ. Topology (exchange, quorum queue, DLX/DLQ) and users come from definition files
# imported at boot (infra/rabbitmq, secrets/rabbitmq_users.json). Lab 7: AMQPS 5671 only.
broker:
image: rabbitmq:4.3.7-alpine@sha256:b1f997f74103d08fc1f20a13890dc44fe6cfa51d528cf521b480ada988d3ffa5
hostname: broker # node name rabbit@broker: stable across container re-creation
secrets:
- source: rabbitmq_users
target: /etc/rabbitmq/definitions.d/users.json
- {source: pki_broker_crt, target: broker.crt}
- {source: pki_broker_key, target: broker.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/rabbitmq/rabbitmq.conf:/etc/rabbitmq/conf.d/20-lab.conf:ro
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
- ./infra/rabbitmq/topology.json:/etc/rabbitmq/definitions.d/topology.json:ro
- rabbitmqdata:/var/lib/rabbitmq
healthcheck:
# The node runs and its (TLS) listener accepts connections.
test: ["CMD-SHELL", "rabbitmq-diagnostics -q ping && rabbitmq-diagnostics -q check_port_connectivity"]
interval: 5s
timeout: 10s
retries: 30
start_period: 20s
stop_grace_period: 30s
restart: unless-stopped
# Lab 7 hardening: the image starts as root only to chown its data and drop to its own user
# (gosu/su-exec): exactly the capabilities for that, nothing else (no NET_RAW, MKNOD, ...).
cap_drop: [ALL]
cap_add: [CHOWN, DAC_OVERRIDE, FOWNER, SETGID, SETUID]
security_opt: ["no-new-privileges:true"]
networks: [queue]
deploy:
resources:
limits: {cpus: "${BROKER_CPUS:-1.0}", memory: "${BROKER_MEMORY:-512m}"}
# One-shot schema migration as the schema OWNER messenger_migrate (not a superuser): runs ONCE
# per `up`, before any API replica starts. Replicas never migrate themselves.
migrate:
build:
context: .
args:
BUILD_REVISION: ${BUILD_REVISION:-dev}
image: ${API_IMAGE:-mtusi-messenger:lab7}
command: ["python", "-m", "messenger.migrate"]
environment:
DATABASE_URL_FILE: /run/secrets/database_url
secrets:
- {source: database_url_migrate, target: database_url}
- {source: pki_internal_ca, target: internal-ca.crt}
depends_on:
postgres:
condition: service_healthy
healthcheck:
disable: true
restart: "no"
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [data]
deploy:
resources:
limits: {cpus: "0.5", memory: 256m}
# One-shot, idempotent S3 bootstrap: both buckets, sentinel object, verification of the access
# model (private buckets, least-privilege keys). The ONLY holder of the admin key pair besides s3.
s3-init:
image: ${API_IMAGE:-mtusi-messenger:lab7}
command: ["python", "-m", "messenger.s3_bootstrap"]
environment:
S3_ENDPOINT: ${S3_ENDPOINT:-https://s3:8333}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
S3_STAGING_BUCKET: ${S3_STAGING_BUCKET:-messenger-staging}
S3_ADMIN_ACCESS_KEY_ID_FILE: /run/secrets/s3_admin_access_key_id
S3_ADMIN_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_admin_secret_access_key
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_api_access_key_id
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_api_secret_access_key
S3_WORKER_ACCESS_KEY_ID_FILE: /run/secrets/s3_worker_access_key_id
S3_WORKER_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_worker_secret_access_key
S3_AUDITOR_ACCESS_KEY_ID_FILE: /run/secrets/s3_auditor_access_key_id
S3_AUDITOR_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_auditor_secret_access_key
TLS_CA_FILE: /run/secrets/internal-ca.crt
secrets:
- s3_admin_access_key_id
- s3_admin_secret_access_key
- s3_api_access_key_id
- s3_api_secret_access_key
- s3_worker_access_key_id
- s3_worker_secret_access_key
- s3_auditor_access_key_id
- s3_auditor_secret_access_key
- {source: pki_internal_ca, target: internal-ca.crt}
depends_on:
s3:
condition: service_healthy
migrate:
condition: service_completed_successfully # same image: built once by `migrate`
healthcheck:
disable: true
restart: "no"
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [storage]
deploy:
resources:
limits: {cpus: "0.5", memory: 256m}
api:
build:
context: .
args:
BUILD_REVISION: ${BUILD_REVISION:-dev}
image: ${API_IMAGE:-mtusi-messenger:lab7}
environment:
<<: [*api-env, *otel-env, *bao-env]
OTEL_SERVICE_NAME: messenger-api
BAO_SECRET_PATH: messenger/data/api
# Lab 7: the only network listener is mTLS on 8443 (tls.py); plaintext health on loopback.
APP_PORT: 8443
APP_HEALTH_PORT: 8081
TLS_CERT_FILE: /run/secrets/service.crt
TLS_KEY_FILE: /run/secrets/service.key
TLS_CLIENT_CA_FILE: /run/secrets/internal-ca.crt
MTLS_ALLOWED_CLIENTS: ${MTLS_ALLOWED_CLIENTS:-lb}
secrets:
- {source: bao_api_role_id, target: bao_role_id}
- {source: bao_api_secret_id, target: bao_secret_id}
- {source: pki_api_crt, target: service.crt}
- {source: pki_api_key, target: service.key}
- {source: pki_internal_ca, target: internal-ca.crt}
# No `ports` and no container_name: replicas are reachable only through `lb`,
# and `--scale api=N` / deploy.replicas works.
expose: ["8443"]
healthcheck:
test: ["CMD", "python", "-m", "messenger.healthcheck"]
interval: 2s
# 5 s: starting the Python probe alone took > 2 s on a loaded Windows host (lab 7 clean run),
# which kept a healthy replica "unhealthy". The probe's own HTTP timeout stays 2 s.
timeout: 5s
retries: 3
# Lab 7: the start includes the OpenBao login and the first TLS connections; after a cold
# Docker start this took > 11 s once and `up --wait` gave up. Failures inside start_period do
# not count; after the first success a failed replica is still detected in 3 x 2 s.
start_period: 30s
depends_on:
postgres:
condition: service_healthy
valkey:
condition: service_healthy
s3:
condition: service_healthy
migrate:
condition: service_completed_successfully
s3-init:
condition: service_completed_successfully
openbao:
condition: service_healthy # healthy = unsealed (see the openbao healthcheck)
stop_grace_period: 15s # > DRAIN_SECONDS + SHUTDOWN_TIMEOUT_SECONDS (11 s)
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [edge, data, storage, telemetry, vault]
deploy:
replicas: ${API_REPLICAS:-2}
resources:
# 512m: UPLOAD_CONCURRENCY (4) x 10 MiB bodies + one djpeg (<= JPEG_MAX_MEMORY_MB) + runtime;
# measured in lab 4. No resizing happens in the API.
limits: {cpus: "${API_CPUS:-1.0}", memory: "${API_MEMORY:-512m}"}
# No swap on top of the limit: the RAM bound is a real bound.
memswap_limit: ${API_MEMORY:-512m}
lb:
image: haproxy:3.2.26-alpine@sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122
volumes:
- ./infra/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
secrets:
- source: pki_ingress_pem # public-ca leaf + key, SAN localhost/127.0.0.1/::1
target: ingress.pem
- source: pki_lb_pem # client identity towards the API (internal CA, SAN lb)
target: lb.pem
- source: pki_internal_ca
target: internal-ca.crt # verifies the replicas (SAN api)
ports:
# The ONLY public entry point: HTTPS, on the loopback interfaces only. Both IPv4 and IPv6:
# on Windows `localhost` resolves to ::1 first, and a refused ::1 connection costs ~2 s
# per request before the fallback to 127.0.0.1 (measured in lab 3: 2.0 s vs 0.007 s).
- "127.0.0.1:${APP_PUBLISH_PORT:-8443}:8443"
- "[::1]:${APP_PUBLISH_PORT:-8443}:8443"
healthcheck:
# Config is valid and the process answers; whether any API is ready is the LB's own job.
test: ["CMD-SHELL", "haproxy -c -q -f /usr/local/etc/haproxy/haproxy.cfg && wget -q -O /dev/null http://127.0.0.1:8404/"]
interval: 5s
timeout: 3s
retries: 3
depends_on:
api:
condition: service_healthy
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [edge]
deploy:
resources:
limits: {cpus: "${LB_CPUS:-1.0}", memory: 128m}
# Outbox relay + lease reaper (src/messenger/relay.py). Database + broker only, no S3 keys.
relay:
image: ${API_IMAGE:-mtusi-messenger:lab7}
command: ["python", "-m", "messenger.relay"]
environment:
<<: [*pipeline-env, *otel-env, *bao-env]
OTEL_SERVICE_NAME: messenger-relay
BAO_SECRET_PATH: messenger/data/relay
RELAY_POLL_SECONDS: ${RELAY_POLL_SECONDS:-0.5}
FAULT_POINTS: ${RELAY_FAULT_POINTS:-}
secrets:
- {source: bao_relay_role_id, target: bao_role_id}
- {source: bao_relay_secret_id, target: bao_secret_id}
- {source: pki_relay_crt, target: service.crt}
- {source: pki_relay_key, target: service.key}
- {source: pki_internal_ca, target: internal-ca.crt}
healthcheck:
test: ["CMD", "python", "-m", "messenger.healthcheck", "--file", "/tmp/heartbeat", "--max-age", "30"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
postgres:
condition: service_healthy
broker:
condition: service_healthy
migrate:
condition: service_completed_successfully
openbao:
condition: service_healthy
stop_grace_period: 10s
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [data, queue, telemetry, vault]
deploy:
resources:
limits: {cpus: "${RELAY_CPUS:-0.5}", memory: 256m}
# Image worker (src/messenger/worker.py). Scalable (`--scale worker=2`): competing consumers of
# one queue; the database lease decides who works on a job.
worker:
image: ${API_IMAGE:-mtusi-messenger:lab7}
command: ["python", "-m", "messenger.worker"]
environment:
<<: [*pipeline-env, *otel-env, *bao-env]
OTEL_SERVICE_NAME: messenger-worker
BAO_SECRET_PATH: messenger/data/worker
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-2}
WORKER_SHUTDOWN_SECONDS: ${WORKER_SHUTDOWN_SECONDS:-20}
IMAGE_MAX_MEMORY_MB: ${IMAGE_MAX_MEMORY_MB:-768}
STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400}
ORPHAN_GRACE_SECONDS: ${ORPHAN_GRACE_SECONDS:-600}
CLEANUP_INTERVAL_SECONDS: ${CLEANUP_INTERVAL_SECONDS:-30}
FAULT_POINTS: ${WORKER_FAULT_POINTS:-}
secrets:
- {source: bao_worker_role_id, target: bao_role_id}
- {source: bao_worker_secret_id, target: bao_secret_id}
- {source: pki_worker_crt, target: service.crt}
- {source: pki_worker_key, target: service.key}
- {source: pki_internal_ca, target: internal-ca.crt}
healthcheck:
test: ["CMD", "python", "-m", "messenger.healthcheck", "--file", "/tmp/heartbeat", "--max-age", "30"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
postgres:
condition: service_healthy
broker:
condition: service_healthy
s3:
condition: service_healthy
migrate:
condition: service_completed_successfully
s3-init:
condition: service_completed_successfully
openbao:
condition: service_healthy
stop_grace_period: 30s # > WORKER_SHUTDOWN_SECONDS (20 s) + release
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [data, storage, queue, telemetry, vault]
deploy:
replicas: ${WORKER_REPLICAS:-1}
resources:
# WORKER_CONCURRENCY (2) child processes x IMAGE_MAX_MEMORY_MB (768) address space + worker.
limits: {cpus: "${WORKER_CPUS:-2.0}", memory: "${WORKER_MEMORY:-1536m}"}
memswap_limit: ${WORKER_MEMORY:-1536m}
# Read-only checker of the pipeline invariants (database role messenger_auditor: SELECT only,
# S3 auditor key: Read + List, no Write). On demand: docker compose run --rm auditor
auditor:
profiles: ["tools"]
image: ${API_IMAGE:-mtusi-messenger:lab7}
entrypoint: ["python", "-m", "messenger.audit"]
command: []
environment:
DATABASE_URL_FILE: /run/secrets/database_url
DB_TIMEOUT_SECONDS: ${AUDIT_DB_TIMEOUT_SECONDS:-30}
S3_ENDPOINT: ${S3_ENDPOINT:-https://s3:8333}
S3_REGION: ${S3_REGION:-us-east-1}
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
S3_STAGING_BUCKET: ${S3_STAGING_BUCKET:-messenger-staging}
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_access_key_id
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_secret_access_key
S3_TIMEOUT_SECONDS: ${S3_TIMEOUT_SECONDS:-3}
TLS_CA_FILE: /run/secrets/internal-ca.crt
secrets:
- {source: database_url_auditor, target: database_url}
- {source: s3_auditor_access_key_id, target: s3_access_key_id}
- {source: s3_auditor_secret_access_key, target: s3_secret_access_key}
- {source: pki_internal_ca, target: internal-ca.crt}
depends_on:
postgres:
condition: service_healthy
s3:
condition: service_healthy
restart: "no"
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [data, storage]
deploy:
resources:
limits: {cpus: "1.0", memory: 256m}
# Operator CLI (replay of failed jobs, reprocess with a newer pipeline, failed registry):
# docker compose run --rm jobctl list-failed
jobctl:
profiles: ["tools"]
image: ${API_IMAGE:-mtusi-messenger:lab7}
entrypoint: ["python", "-m", "messenger.jobctl"]
command: []
environment:
DATABASE_URL_FILE: /run/secrets/database_url
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
secrets:
- {source: database_url_jobctl, target: database_url}
- {source: pki_internal_ca, target: internal-ca.crt}
depends_on:
postgres:
condition: service_healthy
restart: "no"
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [data]
deploy:
resources:
limits: {cpus: "0.5", memory: 128m}
# Lab 7: proof of the LB -> API mTLS against every replica directly (scripts/mtls_check.py):
# docker compose run --rm mtls-check
# Joins `edge` like the LB. Test-only material: the LB client key (positive case), the worker
# certificate (trusted CA, wrong role) and a certificate of a foreign CA with SAN lb.
mtls-check:
profiles: ["tools"]
image: ${API_IMAGE:-mtusi-messenger:lab7}
entrypoint: ["python", "/opt/check/mtls_check.py"]
command: []
volumes:
- ./scripts/mtls_check.py:/opt/check/mtls_check.py:ro
secrets:
- {source: pki_internal_ca, target: internal-ca.crt}
- {source: pki_lb_crt, target: lb.crt}
- {source: pki_lb_key, target: lb.key}
- {source: pki_worker_crt, target: worker.crt}
- {source: pki_worker_key, target: worker.key}
- {source: pki_foreign_lb_crt, target: foreign-lb.crt}
- {source: pki_foreign_lb_key, target: foreign-lb.key}
restart: "no"
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [edge]
deploy:
resources:
limits: {cpus: "0.5", memory: 128m}
# ------------------------------------------------------------------ secrets (lab 7)
# OpenBao, NOT dev mode: file storage on the volume baodata, TLS listener (infra/openbao/config.hcl),
# starts SEALED. Operator: scripts/bao_operator.py bootstrap | unseal (docs/OPERATOR.md); the root
# token and the unseal shares stay with the operator, outside the repository and all containers.
# Reachable only on the internal network `vault` (api, relay, worker). Image user: openbao (non-root).
openbao:
image: openbao/openbao:2.7.3@sha256:b9418c63e2185157d8ee8689a8a93265d5aadad677d6320156172bd42ad3b10b
command: ["server"] # entrypoint: bao server -config=/openbao/config (no -dev)
environment:
# For the operator CLI inside the container (docker compose exec): TLS to itself, verified.
BAO_ADDR: https://127.0.0.1:8200
BAO_CACERT: /run/secrets/internal-ca.crt
secrets:
- {source: pki_openbao_crt, target: openbao.crt}
- {source: pki_openbao_key, target: openbao.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/openbao/config.hcl:/openbao/config/lab.hcl:ro
- baodata:/openbao/file
healthcheck:
# `bao status` exits 0 only when initialized AND unsealed (2 = sealed): the application
# services wait for this (depends_on service_healthy) - a sealed OpenBao starts no new replica.
test: ["CMD", "bao", "status"]
interval: 3s
timeout: 3s
retries: 3
start_period: 5s
stop_grace_period: 15s
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [vault]
deploy:
resources:
limits: {cpus: "0.5", memory: 256m}
memswap_limit: 256m
# ------------------------------------------------------------------ observability (lab 6)
# Receives OTLP from api/relay/worker, limits memory, batches, forwards to the three stores.
# Distroless image (no shell). Lab 7: receiver HTTPS + client certificate required, exporters mTLS.
otel-collector:
image: otel/opentelemetry-collector-contrib:0.165.0@sha256:e40d61f10c9a617cca1ffd1be4d7e2b3a4b0f0001798ff07e58cabe82e618cea
command: ["--config=/etc/otelcol/collector.yaml"]
environment:
GOMEMLIMIT: 360MiB # Go heap target under the 512 MiB container limit
secrets:
- {source: pki_otel_collector_crt, target: otel-collector.crt}
- {source: pki_otel_collector_key, target: otel-collector.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/otel:/etc/otelcol:ro
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [telemetry]
deploy:
resources:
limits: {cpus: "${COLLECTOR_CPUS:-1.0}", memory: 512m}
memswap_limit: 512m
# Metrics store + alert rules. Lab 7: HTTPS + client certificate + SAN allowlist (web-config.yml).
prometheus:
image: prom/prometheus:v3.16.0@sha256:e04987641b57704f408e31f6373ba4138ecf27cb4a165d24aabb6c38fddd0f06
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.config.file=/etc/prometheus/web-config.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=15d
- --storage.tsdb.retention.size=2GB
- --web.enable-otlp-receiver
- --web.listen-address=:9090
secrets:
- {source: pki_prometheus_crt, target: prometheus.crt}
- {source: pki_prometheus_key, target: prometheus.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./infra/prometheus/web-config.yml:/etc/prometheus/web-config.yml:ro
- ./infra/prometheus/promtool-http.yml:/etc/prometheus/promtool-http.yml:ro
- ./infra/prometheus/rules:/etc/prometheus/rules:ro
- promdata:/prometheus
healthcheck:
test: ["CMD", "promtool", "check", "ready", "--url=https://localhost:9090", "--http.config.file=/etc/prometheus/promtool-http.yml"]
interval: 5s
timeout: 3s
retries: 30
start_period: 10s
stop_grace_period: 30s
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [telemetry]
deploy:
resources:
limits: {cpus: "${PROMETHEUS_CPUS:-1.0}", memory: 512m}
memswap_limit: 512m
# Logs store (OTLP endpoint /otlp). Distroless. Lab 7: HTTPS + client certificate required.
loki:
image: grafana/loki:3.7.10@sha256:b43c257ccfc925d4a50b8717cac61a3b51df8c48d01847936057e5c4075a24a7
command: ["-config.file=/etc/loki/lab.yaml"]
secrets:
- {source: pki_loki_crt, target: loki.crt}
- {source: pki_loki_key, target: loki.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/loki/loki.yaml:/etc/loki/lab.yaml:ro
- lokidata:/loki
stop_grace_period: 30s
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [telemetry]
deploy:
resources:
limits: {cpus: "${LOKI_CPUS:-1.0}", memory: 512m}
memswap_limit: 512m
# Traces store (OTLP/HTTPS :4318, query API :3200). Distroless. Lab 7: both listeners mTLS.
tempo:
image: grafana/tempo:2.10.10@sha256:12b0820f13ffa10ce956b6e9acc3b03f3cffded99109be6cc09d106fe56e5d38
command: ["-config.file=/etc/tempo/lab.yaml"]
secrets:
- {source: pki_tempo_crt, target: tempo.crt}
- {source: pki_tempo_key, target: tempo.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/tempo/tempo.yaml:/etc/tempo/lab.yaml:ro
- tempodata:/var/tempo
stop_grace_period: 30s
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [telemetry]
deploy:
resources:
limits: {cpus: "${TEMPO_CPUS:-1.0}", memory: 512m}
memswap_limit: 512m
# UI: datasources (fixed UIDs) and the dashboard are provisioned from Git. Lab 7: HTTPS on
# 127.0.0.1/[::1]:3000 with a public-CA certificate (SAN localhost), datasources over mTLS.
# Admin password = secrets/grafana_admin_password (init_secrets.py).
grafana:
image: grafana/grafana:13.2.6@sha256:b21409d7951ddcfd63a4b49083e4ef2cc35bc1437d071813bf82bfb238b00bca
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_admin_password
GF_SERVER_PROTOCOL: https
GF_SERVER_CERT_FILE: /run/secrets/grafana-ui.crt
GF_SERVER_CERT_KEY: /run/secrets/grafana-ui.key
GF_SERVER_MIN_TLS_VERSION: TLS1.2
GF_SERVER_DOMAIN: localhost
GF_SECURITY_COOKIE_SECURE: "true"
GF_USERS_ALLOW_SIGN_UP: "false"
GF_AUTH_ANONYMOUS_ENABLED: "false"
GF_ANALYTICS_REPORTING_ENABLED: "false"
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: "false"
GF_NEWS_NEWS_FEED_ENABLED: "false"
GF_PLUGINS_PREINSTALL_DISABLED: "true" # no plugin downloads at start: works offline
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/messenger.json
GF_LOG_LEVEL: warn
GOMEMLIMIT: 700MiB # Go heap target under the 1 GiB limit
secrets:
- grafana_admin_password
- {source: pki_grafana_ui_crt, target: grafana-ui.crt}
- {source: pki_grafana_ui_key, target: grafana-ui.key}
- {source: pki_public_ca, target: public-ca.crt}
- {source: pki_grafana_crt, target: grafana.crt}
- {source: pki_grafana_key, target: grafana.key}
- {source: pki_internal_ca, target: internal-ca.crt}
volumes:
- ./infra/grafana/provisioning:/etc/grafana/provisioning:ro
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafanadata:/var/lib/grafana
ports:
- "127.0.0.1:${GRAFANA_PORT:-3000}:3000"
- "[::1]:${GRAFANA_PORT:-3000}:3000"
healthcheck:
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "--cacert", "/run/secrets/public-ca.crt", "https://localhost:3000/api/health"]
interval: 5s
timeout: 3s
retries: 30
start_period: 20s
depends_on:
prometheus:
condition: service_healthy
loki:
condition: service_started
tempo:
condition: service_started
restart: unless-stopped
# Lab 7 hardening: no Linux capabilities at all, no privilege gain via setuid binaries.
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
networks: [telemetry, ui]
deploy:
resources:
limits: {cpus: "${GRAFANA_CPUS:-1.0}", memory: 1g}
memswap_limit: 1g
networks:
edge:
data:
internal: true # no route outside: stores talk only to the services above
storage:
internal: true # S3 API reachable only by api, s3-init, worker, auditor
queue:
internal: true # broker reachable only by relay and worker
telemetry:
internal: true # OTLP + stores: apps, collector, prometheus, loki, tempo, grafana
ui: # only Grafana: publishes 127.0.0.1:3000
vault:
internal: true # OpenBao: reachable only by api, relay, worker
volumes:
pgdata:
valkeydata:
s3data:
rabbitmqdata:
promdata:
lokidata:
tempodata:
grafanadata:
baodata: # OpenBao storage (encrypted by its barrier key)
# Every value is a file in ./secrets (scripts/init_secrets.py, git-ignored), mounted read-only
# under /run/secrets ONLY into the services listed above.
secrets:
postgres_password:
file: ./secrets/postgres_password
pg_migrate_password:
file: ./secrets/pg_migrate_password
pg_api_password:
file: ./secrets/pg_api_password
pg_relay_password:
file: ./secrets/pg_relay_password
pg_worker_password:
file: ./secrets/pg_worker_password
pg_jobctl_password:
file: ./secrets/pg_jobctl_password
pg_auditor_password:
file: ./secrets/pg_auditor_password
database_url_migrate:
file: ./secrets/database_url_migrate
database_url_jobctl:
file: ./secrets/database_url_jobctl
database_url_auditor:
file: ./secrets/database_url_auditor
valkey_api_password:
file: ./secrets/valkey_api_password
s3_admin_access_key_id:
file: ./secrets/s3_admin_access_key_id
s3_admin_secret_access_key:
file: ./secrets/s3_admin_secret_access_key
s3_api_access_key_id:
file: ./secrets/s3_api_access_key_id
s3_api_secret_access_key:
file: ./secrets/s3_api_secret_access_key
s3_worker_access_key_id:
file: ./secrets/s3_worker_access_key_id
s3_worker_secret_access_key:
file: ./secrets/s3_worker_secret_access_key
s3_auditor_access_key_id:
file: ./secrets/s3_auditor_access_key_id
s3_auditor_secret_access_key:
file: ./secrets/s3_auditor_secret_access_key
rabbitmq_users:
file: ./secrets/rabbitmq_users.json
grafana_admin_password:
file: ./secrets/grafana_admin_password
# Lab 7 PKI (scripts/init_pki.py). Each service mounts only its own certificate/key and the CA it
# verifies peers with; the CA private keys are mounted nowhere.
pki_public_ca:
file: ./secrets/pki/public-ca.crt
pki_internal_ca:
file: ./secrets/pki/internal-ca.crt
pki_ingress_pem:
file: ./secrets/pki/ingress.pem
pki_lb_pem:
file: ./secrets/pki/lb.pem
pki_lb_crt:
file: ./secrets/pki/lb.crt
pki_lb_key:
file: ./secrets/pki/lb.key
pki_api_crt:
file: ./secrets/pki/api.crt
pki_api_key:
file: ./secrets/pki/api.key
pki_relay_crt:
file: ./secrets/pki/relay.crt
pki_relay_key:
file: ./secrets/pki/relay.key
pki_worker_crt:
file: ./secrets/pki/worker.crt
pki_worker_key:
file: ./secrets/pki/worker.key
pki_postgres_crt:
file: ./secrets/pki/postgres.crt
pki_postgres_key:
file: ./secrets/pki/postgres.key
pki_valkey_crt:
file: ./secrets/pki/valkey.crt
pki_valkey_key:
file: ./secrets/pki/valkey.key
pki_s3_crt:
file: ./secrets/pki/s3.crt
pki_s3_key:
file: ./secrets/pki/s3.key
pki_broker_crt:
file: ./secrets/pki/broker.crt
pki_broker_key:
file: ./secrets/pki/broker.key
pki_otel_collector_crt:
file: ./secrets/pki/otel-collector.crt
pki_otel_collector_key:
file: ./secrets/pki/otel-collector.key
pki_prometheus_crt:
file: ./secrets/pki/prometheus.crt
pki_prometheus_key:
file: ./secrets/pki/prometheus.key
pki_loki_crt:
file: ./secrets/pki/loki.crt
pki_loki_key:
file: ./secrets/pki/loki.key
pki_tempo_crt:
file: ./secrets/pki/tempo.crt
pki_tempo_key:
file: ./secrets/pki/tempo.key
pki_grafana_crt:
file: ./secrets/pki/grafana.crt
pki_grafana_key:
file: ./secrets/pki/grafana.key
pki_grafana_ui_crt:
file: ./secrets/pki/grafana-ui.crt
pki_grafana_ui_key:
file: ./secrets/pki/grafana-ui.key
pki_openbao_crt:
file: ./secrets/pki/openbao.crt
pki_openbao_key:
file: ./secrets/pki/openbao.key
# AppRole credentials, written by scripts/bao_operator.py bootstrap (the first secret of a service).
bao_api_role_id:
file: ./secrets/bao/api_role_id
bao_api_secret_id:
file: ./secrets/bao/api_secret_id
bao_relay_role_id:
file: ./secrets/bao/relay_role_id
bao_relay_secret_id:
file: ./secrets/bao/relay_secret_id
bao_worker_role_id:
file: ./secrets/bao/worker_role_id
bao_worker_secret_id:
file: ./secrets/bao/worker_secret_id
pki_foreign_lb_crt: # test only: foreign CA, SAN lb
file: ./secrets/pki/foreign-lb.crt
pki_foreign_lb_key:
file: ./secrets/pki/foreign-lb.key