This commit is contained in:
@@ -18,3 +18,5 @@ __pycache__
|
||||
node_modules
|
||||
evidence
|
||||
.DS_Store
|
||||
build
|
||||
student-tests/__pycache__
|
||||
|
||||
+6
-41
@@ -1,41 +1,6 @@
|
||||
# Copy to .env for your LOCAL synthetic test environment; never commit .env.
|
||||
# These are logical interface suggestions; map actual framework names in REPORT.md.
|
||||
APP_HOST=0.0.0.0
|
||||
APP_PORT=8080
|
||||
APP_ENV=lab
|
||||
SESSION_TTL_SECONDS=3600
|
||||
# Choose credentials locally. File paths contain no secret values.
|
||||
DATABASE_URL_FILE=/run/secrets/database_url
|
||||
# Optional on 3, required use on 4 in lab2; Redis OR Valkey:
|
||||
SESSION_STORE=postgres
|
||||
CACHE_URL_FILE=/run/secrets/cache_url
|
||||
API_REPLICAS=2
|
||||
IDEMPOTENCY_TTL_SECONDS=86400
|
||||
S3_ENDPOINT=https://s3:9000
|
||||
S3_REGION=us-east-1
|
||||
S3_BUCKET=messenger-attachments
|
||||
S3_ACCESS_KEY_ID_FILE=/run/secrets/s3_access_key_id
|
||||
S3_SECRET_ACCESS_KEY_FILE=/run/secrets/s3_secret_access_key
|
||||
MAX_UPLOAD_BYTES=10485760
|
||||
MAX_IMAGE_PIXELS=40000000
|
||||
BROKER_URL_FILE=/run/secrets/broker_url
|
||||
WORKER_CONCURRENCY=2
|
||||
JOB_MAX_ATTEMPTS=5
|
||||
JOB_TIMEOUT_SECONDS=60
|
||||
STAGING_RETENTION_SECONDS=86400
|
||||
OTEL_SERVICE_NAME=messenger-api
|
||||
# Worker must set a distinct service.name.
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
|
||||
OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=lab
|
||||
# TLS and OpenBao: actual paths/ports depend on your implemented trust matrix.
|
||||
PUBLIC_BASE_URL=https://localhost:8443
|
||||
TLS_CA_FILE=/run/secrets/ca.crt
|
||||
TLS_CERT_FILE=/run/secrets/service.crt
|
||||
TLS_KEY_FILE=/run/secrets/service.key
|
||||
BAO_ADDR=https://openbao:8200
|
||||
BAO_CACERT=/run/secrets/bao-ca.crt
|
||||
# No root token here. Bootstrap operator -> short-lived service auth -> scoped token.
|
||||
ARGON2_MEMORY_KIB=19456
|
||||
ARGON2_ITERATIONS=2
|
||||
ARGON2_PARALLELISM=1
|
||||
# Nonsecret settings only. Run scripts/bootstrap-pki.sh and scripts/bootstrap-openbao.sh.
|
||||
HTTPS_PORT=8443
|
||||
BAO_PORT=8200
|
||||
GRAFANA_PORT=3000
|
||||
LOCAL_UID=1000
|
||||
LOCAL_GID=1000
|
||||
|
||||
@@ -30,3 +30,5 @@ coverage/
|
||||
.vscode/
|
||||
# Keep small, sanitized evidence summaries in evidence/ under version control.
|
||||
# Inspect git diff --cached: ignore rules are not a secret scanner.
|
||||
|
||||
certs/
|
||||
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(mtusi_messenger CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Official MinIO C++ SDK (S3-compatible). Pinned tag; not a hand-rolled SigV4.
|
||||
set(MTUSI_MINIO_CPP_VERSION "v0.3.0" CACHE STRING "minio-cpp git tag")
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(CURL REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(PQXX REQUIRED IMPORTED_TARGET libpqxx>=7.8)
|
||||
pkg_check_modules(HIREDIS REQUIRED IMPORTED_TARGET hiredis)
|
||||
pkg_check_modules(SODIUM REQUIRED IMPORTED_TARGET libsodium)
|
||||
pkg_check_modules(EXIF REQUIRED IMPORTED_TARGET libexif)
|
||||
pkg_check_modules(WEBP REQUIRED IMPORTED_TARGET libwebp)
|
||||
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ImportMinioDeps.cmake")
|
||||
|
||||
include(FetchContent)
|
||||
set(MINIO_CPP_TEST OFF CACHE BOOL "" FORCE)
|
||||
set(MINIO_CPP_MAKE_DOC OFF CACHE BOOL "" FORCE)
|
||||
FetchContent_Declare(
|
||||
miniocpp
|
||||
GIT_REPOSITORY https://github.com/minio/minio-cpp.git
|
||||
GIT_TAG ${MTUSI_MINIO_CPP_VERSION}
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
# Inject find_package stubs before miniocpp configures.
|
||||
function(_mtusi_provide_minio_find_packages)
|
||||
# miniocpp calls find_package(unofficial-curlpp CONFIG) etc.
|
||||
# We already created ALIAS targets; create tiny config files in a prefix.
|
||||
set(_cfg_dir "${CMAKE_CURRENT_BINARY_DIR}/mtusi-minio-deps")
|
||||
file(MAKE_DIRECTORY "${_cfg_dir}")
|
||||
file(WRITE "${_cfg_dir}/unofficial-curlpp-config.cmake" "")
|
||||
file(WRITE "${_cfg_dir}/unofficial-inih-config.cmake" "")
|
||||
list(PREPEND CMAKE_PREFIX_PATH "${_cfg_dir}")
|
||||
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
_mtusi_provide_minio_find_packages()
|
||||
|
||||
FetchContent_GetProperties(miniocpp)
|
||||
if(NOT miniocpp_POPULATED)
|
||||
FetchContent_Populate(miniocpp)
|
||||
# Neutralize CONFIG find_package calls by providing empty configs + targets.
|
||||
set(CMAKE_FIND_PACKAGE_REDIRECTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/mtusi-find-redirects")
|
||||
file(MAKE_DIRECTORY "${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}")
|
||||
# CMake 3.24+ redirects; for older, patch via policy: set variables that
|
||||
# make find_package(CONFIG) succeed when targets already exist.
|
||||
set(unofficial-curlpp_DIR "${CMAKE_CURRENT_BINARY_DIR}/mtusi-minio-deps" CACHE PATH "" FORCE)
|
||||
set(unofficial-inih_DIR "${CMAKE_CURRENT_BINARY_DIR}/mtusi-minio-deps" CACHE PATH "" FORCE)
|
||||
# Provide package config bodies that are no-ops (targets already defined).
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mtusi-minio-deps/unofficial-curlpp-config.cmake"
|
||||
"# provided by ImportMinioDeps.cmake\n")
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mtusi-minio-deps/unofficial-inih-config.cmake"
|
||||
"# provided by ImportMinioDeps.cmake\n")
|
||||
# Skip miniocpp install(EXPORT) — our INTERFACE system deps are not exportable.
|
||||
set(CMAKE_SKIP_INSTALL_RULES ON)
|
||||
add_subdirectory(${miniocpp_SOURCE_DIR} ${miniocpp_BINARY_DIR})
|
||||
set(CMAKE_SKIP_INSTALL_RULES OFF)
|
||||
endif()
|
||||
|
||||
# OpenTelemetry C++ v1.21.0, OTLP HTTP/protobuf only (no gRPC).
|
||||
set(WITH_OTLP_HTTP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OTLP_GRPC OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FUNC_TESTS OFF CACHE BOOL "" FORCE)
|
||||
FetchContent_Declare(opentelemetry_cpp
|
||||
GIT_REPOSITORY https://github.com/open-telemetry/opentelemetry-cpp.git
|
||||
GIT_TAG v1.21.0 # b9cf499ff5715433848b316059714b5c59af1f2c
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_SUBMODULES "")
|
||||
FetchContent_MakeAvailable(opentelemetry_cpp)
|
||||
|
||||
option(LAB7_DEPS_ONLY "Build pinned third-party dependencies only" OFF)
|
||||
if(LAB7_DEPS_ONLY)
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_library(messenger_core STATIC
|
||||
src/bao.cpp
|
||||
src/telemetry.cpp
|
||||
src/observability_monitor.cpp
|
||||
src/db.cpp
|
||||
src/auth.cpp
|
||||
src/user_repo.cpp
|
||||
src/chat_repo.cpp
|
||||
src/message_repo.cpp
|
||||
src/redis_pool.cpp
|
||||
src/session_repo.cpp
|
||||
src/pg_session_repo.cpp
|
||||
src/s3_client.cpp
|
||||
src/image_util.cpp
|
||||
src/attachment_repo.cpp
|
||||
src/attachment_queue.cpp
|
||||
src/outbox.cpp
|
||||
src/staging_cleaner.cpp
|
||||
src/job_repo.cpp
|
||||
src/image_pipeline.cpp
|
||||
src/direct_upload_repo.cpp
|
||||
)
|
||||
|
||||
target_include_directories(messenger_core PUBLIC
|
||||
src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/third_party/stb
|
||||
)
|
||||
target_compile_definitions(messenger_core PUBLIC
|
||||
MTUSI_MINIO_CPP_VERSION="${MTUSI_MINIO_CPP_VERSION}"
|
||||
)
|
||||
|
||||
target_link_libraries(messenger_core PUBLIC
|
||||
Threads::Threads
|
||||
PkgConfig::PQXX
|
||||
PkgConfig::HIREDIS
|
||||
hiredis_ssl
|
||||
OpenSSL::SSL
|
||||
CURL::libcurl
|
||||
PkgConfig::SODIUM
|
||||
PkgConfig::EXIF
|
||||
PkgConfig::WEBP
|
||||
opentelemetry_exporter_otlp_http
|
||||
opentelemetry_exporter_otlp_http_metric
|
||||
opentelemetry_exporter_otlp_http_log
|
||||
miniocpp::miniocpp
|
||||
)
|
||||
|
||||
add_executable(messenger src/main.cpp)
|
||||
target_link_libraries(messenger PRIVATE messenger_core)
|
||||
|
||||
add_executable(worker src/worker_main.cpp)
|
||||
target_link_libraries(worker PRIVATE messenger_core)
|
||||
|
||||
add_executable(s3_smoke tools/s3_smoke.cpp)
|
||||
target_link_libraries(s3_smoke PRIVATE messenger_core)
|
||||
|
||||
add_executable(image_smoke tools/image_smoke.cpp)
|
||||
target_link_libraries(image_smoke PRIVATE messenger_core)
|
||||
target_compile_definitions(image_smoke PRIVATE
|
||||
IMAGE_SMOKE_FIXTURES="${CMAKE_SOURCE_DIR}/tools/fixtures"
|
||||
)
|
||||
|
||||
add_executable(thumbnail_smoke tools/thumbnail_smoke.cpp)
|
||||
target_link_libraries(thumbnail_smoke PRIVATE messenger_core)
|
||||
|
||||
add_executable(variants_smoke tools/variants_smoke.cpp)
|
||||
target_link_libraries(variants_smoke PRIVATE messenger_core)
|
||||
|
||||
add_executable(job_admin src/job_admin_main.cpp)
|
||||
target_link_libraries(job_admin PRIVATE messenger_core)
|
||||
|
||||
add_executable(telemetry_test student-tests/telemetry_test.cpp)
|
||||
target_link_libraries(telemetry_test PRIVATE messenger_core)
|
||||
target_compile_options(telemetry_test PRIVATE -UNDEBUG)
|
||||
|
||||
add_executable(auth_security_test student-tests/auth_security_test.cpp src/auth.cpp)
|
||||
target_include_directories(auth_security_test PRIVATE src)
|
||||
target_link_libraries(auth_security_test PRIVATE PkgConfig::SODIUM)
|
||||
target_compile_options(auth_security_test PRIVATE -UNDEBUG)
|
||||
|
||||
add_executable(dependency_security_test student-tests/dependency_security_test.cpp)
|
||||
target_link_libraries(dependency_security_test PRIVATE messenger_core)
|
||||
target_compile_options(dependency_security_test PRIVATE -UNDEBUG)
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": 6,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 16,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Release with minio-cpp",
|
||||
"generator": "Unix Makefiles",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"MTUSI_MINIO_CPP_VERSION": "v0.3.0"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "release",
|
||||
"configurePreset": "release"
|
||||
}
|
||||
]
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Clean-clone build: Ubuntu 24.04 + libpqxx from a pinned git tag.
|
||||
# S3 client: official minio-cpp v0.3.0 via FetchContent (library SigV4).
|
||||
# No dependency on mtusi2026lab3-api or other prior-lab images.
|
||||
|
||||
ARG PQXX_VERSION=7.10.0
|
||||
ARG MTUSI_MINIO_CPP_VERSION=v0.3.0
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Stage: build libpqxx into /opt/libpqxx
|
||||
# ---------------------------------------------------------------------------
|
||||
FROM ubuntu:24.04 AS pqxx
|
||||
ARG PQXX_VERSION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential cmake git ca-certificates pkg-config \
|
||||
libpq-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /tmp
|
||||
RUN git clone --depth 1 --branch "${PQXX_VERSION}" \
|
||||
https://github.com/jtv/libpqxx.git libpqxx-src \
|
||||
&& cmake -S libpqxx-src -B libpqxx-build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/libpqxx \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DSKIP_BUILD_TEST=ON \
|
||||
&& cmake --build libpqxx-build -j"$(nproc)" \
|
||||
&& cmake --install libpqxx-build \
|
||||
&& rm -rf /tmp/libpqxx-src /tmp/libpqxx-build
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Stage: build messenger + worker + smokes
|
||||
# ---------------------------------------------------------------------------
|
||||
FROM ubuntu:24.04 AS builder
|
||||
ARG MTUSI_MINIO_CPP_VERSION
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential cmake pkg-config git ca-certificates \
|
||||
libpq-dev \
|
||||
libhiredis-dev \
|
||||
libsodium-dev libexif-dev libwebp-dev \
|
||||
libprotobuf-dev protobuf-compiler \
|
||||
nlohmann-json3-dev \
|
||||
libcurl4-openssl-dev libssl-dev zlib1g-dev \
|
||||
libpugixml-dev \
|
||||
libcurlpp-dev \
|
||||
libinih-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --depth 1 --branch v1.2.0 https://github.com/redis/hiredis.git /tmp/hiredis \
|
||||
&& make -C /tmp/hiredis USE_SSL=1 -j2 \
|
||||
&& make -C /tmp/hiredis USE_SSL=1 install \
|
||||
&& rm -rf /tmp/hiredis
|
||||
COPY --from=pqxx /opt/libpqxx /opt/libpqxx
|
||||
ENV PKG_CONFIG_PATH=/opt/libpqxx/lib/pkgconfig:/opt/libpqxx/lib/x86_64-linux-gnu/pkgconfig
|
||||
ENV LD_LIBRARY_PATH=/opt/libpqxx/lib:/opt/libpqxx/lib/x86_64-linux-gnu
|
||||
ENV CMAKE_PREFIX_PATH=/opt/libpqxx
|
||||
|
||||
WORKDIR /src
|
||||
COPY CMakeLists.txt CMakePresets.json ./
|
||||
COPY cmake ./cmake
|
||||
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLAB7_DEPS_ONLY=ON \
|
||||
&& cmake --build build -j2
|
||||
|
||||
COPY src ./src
|
||||
COPY tools ./tools
|
||||
COPY student-tests/telemetry_test.cpp student-tests/auth_security_test.cpp student-tests/dependency_security_test.cpp ./student-tests/
|
||||
COPY migrations ./migrations
|
||||
COPY third_party ./third_party
|
||||
|
||||
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DLAB7_DEPS_ONLY=OFF \
|
||||
-DMTUSI_MINIO_CPP_VERSION=${MTUSI_MINIO_CPP_VERSION} \
|
||||
&& cmake --build build --target messenger worker job_admin s3_smoke image_smoke thumbnail_smoke variants_smoke telemetry_test auth_security_test dependency_security_test -j2
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Runtime
|
||||
# ---------------------------------------------------------------------------
|
||||
FROM ubuntu:24.04 AS runtime
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl \
|
||||
libprotobuf32t64 \
|
||||
libpq5 \
|
||||
libsodium23 libexif12 libwebp7 \
|
||||
libssl3t64 \
|
||||
libcurl4t64 \
|
||||
zlib1g \
|
||||
libpugixml1v5 \
|
||||
libcurlpp0t64 \
|
||||
libinih1 \
|
||||
libinireader0 \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& groupadd --gid 10001 app \
|
||||
&& useradd --uid 10001 --gid app --shell /usr/sbin/nologin --no-create-home app
|
||||
|
||||
COPY --from=pqxx /opt/libpqxx /opt/libpqxx
|
||||
ENV LD_LIBRARY_PATH=/opt/libpqxx/lib:/opt/libpqxx/lib/x86_64-linux-gnu
|
||||
|
||||
COPY --from=builder /usr/local/lib/libhiredis* /usr/local/lib/
|
||||
WORKDIR /app
|
||||
COPY --from=builder /src/build/_deps/opentelemetry_cpp-build/libopentelemetry_proto.so /usr/local/lib/libopentelemetry_proto.so
|
||||
COPY --from=builder /src/build/messenger /app/messenger
|
||||
COPY --from=builder /src/build/worker /app/worker
|
||||
COPY --from=builder /src/build/auth_security_test /app/auth_security_test
|
||||
COPY --from=builder /src/build/dependency_security_test /app/dependency_security_test
|
||||
COPY --from=builder /src/build/telemetry_test /app/telemetry_test
|
||||
COPY --from=builder /src/build/job_admin /app/job_admin
|
||||
COPY --from=builder /src/build/s3_smoke /app/s3_smoke
|
||||
COPY --from=builder /src/build/image_smoke /app/image_smoke
|
||||
COPY --from=builder /src/build/thumbnail_smoke /app/thumbnail_smoke
|
||||
COPY --from=builder /src/build/variants_smoke /app/variants_smoke
|
||||
COPY --from=builder /src/migrations /app/migrations
|
||||
COPY tools/fixtures /app/fixtures
|
||||
|
||||
|
||||
RUN chown -R app:app /app && ldconfig
|
||||
USER app
|
||||
ENV APP_HOST=127.0.0.1
|
||||
ENV APP_PORT=8080
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=20s --retries=3 \
|
||||
CMD curl -fsS http://127.0.0.1:8080/health/live || exit 1
|
||||
|
||||
ENTRYPOINT []
|
||||
CMD ["/app/messenger"]
|
||||
@@ -2,10 +2,26 @@
|
||||
|
||||
Защитить работающий мессенджер на границах доверия и показать защиту отрицательными проверками: чужой доступ, неверный сертификат, недостаточные права и отзыв credentials.
|
||||
|
||||
Это **skeleton**, а не готовый сервер. Здесь есть задание, контракт и публичные проверки. Реализацию приложения, Dockerfile и требуемую инфраструктуру пишет студент. Язык и framework свободные; UI не обязателен.
|
||||
В этом решении перенесена C++ реализация lab6 и добавлены TLS/mTLS, OpenBao, Argon2id и PKI lifecycle. Ниже сохранены условия задания; инструкция запуска и фактические результаты находятся в [REPORT.md](REPORT.md).
|
||||
|
||||
[Карта курса](COURSE.md) · [Процесс fork/PR](CONTRIBUTING.md) · [OpenAPI](contracts/openapi.json) · [Семантика API](contracts/README.md) · [Проверки](tests/README.md) · [Отчёт](REPORT.md) · [Примеры JSON](contracts/examples.json) · [Памятка преподавателю](MAINTAINERS.md)
|
||||
|
||||
## Запуск реализации
|
||||
|
||||
```sh
|
||||
scripts/bootstrap-pki.sh
|
||||
scripts/bootstrap-openbao.sh --prepare # только локальные secret files и nonsecret .env
|
||||
scripts/dc.sh build api minio mc
|
||||
scripts/bootstrap-openbao.sh # init/unseal, миграции, AppRole/DB/S3/Redis policy
|
||||
scripts/dc.sh up -d --no-build
|
||||
make test CA_FILE="$PWD/certs/ca.crt"
|
||||
make test-security CA_FILE="$PWD/certs/ca.crt"
|
||||
```
|
||||
|
||||
Требуются Docker Compose v2+, OpenSSL, Python 3 (stdlib), C++ toolchain собирается в Docker. Открыт HTTPS ingress `https://localhost:8443`; Nginx слушает 443, для host 443 задайте `HTTPS_PORT=443` и `S3_PUBLIC_ENDPOINT=https://localhost` в `.env`. DB/Redis/MinIO не публикуются. OpenBao/Grafana доступны только на localhost по HTTPS. Все private files создаются вне Git; API/Worker получают только свои AppRole и leaf identity.
|
||||
|
||||
Основной Compose проверен с нативным Docker Engine. Проверка поддержки non-root и `no-new-privileges` — `scripts/check-docker-hardening.sh`. Тесты на запущенном стенде — `scripts/test-resilience.sh` и `scripts/test-ca-rollover.sh`. Оба теста перезапускают сервисы, второй также заменяет рабочий Root CA.
|
||||
|
||||
## Откуда начинаем
|
||||
|
||||
Перенесите минимум lab6. Бизнес-API сохраняется, внешний endpoint теперь HTTPS. Новые секреты и ключи создаются для стенда, не поставляются в skeleton.
|
||||
|
||||
@@ -1,37 +1,149 @@
|
||||
# Отчёт — лабораторная 7
|
||||
|
||||
- Автор, группа: TODO
|
||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
||||
- Commit/PR: TODO после публикации
|
||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
||||
- Автор, группа: Никитин Андрей Александрович, БВТ2301.
|
||||
- Оценка: **5**. Выбран трек 2 — жизненный цикл PKI и сервисных секретов.
|
||||
- Commit/PR: ветка `solution/bvt2301-nikitin`.
|
||||
- Использованные источники, библиотеки и помощь ИИ: C++17, libpqxx, libcurl, OpenSSL, libsodium, hiredis, MinIO C++ SDK и OpenTelemetry C++. Основа работы — README и контракты курса. Для реализации использованы [OpenBao AppRole](https://openbao.org/docs/auth/approle/), [PostgreSQL secrets engine](https://openbao.org/docs/secrets/databases/postgresql/), [hiredis SSL](https://github.com/redis/hiredis/blob/v1.2.0/ssl.c) и [MinIO C++ SDK](https://github.com/minio/minio-cpp/blob/v0.3.0/include/miniocpp/baseclient.h). Codex использовался при переносе lab6, настройке TLS и OpenBao, написании скриптов, выполнении тестов и подготовке отчёта.
|
||||
|
||||
## Запуск из чистого clone
|
||||
|
||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
||||
Требуются Linux, Docker Engine с Compose v2, Bash, OpenSSL, flock и Python 3. Сборка C++ выполняется внутри Docker. Команды запускаются из корня репозитория.
|
||||
|
||||
```sh
|
||||
make check
|
||||
scripts/bootstrap-pki.sh
|
||||
scripts/bootstrap-openbao.sh --prepare
|
||||
scripts/dc.sh build api minio mc
|
||||
scripts/bootstrap-openbao.sh
|
||||
scripts/dc.sh up -d --no-build --wait
|
||||
curl -fsS --cacert certs/ca.crt https://localhost:8443/health/ready
|
||||
make test CA_FILE="$PWD/certs/ca.crt"
|
||||
make test-security CA_FILE="$PWD/certs/ca.crt"
|
||||
```
|
||||
|
||||
Первый bootstrap создаёт локальный CA и сертификаты сервисов. Второй готовит каталоги данных, открывает OpenBao, применяет миграции и выдаёт отдельные учётные данные API и Worker. Основной Compose работает на нативном Docker Engine с включённым `no-new-privileges`. Для проверки хоста служит `scripts/check-docker-hardening.sh`.
|
||||
|
||||
Публичный вход — `https://localhost:8443`. Административные интерфейсы OpenBao и Grafana привязаны к loopback на портах 8200 и 3000. Команда `scripts/dc.sh down` останавливает стенд с сохранением данных. Для повторного запуска выполнить `scripts/bootstrap-openbao.sh`, затем `scripts/dc.sh up -d --no-build --wait`.
|
||||
|
||||
Для сборки нужны доступ к реестрам образов и репозиториям зависимостей, для проверок — Make и curl, для планового продления — cron. На стенде использован Docker Engine 29.1.3. Базовый runtime приложения — Ubuntu 24.04. Версии из Compose и Dockerfile:
|
||||
|
||||
| Назначение | Образы |
|
||||
| --- | --- |
|
||||
| Данные | PostgreSQL 16.15-alpine, Valkey 8.1.10-alpine, MinIO RELEASE.2025-04-22T22-12-26Z, mc RELEASE.2025-04-16T18-13-26Z |
|
||||
| Вход и секреты | Nginx 1.28.0-alpine, Envoy v1.33.2, OpenBao 2.2.2 |
|
||||
| Телеметрия | Collector Contrib 0.119.0, Prometheus v3.2.1, Loki 3.4.2, Tempo 2.7.2, Grafana 11.6.0 |
|
||||
|
||||
Оператор выполняет `--prepare` из-под своего пользователя. Скрипт создаёт локальный `.env` и файлы секретов с соответствующим владельцем. Миграции применяет `scripts/bootstrap-openbao.sh`. Для планового обновления сертификатов один раз выполнить `scripts/install-pki-cron.sh`.
|
||||
|
||||
**Безопасная остановка** — `scripts/dc.sh down`. PostgreSQL, MinIO и OpenBao сохраняют состояние в bind-каталогах.
|
||||
|
||||
**Намеренный полный сброс учебных данных** удаляет также CA, закрытые ключи и локальные учётные данные. Для вывода стенда из эксплуатации сначала убрать строку с маркером `# lab7-pki-renew` из crontab оператора. Команды полного сброса выполняются из корня этого клона:
|
||||
|
||||
```sh
|
||||
scripts/dc.sh down
|
||||
rm -rf -- secrets certs .env
|
||||
```
|
||||
|
||||
## Архитектура и решения
|
||||
|
||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab6, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
||||
| Компонент | Решение |
|
||||
| --- | --- |
|
||||
| Данные и обработка вложений | Из lab6 перенесены C++ API и Worker, миграции, обработка изображений и телеметрия. PostgreSQL хранит сообщения, метаданные и задания. Задание и запись outbox создаются в одной транзакции. Redis Streams доставляет задание Worker, MinIO хранит оригинал и варианты файла. |
|
||||
| TLS и права сервисов | Nginx принимает HTTPS и подключается к каждой API-реплике по mTLS. Envoy проверяет CA и разрешённый SAN клиента. PostgreSQL использует `verify-full`, Redis — mTLS и раздельные ACL, MinIO — HTTPS и SigV4. Для Collector и серверов телеметрии заданы отдельные сертификаты. |
|
||||
| Пароли и сессии | Argon2id использует 64 МиБ памяти, два прохода и один поток. Проверены хеширование, проверка пароля и rehash. Redis хранит SHA-256 сессионного токена с TTL. Общий для реплик счётчик допускает пять попыток входа за 60 с. Шестая получает HTTP 429 и `Retry-After: 60`. |
|
||||
| Сервисные секреты | API и Worker входят в OpenBao через разные AppRole. Каждый получает свою динамическую роль PostgreSQL и читает свой путь KV для Redis и S3. Клиенты продлевают токен и DB lease каждые 30 с. При sealed OpenBao новый Worker завершает запуск с ошибкой. |
|
||||
| Контейнеры | Все 20 сервисов работают с non-root UID, read-only root filesystem, сброшенными capabilities и лимитами ресурсов. Проверка PID 1 каждого контейнера показала `NoNewPrivs=1` и `CapEff=0`. |
|
||||
|
||||
Границы соединений, разрешённые identities и отрицательные сценарии приведены в [матрице доверия](contracts/trust-matrix.md) и [модели угроз](security/threat-model.md). Сканирование пакетов ОС образа API дало 0 Critical, 0 High, 24 Medium и 5 Low. [Протокол сканирования](evidence/image-scan-summary.json) и [разбор результатов](security/scan-triage.md).
|
||||
|
||||
|
||||
**Путь запроса и задания.** Клиент → Nginx → Envoy одной из двух реплик → API. PostgreSQL служит источником истины для сообщений, метаданных и состояния заданий. После фиксации транзакции издатель outbox передаёт задание в Redis Streams. Сбой между публикацией и отметкой outbox допускает повторную доставку. Worker сверяет состояние и версию задания, обрабатывает вложение в MinIO и фиксирует результат в PostgreSQL.
|
||||
|
||||
| Переменная из `.env.example` | Значение по умолчанию | Применение |
|
||||
| --- | --- | --- |
|
||||
| `HTTPS_PORT` | 8443 | Порт HTTPS на хосте, Nginx слушает 443 внутри контейнера |
|
||||
| `BAO_PORT` | 8200 | Локальный HTTPS-порт OpenBao для bootstrap |
|
||||
| `GRAFANA_PORT` | 3000 | Локальный HTTPS-порт Grafana |
|
||||
| `LOCAL_UID`, `LOCAL_GID` | 1000, 1000 в примере | При первичной подготовке берутся UID/GID оператора. Они задают пользователя сервисов и доступ к локальным ключам. |
|
||||
|
||||
При изменении публичного адреса S3 параметр `S3_PUBLIC_ENDPOINT` задаёт соответствующий HTTPS origin для подписанных URL.
|
||||
|
||||
### Трек 2. Автоматизация, ротация и смена корневого CA
|
||||
|
||||
Реализованы автоматическая выдача и продление короткоживущих сертификатов, ротация рабочих секретов и смена корневого CA под нагрузкой. Эксперимент проверяет три инварианта: клиент сохраняет сессию, подтверждённое сообщение сохраняет содержимое, скачанное вложение сохраняет SHA-256.
|
||||
|
||||
**Выдача и продление.** Leaf-сертификаты действуют семь дней. Установленная через `scripts/install-pki-cron.sh` задача вызывает `scripts/renew-pki.sh` каждые 12 часов. При остатке срока менее 48 часов скрипт перевыпускает сертификат, обновляет CRL и перезагружает TLS-контексты. Закрытый ключ CA и материал unseal хранятся у оператора в `secrets/operator/`. Сервис получает собственный ключ и публичный bundle доверия. OpenBao ведёт HMAC-аудит операций.
|
||||
|
||||
**Ротация рабочего секрета.** После смены Worker SecretID и учётных данных Redis/S3 старые значения получили отказ. Worker со свежими значениями прошёл проверку доступа к зависимостям. [Протокол безопасности](evidence/security-checks.json).
|
||||
|
||||
**Смена корня.** Команда `scripts/test-ca-rollover.sh` выполняет три фазы на рабочем стенде. Для внешних клиентов публичный `certs/ca.crt` распространяется на этапе `prepare`, до смены серверных сертификатов.
|
||||
|
||||
| Фаза | Доверенных корней | Что проверил тест |
|
||||
| --- | ---: | --- |
|
||||
| `prepare` | 2 | Создан новый Root CA. Старый клиент и тестовые клиенты с сертификатами нового CA проходят TLS-проверку. |
|
||||
| `reissue` | 2 | Сертификаты 15 сервисных и операторских identities перевыпущены. Серверные цепочки проходят проверку по новому корню. Старый клиент ещё принят. |
|
||||
| `retire` | 1 | Старый CA отозван и удалён из trust bundle. Обе API-реплики отклоняют старый сертификат клиента. HTTPS readiness с новым CA возвращает 200. |
|
||||
|
||||
Все три инварианта эксперимента проверены после каждой фазы: исходная сессия действует, сообщение сохранило содержимое, SHA-256 скачанного вложения совпадает с исходным. [Проверки данных](evidence/ca-rollover-load.json).
|
||||
|
||||
## Доказательства критериев
|
||||
|
||||
Публичные тесты и контракт сохранены. Первичный security QA выполнен в диагностическом Compose. Проверки hardening, persistence, failover и смены корня выполнены на основном Compose с `no-new-privileges`. Публичный smoke повторён после ротации. Для команд ниже `CA_FILE` указывает на `$PWD/certs/ca.crt`.
|
||||
|
||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
||||
| --- | --- | --- | --- |
|
||||
| Публичный smoke | make test | TODO | TODO |
|
||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
||||
| 3 · Публичный smoke | `make test CA_FILE="$PWD/certs/ca.crt"` | PASS. Регистрация, вход, ACL чата, сообщения, обработка вложений и logout по HTTPS. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Проверка сервера | `scripts/test-tls-untrusted.sh` | PASS. Доверенный CA даёт HTTP 200, недоверенный отклонён с кодом curl 60. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Обязательный mTLS | `scripts/test-mtls-no-cert.sh` | PASS. Соединение без клиентского сертификата отклонено на обеих репликах. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Разрешённый SAN | `scripts/test-mtls-wrong-identity.sh` | PASS. Обе реплики отклонили Worker с действительной цепочкой и чужой ролью. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Проверка издателя | `scripts/test-mtls-foreign-ca.sh` | PASS. Обе реплики отклонили сертификат с нужным SAN от чужого CA. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Права сервисов и TLS зависимостей | `scripts/dc.sh run --rm -T --no-deps --entrypoint /app/dependency_security_test worker` | PASS. Worker получил отказ при чтении users, доступе к Redis sessions и чужому префиксу S3. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · OpenBao, AppRole и политики | `python3 scripts/test-openbao-policy.py` | PASS. Свой путь KV/DB доступен, чужой путь и изменение policy дают 403. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3/4 · Argon2id и rehash | `scripts/dc.sh run --rm -T --no-deps --entrypoint /app/auth_security_test api` | PASS. Хеш содержит m=65536, t=2, p=1. Проверены пароль, отказ и обновление старого хеша. Два HTTP-потока ограничивают параллельное хеширование на реплике. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Хранение сессий и отзыв | `scripts/dc.sh run --rm -T --no-deps --entrypoint /app/dependency_security_test api` | PASS. Сессия найдена по SHA-256, TTL и logout прекращают доступ. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3/4 · Общий лимит входа | `scripts/test-rate-limit.sh` | PASS. На двух репликах получены пять ответов 401 и затем 429 с Retry-After: 60. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 3 · Размер запроса | Проверка директивы client_max_body_size | Конфигурация ingress ограничивает тело запроса до 11 MiB. | [nginx.conf](lb/nginx.conf) |
|
||||
| 3/4 · Hardening и доступные порты | `python3 scripts/test-docker-hardening.py` | PASS. 20 процессов PID 1 с NoNewPrivs=1, CapEff=0 и non-root UID. Опубликованы HTTPS ingress и локальные административные порты. | [hardening-native.json](evidence/hardening-native.json) |
|
||||
| 4 · mTLS брокера и ACL | `scripts/dc.sh run --rm -T --no-deps --entrypoint /app/dependency_security_test worker` | PASS. Redis принимает сервисный сертификат. Учётная запись Worker ограничена операциями очереди и DLQ. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 4 · Identity Collector | `scripts/test-collector-mtls.sh` | PASS. Сертификат API принят, клиентский сертификат балансировщика отклонён. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 4 · Доставка телеметрии | `python3 scripts/test-telemetry-tls.py` | PASS. TLS scrape и запросы Grafana к метрикам, логам и трассировкам прошли. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 4 · Ротация рабочего секрета | `python3 scripts/test-credential-rotation.py` | PASS. Старые Worker SecretID и credentials Redis/S3 отклонены, новые работают. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 4 · Sealed OpenBao | `python3 scripts/test-bao-sealed.py` | PASS. Свежий Worker завершился с кодом 1. Оператор выполнил unseal. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 4 · Модель угроз | Сопоставление угроз, контролей и отрицательных сценариев | Для границ LB, API, Worker и хранилищ указаны права и команды воспроизведения. | [threat-model.md](security/threat-model.md) |
|
||||
| 4 · Скан образа | `scripts/scan-image.sh lab7-api:local` | Trivy по пакетам ОС: 0 Critical, 0 High, 24 Medium, 5 Low. | [image-scan-summary.json](evidence/image-scan-summary.json) |
|
||||
| 3 · Persistence | `scripts/test-resilience.sh --mode persistence` | PASS. ID 20 контейнеров сменились, точки монтирования сохранились, прежняя сессия прочитала сообщение и исходные байты вложения. | [resilience-results.json](evidence/resilience-results.json) |
|
||||
| 3 · Failover | `scripts/test-resilience.sh --mode failover` | PASS. Остановлена api2. Выжившая реплика продолжила запись, подтверждённые сообщения сохранены без дублей. | [resilience-results.json](evidence/resilience-results.json) |
|
||||
| 5 · Автоматизация renewal | `scripts/install-pki-cron.sh`, `scripts/renew-pki.sh` | Установлен график каждые 12 ч. Ручной цикл выполнил обновление и перезагрузку TLS. | [renew-pki.sh](scripts/renew-pki.sh) |
|
||||
| 4/5 · Отзыв и истечение leaf | `scripts/test-pki-lifecycle.sh` | PASS. Новый client-api принят, новые соединения с отозванным и просроченным сертификатами отклонены. | [security-checks.json](evidence/security-checks.json) |
|
||||
| 5 · Смена корня под нагрузкой | `scripts/test-ca-rollover.sh` | PASS. Число доверенных корней прошло последовательность 1 → 2 → 2 → 1. Старый клиент отклонён обеими API-репликами. | [ca-rollover.json](evidence/ca-rollover.json) |
|
||||
|
||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
||||
Фактический вывод `make check` на чистой копии исходников и `make test` на запущенном стенде:
|
||||
|
||||
```text
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
|
||||
```
|
||||
|
||||
## Эксперименты и отказы
|
||||
|
||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
||||
**Гипотеза.** Переходный bundle позволяет перевыпустить все сертификаты и вывести старый CA из доверия, сохранив действующую сессию, сообщение и байты вложения. Перезапуск сервисов прерывает часть запросов readiness.
|
||||
|
||||
**Стенд и методика.** 12 логических CPU, 14,85 GiB RAM. Каждому сервису выделено 0,5 CPU. Лимиты памяти: 384 MiB на каждую API-реплику, 512 MiB на Worker, PostgreSQL и MinIO, 256 MiB на остальные сервисы. До замера тест создаёт трёх пользователей, чат, сообщение и вложение PNG объёмом 111 817 байт, затем дожидается его обработки. Один клиент последовательно запрашивает readiness по HTTPS с паузой 250 мс после ответа и тайм-аутом 2 с. Частота зависит от задержки ответа. Два сохранённых прогона с одинаковым профилем приведены отдельно.
|
||||
|
||||
| Смена корня | Длительность, с | Запросы | Успехи | Ошибки | Успешные запросы/с |
|
||||
| --- | ---: | ---: | ---: | ---: | ---: |
|
||||
| [Первый сохранённый цикл](evidence/ca-rollover-load-cycle-1.json) | 126,906 | 487 | 242 | 245 | 1,907 |
|
||||
| [Итоговый прогон](evidence/ca-rollover-load.json) | 124,254 | 477 | 247 | 230 | 1,988 |
|
||||
|
||||
В итоговом прогоне p50 / p95 / p99 успешных запросов составили **12,556 / 18,998 / 24,650 мс**. По всем попыткам, включая ошибки, — **4,875 / 17,601 / 23,361 мс**. За 17 выборок на процесс максимумы CPU и памяти составили **1,52 % и 7,28 MiB** для API, **1,61 % и 7,48 MiB** для API2, **0,33 % и 5,58 MiB** для Worker. Протокол содержит время, статус и задержку каждого запроса, а также выборки ресурсов без значений токенов. [Исходные измерения](evidence/ca-rollover-load.json).
|
||||
|
||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
||||
| --- | --- | --- | --- |
|
||||
| TODO | TODO | TODO | TODO |
|
||||
| Полное пересоздание стека | Новые процессы открывают прежние данные | У db, minio, cache, openbao и остальных 16 сервисов сменились ID. Пути постоянных данных совпали до и после. | Сценарий занял 21,911 с. Сессия, сообщение и байты вложения сохранились. [Протокол hook](evidence/resilience-persistence-hook.json) |
|
||||
| Остановка api2 | Балансировщик направляет записи на api | До остановки наблюдались две реплики. Прошли 126 записей, ошибок записи — 0. | Первая запись после остановки — через 0,697 с от начала hook. Потерь и дублей подтверждённых сообщений — 0. [Протокол hook](evidence/resilience-failover-hook.json) |
|
||||
| Отзыв leaf при 80 запросах readiness | Новый сертификат принят, старый отклонён | В сохранённом прогоне 78 успешных запросов и 2 ошибки за 22,048 с. | Первый отказ на 1,542 с, следующий успех на 2,048 с. Интервал между наблюдениями — 0,506 с. [Замер](evidence/pki-load.json) |
|
||||
| Смена Root CA с перезапусками | Данные доступны после каждой фазы, старый клиент теряет доступ после retire | Перевыпущены 15 identities. Обе реплики отклонили старый сертификат. Во время перезапусков 230 из 477 запросов readiness завершились ошибкой. | После каждой фазы прежняя сессия читала исходное сообщение и файл с тем же SHA-256. В конце readiness вернул 200. [Проверки данных](evidence/ca-rollover-load.json) |
|
||||
|
||||
## Ограничения и следующие шаги
|
||||
|
||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
||||
Пересоздание стека и отказ одной API-реплики сохранили тестовые данные. При смене CA перезапуски временно прерывали HTTPS-запросы. Эксперимент измеряет доступность одного последовательного клиента. В Redis права задаёт ACL пользователя. Привязка SAN сертификата к имени ACL-пользователя в этой реализации отсутствует. Учебное упрощение — оператор хранит CA и материал unseal на одном хосте. Следующий эксперимент — поочерёдная перезагрузка реплик с тем же профилем нагрузки для проверки гипотезы о сокращении числа ошибок.
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Provide the imported target names expected by minio-cpp's CMakeLists
|
||||
# (unofficial-curlpp / unofficial-inih) using system packages from apt.
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(CURL REQUIRED)
|
||||
|
||||
# nlohmann_json (header-only; Ubuntu ships /usr/include/nlohmann/json.hpp)
|
||||
if(NOT TARGET nlohmann_json::nlohmann_json)
|
||||
find_package(nlohmann_json QUIET CONFIG)
|
||||
endif()
|
||||
if(NOT TARGET nlohmann_json::nlohmann_json)
|
||||
add_library(nlohmann_json INTERFACE)
|
||||
add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json)
|
||||
find_path(NLOHMANN_JSON_INCLUDE_DIR nlohmann/json.hpp)
|
||||
if(NOT NLOHMANN_JSON_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "nlohmann/json.hpp not found (install nlohmann-json3-dev)")
|
||||
endif()
|
||||
target_include_directories(nlohmann_json INTERFACE "${NLOHMANN_JSON_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
# pugixml
|
||||
if(NOT TARGET pugixml)
|
||||
find_package(pugixml QUIET CONFIG)
|
||||
endif()
|
||||
if(NOT TARGET pugixml AND NOT TARGET pugixml::pugixml)
|
||||
pkg_check_modules(PUGIXML REQUIRED IMPORTED_TARGET pugixml)
|
||||
add_library(pugixml INTERFACE)
|
||||
target_link_libraries(pugixml INTERFACE PkgConfig::PUGIXML)
|
||||
endif()
|
||||
if(TARGET pugixml::pugixml AND NOT TARGET pugixml)
|
||||
add_library(pugixml ALIAS pugixml::pugixml)
|
||||
endif()
|
||||
|
||||
# curlpp → unofficial::curlpp::curlpp
|
||||
if(NOT TARGET unofficial::curlpp::curlpp)
|
||||
find_library(CURLPP_LIBRARY NAMES curlpp REQUIRED)
|
||||
find_path(CURLPP_INCLUDE_DIR curlpp/cURLpp.hpp REQUIRED)
|
||||
add_library(unofficial_curlpp INTERFACE)
|
||||
target_include_directories(unofficial_curlpp INTERFACE "${CURLPP_INCLUDE_DIR}")
|
||||
target_link_libraries(unofficial_curlpp INTERFACE "${CURLPP_LIBRARY}" CURL::libcurl)
|
||||
add_library(unofficial::curlpp::curlpp ALIAS unofficial_curlpp)
|
||||
endif()
|
||||
|
||||
# inih INIReader → unofficial::inih::inireader
|
||||
if(NOT TARGET unofficial::inih::inireader)
|
||||
find_library(INIREADER_LIBRARY NAMES INIReader REQUIRED)
|
||||
find_library(INIH_LIBRARY NAMES inih REQUIRED)
|
||||
find_path(INIREADER_INCLUDE_DIR INIReader.h REQUIRED)
|
||||
add_library(unofficial_inih_inireader INTERFACE)
|
||||
target_include_directories(unofficial_inih_inireader INTERFACE "${INIREADER_INCLUDE_DIR}")
|
||||
target_link_libraries(unofficial_inih_inireader INTERFACE
|
||||
"${INIREADER_LIBRARY}" "${INIH_LIBRARY}")
|
||||
add_library(unofficial::inih::inireader ALIAS unofficial_inih_inireader)
|
||||
endif()
|
||||
+646
@@ -0,0 +1,646 @@
|
||||
name: lab7
|
||||
services:
|
||||
api-tls:
|
||||
read_only: true
|
||||
security_opt: &id001
|
||||
- no-new-privileges:true
|
||||
cap_drop: &id002
|
||||
- ALL
|
||||
tmpfs: &id003
|
||||
- /tmp:rw,noexec,nosuid,size=128m
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks: &id004
|
||||
- private
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/api:/identity:ro
|
||||
- ./infra/envoy/api.yaml:/etc/envoy/config.yaml:ro
|
||||
api2-tls:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks: *id004
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/api:/identity:ro
|
||||
- ./infra/envoy/api.yaml:/etc/envoy/config.yaml:ro
|
||||
api:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 384m
|
||||
build: .
|
||||
image: lab7-api:local
|
||||
network_mode: service:api-tls
|
||||
environment: &id005
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_SERVICE: api
|
||||
APP_HOST: 127.0.0.1
|
||||
APP_PORT: '8080'
|
||||
SESSION_STORE: redis
|
||||
DB_POOL_SIZE: '4'
|
||||
HTTP_WORKERS: '2'
|
||||
S3_BUCKET: attachments
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /pki/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /identity/api.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /identity/api.key
|
||||
SSL_CERT_FILE: /pki/ca.crt
|
||||
S3_PRESIGN_ENDPOINT: ${S3_PUBLIC_ENDPOINT:-https://localhost:8443}
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/api:/identity:ro
|
||||
- ./secrets/approle/api:/run/approle:ro
|
||||
depends_on:
|
||||
api-tls:
|
||||
condition: service_started
|
||||
db:
|
||||
condition: service_healthy
|
||||
cache:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- curl
|
||||
- -fsS
|
||||
- http://127.0.0.1:8080/health/ready
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 30s
|
||||
api2:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 384m
|
||||
build: .
|
||||
image: lab7-api:local
|
||||
network_mode: service:api2-tls
|
||||
environment: *id005
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/api:/identity:ro
|
||||
- ./secrets/approle/api:/run/approle:ro
|
||||
depends_on:
|
||||
api2-tls:
|
||||
condition: service_started
|
||||
db:
|
||||
condition: service_healthy
|
||||
cache:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- curl
|
||||
- -fsS
|
||||
- http://127.0.0.1:8080/health/ready
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 30s
|
||||
worker:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 512m
|
||||
networks: *id004
|
||||
build: .
|
||||
image: lab7-api:local
|
||||
command:
|
||||
- /app/worker
|
||||
environment:
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_SERVICE: worker
|
||||
APP_HOST: 127.0.0.1
|
||||
APP_PORT: '8080'
|
||||
SESSION_STORE: redis
|
||||
DB_POOL_SIZE: '4'
|
||||
HTTP_WORKERS: '2'
|
||||
S3_BUCKET: attachments
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /pki/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /identity/worker.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /identity/worker.key
|
||||
SSL_CERT_FILE: /pki/ca.crt
|
||||
JOB_TIMEOUT_SECONDS: '60'
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/worker:/identity:ro
|
||||
- ./secrets/approle/worker:/run/approle:ro
|
||||
pids_limit: 64
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- test "$(cat /proc/1/comm)" = worker
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
start_period: 20s
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
cache:
|
||||
condition: service_healthy
|
||||
lb:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks:
|
||||
- private
|
||||
- edge
|
||||
image: nginx:1.28.0-alpine
|
||||
entrypoint:
|
||||
- nginx
|
||||
command:
|
||||
- -g
|
||||
- daemon off;
|
||||
ports:
|
||||
- ${HTTPS_PORT:-8443}:443
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/lb:/identity:ro
|
||||
- ./certs/client-api:/lb-client:ro
|
||||
- ./lb/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
api2:
|
||||
condition: service_healthy
|
||||
db:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs:
|
||||
- /tmp:rw,noexec,nosuid,size=128m
|
||||
- /var/run/postgresql:rw,nosuid,size=16m
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 512m
|
||||
networks: *id004
|
||||
image: postgres:16.15-alpine
|
||||
command:
|
||||
- postgres
|
||||
- -c
|
||||
- ssl=on
|
||||
- -c
|
||||
- ssl_cert_file=/identity/db.crt
|
||||
- -c
|
||||
- ssl_key_file=/identity/db.key
|
||||
- -c
|
||||
- ssl_ca_file=/pki/ca.crt
|
||||
- -c
|
||||
- ssl_crl_file=/pki/ca.crl
|
||||
- -c
|
||||
- hba_file=/etc/postgresql/pg_hba.conf
|
||||
- -c
|
||||
- max_connections=100
|
||||
- -c
|
||||
- log_min_error_statement=panic
|
||||
- -c
|
||||
- log_parameter_max_length_on_error=0
|
||||
- -c
|
||||
- log_error_verbosity=terse
|
||||
environment:
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD_FILE: /run/operator/db-password
|
||||
PGDATA: /var/lib/postgresql/data/pgdata
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/db:/identity:ro
|
||||
- ./secrets/state/postgres:/var/lib/postgresql/data
|
||||
- ./secrets/operator/db-password:/run/operator/db-password:ro
|
||||
- ./infra/postgres/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- pg_isready
|
||||
- -U
|
||||
- postgres
|
||||
- -d
|
||||
- messenger
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
cache:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks:
|
||||
private:
|
||||
aliases:
|
||||
- redis
|
||||
image: valkey/valkey:8.1.10-alpine
|
||||
command:
|
||||
- valkey-server
|
||||
- /etc/redis/redis.conf
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/redis:/identity:ro
|
||||
- ./infra/redis/redis.conf:/etc/redis/redis.conf:ro
|
||||
- ./secrets/redis:/run/redis:ro
|
||||
- ./secrets/state/redis:/data
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- valkey-cli --tls --cacert /pki/ca.crt --cert /identity/redis.crt --key /identity/redis.key
|
||||
-h redis PING 2>&1 | grep -q NOAUTH
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
minio:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 512m
|
||||
networks: *id004
|
||||
build:
|
||||
context: ./infra/minio
|
||||
image: lab7-minio:local
|
||||
command:
|
||||
- server
|
||||
- /data
|
||||
- --certs-dir
|
||||
- /identity
|
||||
- --console-address
|
||||
- 127.0.0.1:9001
|
||||
environment:
|
||||
MINIO_ROOT_USER_FILE: /run/operator/minio-user
|
||||
MINIO_ROOT_PASSWORD_FILE: /run/operator/minio-password
|
||||
MINIO_BROWSER: 'off'
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/minio:/identity:ro
|
||||
- ./secrets/operator/minio-user:/run/operator/minio-user:ro
|
||||
- ./secrets/operator/minio-password:/run/operator/minio-password:ro
|
||||
- ./secrets/state/minio:/data
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- curl
|
||||
- --fail
|
||||
- --cacert
|
||||
- /pki/ca.crt
|
||||
- https://minio:9000/minio/health/live
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
start_period: 10s
|
||||
openbao:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks:
|
||||
- private
|
||||
- edge
|
||||
image: openbao/openbao:2.2.2
|
||||
entrypoint:
|
||||
- bao
|
||||
command:
|
||||
- server
|
||||
- -config=/bao/config/config.hcl
|
||||
environment:
|
||||
BAO_ADDR: https://localhost:8200
|
||||
BAO_CACERT: /pki/ca.crt
|
||||
ports:
|
||||
- 127.0.0.1:${BAO_PORT:-8200}:8200
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/openbao:/identity:ro
|
||||
- ./infra/openbao/config.hcl:/bao/config/config.hcl:ro
|
||||
- ./secrets/state/openbao:/bao/data
|
||||
mc:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: 'no'
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks: *id004
|
||||
build:
|
||||
context: ./infra/mc
|
||||
image: lab7-mc:local
|
||||
profiles:
|
||||
- operator
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /operator-entrypoint.sh
|
||||
command:
|
||||
- -c
|
||||
- sleep 3600
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./infra/mc/operator-entrypoint.sh:/operator-entrypoint.sh:ro
|
||||
- ./secrets/operator/minio-user:/operator/minio-user:ro
|
||||
- ./secrets/operator/minio-password:/operator/minio-password:ro
|
||||
- ./secrets/operator/s3-api:/operator/s3-api:ro
|
||||
- ./secrets/operator/s3-worker:/operator/s3-worker:ro
|
||||
environment:
|
||||
MC_CONFIG_DIR: /tmp/mc-user
|
||||
otel-collector-tls:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks:
|
||||
private:
|
||||
aliases:
|
||||
- otel-collector
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/otel-collector:/identity:ro
|
||||
- ./infra/envoy/otel-collector.yaml:/etc/envoy/config.yaml:ro
|
||||
otel-collector:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
network_mode: service:otel-collector-tls
|
||||
depends_on:
|
||||
otel-collector-tls:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/otel-collector:/identity:ro
|
||||
- ./infra/otel/collector.yaml:/etc/otelcol/config.yaml:ro
|
||||
image: otel/opentelemetry-collector-contrib:0.119.0
|
||||
command:
|
||||
- --config=/etc/otelcol/config.yaml
|
||||
loki-tls:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks: *id004
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/loki:/identity:ro
|
||||
- ./infra/envoy/loki.yaml:/etc/envoy/config.yaml:ro
|
||||
loki:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
network_mode: service:loki-tls
|
||||
depends_on:
|
||||
loki-tls:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/loki:/identity:ro
|
||||
- ./infra/loki/loki.yaml:/etc/loki/config.yaml:ro
|
||||
- ./secrets/state/loki:/loki
|
||||
image: grafana/loki:3.4.2
|
||||
command:
|
||||
- -config.file=/etc/loki/config.yaml
|
||||
tempo-tls:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks: *id004
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/tempo:/identity:ro
|
||||
- ./infra/envoy/tempo.yaml:/etc/envoy/config.yaml:ro
|
||||
tempo:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
network_mode: service:tempo-tls
|
||||
depends_on:
|
||||
tempo-tls:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/tempo:/identity:ro
|
||||
- ./infra/tempo/tempo.yaml:/etc/tempo/config.yaml:ro
|
||||
- ./secrets/state/tempo:/var/tempo
|
||||
image: grafana/tempo:2.7.2
|
||||
command:
|
||||
- -config.file=/etc/tempo/config.yaml
|
||||
prometheus-tls:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks: *id004
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/prometheus:/identity:ro
|
||||
- ./infra/envoy/prometheus.yaml:/etc/envoy/config.yaml:ro
|
||||
prometheus:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
network_mode: service:prometheus-tls
|
||||
depends_on:
|
||||
prometheus-tls:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/prometheus:/identity:ro
|
||||
- ./infra/prometheus/prometheus.yaml:/etc/prometheus/config.yaml:ro
|
||||
- ./secrets/state/prometheus:/prometheus
|
||||
- ./infra/prometheus/alerts.yaml:/etc/prometheus/alerts.yaml:ro
|
||||
image: prom/prometheus:v3.2.1
|
||||
command:
|
||||
- --config.file=/etc/prometheus/config.yaml
|
||||
- --web.listen-address=127.0.0.1:19090
|
||||
grafana-tls:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
networks:
|
||||
- private
|
||||
- edge
|
||||
image: envoyproxy/envoy:v1.33.2
|
||||
entrypoint:
|
||||
- envoy
|
||||
command:
|
||||
- -c
|
||||
- /etc/envoy/config.yaml
|
||||
- --concurrency
|
||||
- '1'
|
||||
- --log-level
|
||||
- warning
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/grafana:/identity:ro
|
||||
- ./infra/envoy/grafana.yaml:/etc/envoy/config.yaml:ro
|
||||
ports:
|
||||
- 127.0.0.1:${GRAFANA_PORT:-3000}:3000
|
||||
grafana:
|
||||
read_only: true
|
||||
security_opt: *id001
|
||||
cap_drop: *id002
|
||||
tmpfs: *id003
|
||||
user: ${LOCAL_UID:-1000}:${LOCAL_GID:-1000}
|
||||
restart: unless-stopped
|
||||
cpus: '0.5'
|
||||
mem_limit: 256m
|
||||
network_mode: service:grafana-tls
|
||||
depends_on:
|
||||
grafana-tls:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ./certs/trust:/pki:ro
|
||||
- ./certs/grafana:/identity:ro
|
||||
- ./secrets/operator/grafana-password:/run/operator/grafana-password:ro
|
||||
- ./secrets/state/grafana:/var/lib/grafana
|
||||
- ./secrets/grafana-datasources:/etc/grafana/provisioning/datasources:ro
|
||||
- ./infra/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
|
||||
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
||||
image: grafana/grafana:11.6.0
|
||||
environment:
|
||||
GF_SERVER_HTTP_ADDR: 127.0.0.1
|
||||
GF_SERVER_HTTP_PORT: '13000'
|
||||
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/operator/grafana-password
|
||||
GF_USERS_ALLOW_SIGN_UP: 'false'
|
||||
GF_ANALYTICS_REPORTING_ENABLED: 'false'
|
||||
GF_PLUGINS_PREINSTALL_DISABLED: 'true'
|
||||
networks:
|
||||
private:
|
||||
internal: true
|
||||
edge: {}
|
||||
+26
-33
@@ -1,37 +1,30 @@
|
||||
# Матрица доверия — заполнить в решении lab7
|
||||
# Lab7: границы доверия
|
||||
|
||||
Это обязательная матрица покрытия. Для каждой строки укажите реальный порт, endpoint, CA, service identity, проверку SAN/ACL, срок жизни credentials и команду положительного/отрицательного теста. TLS шифрует и подтверждает сервер; mTLS также проверяет клиента. При доверенном CA всё равно нужно ограничивать разрешённую identity. Plaintext hop допустим только внутри закрытого локального transport/proxy boundary, без опубликованного обхода; границу и rationale нужно доказать.
|
||||
CA: `certs/ca.crt`, CRL: `certs/ca.crl`. Leaf TTL 7 дней, проверка обновления каждые 12 часов, renewal при остатке <48 часов. Ключ CA и журнал выдачи находятся в `secrets/operator/ca`, вне образов/Git и вне mounts приложений. Все каталоги с private keys имеют 0700, ключи 0600. UID/GID контейнеров совпадают с UID/GID оператора; каждый получает только свою identity.
|
||||
|
||||
| Связь | Минимум на 3 | Дополнительно на 4 | Доказательство / конфиг |
|
||||
| --- | --- | --- | --- |
|
||||
| Клиент → ingress/LB | TLS, CA + hostname, Bearer | Проверка expiry/revocation сессии и общего login rate limit | TODO |
|
||||
| LB → API (все реплики) | mTLS + allowlist LB identity | Ротация leaf без обхода проверки | TODO |
|
||||
| API/worker → PostgreSQL | TLS verify-full + раздельные ограниченные DB roles | Ротация credentials; mTLS — допустимое усиление | TODO |
|
||||
| API/worker → S3 | TLS + разные scoped credentials/prefix rights | Проверка denied prefix и ротация | TODO |
|
||||
| API/worker → broker | TLS + разные producer/consumer identities и ACL | mTLS + ограничение допустимых SAN/ролей | TODO |
|
||||
| API/worker → Collector | TLS; сеть/аутентификация запрещает произвольный ingest | mTLS с раздельными identities | TODO |
|
||||
| Collector → telemetry backends | TLS + scoped backend credentials или mTLS | Ротация и проверка least privilege | TODO |
|
||||
| Grafana → data sources | TLS с проверкой сервера, ограниченная identity | Отрицательные проверки доступа | TODO |
|
||||
| API/worker/agent → OpenBao | TLS + сервисный auth + scoped policy | Renewal/expiry/revocation | TODO |
|
||||
| Оператор → OpenBao/Grafana/S3 admin | TLS + authentication, доступ локальный/через защищённый канал | Разделение operator/application roles | TODO |
|
||||
| API → Redis/Valkey, если используется | TLS + ACL/пароль с минимальными правами | Ротация; mTLS по возможности | TODO |
|
||||
| Replication/кластерные каналы, если добавлены | TLS/mTLS либо подтверждённый шифрованный transport | Проверка заявленной модели отказа | TODO |
|
||||
| Кто → кому | Порт / транспорт | Identity и проверка | Конфигурация / отрицательный тест |
|
||||
|---|---|---|---|
|
||||
| Клиент → LB | host 8443 (или 443 через HTTPS_PORT) → 443 HTTPS | SAN localhost / IP 127.0.0.1; клиент проверяет CA; Bearer | `lb/nginx.conf`; `scripts/test-tls-untrusted.sh`, публичные smoke/security |
|
||||
| LB → api-tls / api2-tls | 8443 mTLS | Nginx проверяет CA, CRL, SAN **api**; Envoy проверяет CA, CRL, SAN **client-api** | `infra/envoy/api.yaml`; no-cert / wrong-identity tests, PKI lifecycle |
|
||||
| api-tls → C++ API | 127.0.0.1:8080 HTTP | Общая network namespace, приложение слушает только loopback; порт не опубликован | `compose.yaml` network_mode service; извне namespace listener недоступен |
|
||||
| API / Worker → db | 5432 TLS + client cert + SCRAM | libpq verify-full SAN **db**; PostgreSQL проверяет CA/CRL клиентского cert; авторизация отдельным dynamic DB login | `src/bao.cpp`, `infra/postgres/pg_hba.conf`; Worker NO SUPERUSER / NO CREATEROLE, без DDL |
|
||||
| OpenBao → db | 5432 TLS + client cert + SCRAM | verify-full SAN db, cert openbao; operator DB credential доступен только OpenBao | database/config/messenger, bootstrap operator |
|
||||
| API / Worker → MinIO | 9000 HTTPS + SigV4 | SDK SetSslCertFile → libcurl CAINFO; проверка SAN **minio**. MinIO не требует client cert; разные S3 users | `src/s3_client.cpp`; policy prefixes staging/* и attachments/*; никаких опубликованных портов S3 |
|
||||
| API → Redis sessions / limiter / producer | 6379 mTLS + ACL | OpenSSL SSL_set1_host **redis**, CA + client cert api; ACL user api | `src/redis_pool.cpp`; только session:*, ratelimit:login:*, jobs:attachments |
|
||||
| Worker → Redis broker | 6379 mTLS + ACL | SAN redis проверяется клиентом; server проверяет client CA, ACL user worker ограничивает команды/ключи | `infra/redis/redis.conf`, bootstrap ACL: consumer/DLQ; нет session/limiter, CONFIG, ACL, FLUSHALL |
|
||||
| API / Worker → Collector proxy | 4318 mTLS | SDK CA + server SAN **otel-collector** (DNS alias); Envoy allowlist SAN **api**, **worker**, CRL | `infra/envoy/otel-collector.yaml`; broker/collector negative tests |
|
||||
| Collector proxy → Collector | 127.0.0.1:14318 HTTP | Общая namespace; только локальный listener, metrics 127.0.0.1:19464 | `infra/otel/collector.yaml` |
|
||||
| Collector → Tempo / Loki | 4318 / 3100 mTLS | Client verifies SAN tempo / loki; Envoy разрешает SAN **otel-collector** (Loki также grafana) | `infra/otel/collector.yaml`, `infra/envoy/{tempo,loki}.yaml` |
|
||||
| Prometheus → Collector metrics | 9464 mTLS | SAN otel-collector; proxy принимает только SAN **prometheus** | `infra/prometheus/prometheus.yaml` |
|
||||
| Grafana → Prometheus / Loki / Tempo | 9090 / 3100 / 3200 mTLS | CA + SAN prometheus/loki/tempo; proxy допускает **grafana** | runtime provisioning из `secrets/grafana-datasources`, templates в infra/grafana |
|
||||
| TLS proxies → telemetry backends | loopback 19090 / 13100 / 13200 / 14318 | Закрытая общая namespace; plaintext не пересекает контейнерную сеть | backend bind address 127.0.0.1 в infra конфигурациях |
|
||||
| API / Worker → OpenBao | 8200 HTTPS + AppRole | CA, SAN **openbao**; role-specific policy и KV; токен/DB lease 15m, max1h, renewal каждые 30s | `src/bao.cpp`, `infra/openbao/{api,worker}.hcl`; policy negative tests |
|
||||
| Оператор → OpenBao | localhost:8200 HTTPS | SAN localhost; init/unseal/root только у оператора | `scripts/bootstrap-openbao.sh`; bind 127.0.0.1 |
|
||||
| Оператор → Grafana | localhost:3000 HTTPS | SAN localhost; пароль из operator file | grafana-tls namespace; bind 127.0.0.1 |
|
||||
| Оператор → PostgreSQL migrations | Unix socket через docker exec | Локальная operator boundary; peer container UID, Docker access = admin | Bootstrap не публикует SQL listener; app не получает bootstrap password |
|
||||
| Оператор mc → S3 | 9000 HTTPS | CA + SAN minio; root файлы только в profile operator | ephemeral /tmp mc config, profile не запускается вместе со стеком |
|
||||
| Кластерная репликация | N/A | Одиночные DB/Redis/MinIO; две API реплики | HA stateful dependencies в этой работе не заявляется |
|
||||
|
||||
Нет выбранного компонента — отметьте N/A с причиной, а не оставляйте пустую строку. Внутренний публичный health listener, если нужен, минимален и изолирован; через него нельзя обращаться к бизнес-API без mTLS. Отдельно задокументируйте scrape/health/bootstrap каналы: они тоже не должны создавать обход.
|
||||
Redis проверяет client CA, но не связывает SAN с username. Раздельные ACL credentials и раздельные mounts составляют второй фактор авторизации; компрометация одновременно чужого cert и ACL secret выходит за эту границу. PostgreSQL также использует verify-ca для client cert, так как динамическое имя DB login не равно SAN сервиса; права задаёт DB role. Для Envoy endpoint обязательна точная SAN allowlist, а не только доверие CA.
|
||||
|
||||
## Обязательные отрицательные проверки
|
||||
|
||||
1. HTTPS с правильным CA/hostname проходит; с пустым/чужим CA и неправильным hostname — ошибка верификации, не «сервер недоступен».
|
||||
2. LB→API: без client cert, с cert чужого CA, с запрещённой identity от доверенного CA — отказ; с разрешённой LB identity — успех.
|
||||
3. На 4 повторите набор для broker и Collector; ограничение на network policy не заменяет проверку identity.
|
||||
4. Пользователь вне чата не читает metadata/content и не прикрепляет чужой файл; поддельный X-User-Id не меняет Bearer identity.
|
||||
5. OpenBao app policy читает только свой secret/path; запись policy и чтение чужого path запрещены. Worker не получает admin credentials API/БД/S3.
|
||||
6. На 4 отзовите secret/cert и дождитесь контролируемого эффекта с учётом действующих соединений, TLS resumption и cache/TTL. Покажите новое подключение, иначе тест отзыва может ничего не проверить.
|
||||
|
||||
## Bootstrap и эксплуатация
|
||||
|
||||
В репозитории только открытые конфиги, policy templates и scripts. CA private key, leaf keys, root token, unseal shares и SecretID не коммитятся, не запекаются в образ и не печатаются в отчёте. Для локального стенда оператор создаёт их вне Git и передаёт через files/secrets с ограниченными правами. Опишите, кто имеет доступ к CA/unseal, что нужно после рестарта OpenBao и как восстановить работу.
|
||||
|
||||
OpenBao не использует dev-mode. Выберите persistent storage и auth метод (например AppRole с короткоживущим SecretID/response wrapping, cert auth или иная обоснованная identity). Не подменяйте root token постоянной переменной BAO_TOKEN в приложении. Рабочие tokens имеют policy, TTL и renewal/re-auth сценарий. Статические KV secrets на 3 допустимы при реальном чтении через сервисную identity; динамические DB credentials — хорошее расширение, но не обязательное название технологии.
|
||||
|
||||
Разрешённый компромисс учебного стенда: ручной operator init/unseal, если он безопасно документирован и не нужен при каждом обычном рестарте API. Автоматическое хранение всех unseal shares рядом с OpenBao без защиты не считается решённым bootstrap.
|
||||
Отзыв leaf: CRL применяется Envoy, Nginx и PostgreSQL. Native Redis, MinIO, OpenBao и OTel HTTP SDK в этой конфигурации не заявляют CRL-проверку. Для них применяются expiry, отзыв auth credentials, restart соединений. При компрометации CA нужен отдельный rollover trust bundle; текущий скрипт обновляет leaf и CRL, автоматический rollover CA не реализован.
|
||||
|
||||
@@ -0,0 +1,408 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"mode": "persistence",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:54:00.397764265Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"recreated_services": [
|
||||
"api",
|
||||
"api-tls",
|
||||
"api2",
|
||||
"api2-tls",
|
||||
"cache",
|
||||
"db",
|
||||
"grafana",
|
||||
"grafana-tls",
|
||||
"lb",
|
||||
"loki",
|
||||
"loki-tls",
|
||||
"minio",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"otel-collector-tls",
|
||||
"prometheus",
|
||||
"prometheus-tls",
|
||||
"tempo",
|
||||
"tempo-tls",
|
||||
"worker"
|
||||
],
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "f63b75c3e746f27af829d43d44fe3fa3fc0d627be1a162555f3cece34e6d0f00",
|
||||
"instance_id": "a38daed10c55",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:18.854385282Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "a38daed10c559f5a8d64dcde66ea1f49ff678c189a93bdbcc8b4b3596207c72f",
|
||||
"instance_id": "a38daed10c55",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.603993062Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "5130030fbb41c424d5ec528f9a2e58a24d29a9e59985784a5db6786903dc621c",
|
||||
"instance_id": "320673c84b93",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:18.845170865Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "320673c84b93b08630bbf2763e82eabae3066d407470264d873275b32b2c9442",
|
||||
"instance_id": "320673c84b93",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.60741193Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "91bdd4903f43e4ebfd42fe3edf2b24626b0b6aa9dd4a961a78f32e2ab278b685",
|
||||
"instance_id": "91bdd4903f43",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:13.583044112Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "3d5ab92792fa9e524b81c99919181459dd033de532f891e91eb662fae59d4a25",
|
||||
"instance_id": "3d5ab92792fa",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:07.587602575Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "0ce4a7d89eebced038e30a1fc3bf2403abec99e9a0ba701592560a4f988fe4e4",
|
||||
"instance_id": "67110eff1dd3",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.84839969Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "67110eff1dd30af96343db3e88d97e8b56c2ec93e40847f213321ec5877a4928",
|
||||
"instance_id": "67110eff1dd3",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.60853588Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "aa2bb998add7661cbe61a5de4038dbdda7dcbf593bf91da2f752c34a80f0fe8d",
|
||||
"instance_id": "aa2bb998add7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:24.426620599Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "3bbbf98a25f6b919806745c2fdf6bf5debdc972bce528e725c02c6559d71d818",
|
||||
"instance_id": "4be804d2c156",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.822068198Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "4be804d2c15692c87746cf1ecd3eec77b2ce6aab2d06e800911b119e7d874401",
|
||||
"instance_id": "4be804d2c156",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.600021763Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "05e7dd9662bd839fb568fa5683546c548f265c72b9c963b36df586da17c34a4f",
|
||||
"instance_id": "05e7dd9662bd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:07.585993569Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "c982e200cda55eafaa7898d235c73621f1cba8e865ce5d45e3f7f42e80258aa1",
|
||||
"instance_id": "c982e200cda5",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:07.584324102Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "e63a1fbf2188355445c15e46f5c7528e46ad505d41ab7f406045789e891b6a77",
|
||||
"instance_id": "e449915522bf",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.840920088Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "e449915522bf3e9707b399815639b9658bbf2b1cd2ac225d99be0fdd66e887ee",
|
||||
"instance_id": "e449915522bf",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.609728897Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "cac24ab70fbd3e0a800354c93186dbf547c21077254d59339706fff75e439c14",
|
||||
"instance_id": "4bf248fd7c21",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.741840868Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "4bf248fd7c21df2c3b9ad68d6830eb3216d10837de3907180305320b1bde6562",
|
||||
"instance_id": "4bf248fd7c21",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.596572846Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "6f36b6e9429ddd1733ba88d54760bec180ff5fd09e656b0b384d7858955c36e2",
|
||||
"instance_id": "715f1fca4b18",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.82802483Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "715f1fca4b18b0f3ef72ee1946d17b879251ee1bfe50e0e961262f3c3d8efbcc",
|
||||
"instance_id": "715f1fca4b18",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.606363124Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "9d351b5c0d093801ec09df3d3a50d5c45715e3861713cfef7ad11d159ce2b7c7",
|
||||
"instance_id": "9d351b5c0d09",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:19.098392272Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 20.405
|
||||
}
|
||||
@@ -0,0 +1,408 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"mode": "persistence",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "f63b75c3e746f27af829d43d44fe3fa3fc0d627be1a162555f3cece34e6d0f00",
|
||||
"instance_id": "a38daed10c55",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:18.854385282Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "a38daed10c559f5a8d64dcde66ea1f49ff678c189a93bdbcc8b4b3596207c72f",
|
||||
"instance_id": "a38daed10c55",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.603993062Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "5130030fbb41c424d5ec528f9a2e58a24d29a9e59985784a5db6786903dc621c",
|
||||
"instance_id": "320673c84b93",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:18.845170865Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "320673c84b93b08630bbf2763e82eabae3066d407470264d873275b32b2c9442",
|
||||
"instance_id": "320673c84b93",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.60741193Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "91bdd4903f43e4ebfd42fe3edf2b24626b0b6aa9dd4a961a78f32e2ab278b685",
|
||||
"instance_id": "91bdd4903f43",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:13.583044112Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "3d5ab92792fa9e524b81c99919181459dd033de532f891e91eb662fae59d4a25",
|
||||
"instance_id": "3d5ab92792fa",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:07.587602575Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "0ce4a7d89eebced038e30a1fc3bf2403abec99e9a0ba701592560a4f988fe4e4",
|
||||
"instance_id": "67110eff1dd3",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.84839969Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "67110eff1dd30af96343db3e88d97e8b56c2ec93e40847f213321ec5877a4928",
|
||||
"instance_id": "67110eff1dd3",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.60853588Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "aa2bb998add7661cbe61a5de4038dbdda7dcbf593bf91da2f752c34a80f0fe8d",
|
||||
"instance_id": "aa2bb998add7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:24.426620599Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "3bbbf98a25f6b919806745c2fdf6bf5debdc972bce528e725c02c6559d71d818",
|
||||
"instance_id": "4be804d2c156",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.822068198Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "4be804d2c15692c87746cf1ecd3eec77b2ce6aab2d06e800911b119e7d874401",
|
||||
"instance_id": "4be804d2c156",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.600021763Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "05e7dd9662bd839fb568fa5683546c548f265c72b9c963b36df586da17c34a4f",
|
||||
"instance_id": "05e7dd9662bd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:07.585993569Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "c982e200cda55eafaa7898d235c73621f1cba8e865ce5d45e3f7f42e80258aa1",
|
||||
"instance_id": "c982e200cda5",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:07.584324102Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "e63a1fbf2188355445c15e46f5c7528e46ad505d41ab7f406045789e891b6a77",
|
||||
"instance_id": "e449915522bf",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.840920088Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "e449915522bf3e9707b399815639b9658bbf2b1cd2ac225d99be0fdd66e887ee",
|
||||
"instance_id": "e449915522bf",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.609728897Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "cac24ab70fbd3e0a800354c93186dbf547c21077254d59339706fff75e439c14",
|
||||
"instance_id": "4bf248fd7c21",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.741840868Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "4bf248fd7c21df2c3b9ad68d6830eb3216d10837de3907180305320b1bde6562",
|
||||
"instance_id": "4bf248fd7c21",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.596572846Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "6f36b6e9429ddd1733ba88d54760bec180ff5fd09e656b0b384d7858955c36e2",
|
||||
"instance_id": "715f1fca4b18",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.82802483Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "715f1fca4b18b0f3ef72ee1946d17b879251ee1bfe50e0e961262f3c3d8efbcc",
|
||||
"instance_id": "715f1fca4b18",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:17.606363124Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "9d351b5c0d093801ec09df3d3a50d5c45715e3861713cfef7ad11d159ce2b7c7",
|
||||
"instance_id": "9d351b5c0d09",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:19.098392272Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"recreated_services": [
|
||||
"api",
|
||||
"api-tls",
|
||||
"api2",
|
||||
"api2-tls",
|
||||
"cache",
|
||||
"db",
|
||||
"grafana",
|
||||
"grafana-tls",
|
||||
"lb",
|
||||
"loki",
|
||||
"loki-tls",
|
||||
"minio",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"otel-collector-tls",
|
||||
"prometheus",
|
||||
"prometheus-tls",
|
||||
"tempo",
|
||||
"tempo-tls",
|
||||
"worker"
|
||||
],
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "c08128f088ec76993e3ada8f101dc058f04b0d62ee1e6968f422c3c9621484e3",
|
||||
"instance_id": "4b1968bd1a00",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:56.195883642Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "4b1968bd1a00598f29c172cbc436b722a88d6f1804489abf99093dd2f9137a64",
|
||||
"instance_id": "4b1968bd1a00",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.417382436Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8a3c7585de0dfafa9b70659555a0807ee1ca93fd60b68a606314308735a3f80c",
|
||||
"instance_id": "a8d37c0bbb20",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:56.203963093Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8d37c0bbb20cf6a0995d0a3e5fb407e7df535c04251526bdf66052309d136ab",
|
||||
"instance_id": "a8d37c0bbb20",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.422355384Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "e32eaaf20d0ddf0aef4ac471c65eadccf57c3db6f0d9a0f68316103bd7ac0570",
|
||||
"instance_id": "e32eaaf20d0d",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:50.654677636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "17c2e7117213fbe5a86d247b51664c8b9e352ef132c2b37b0c5a0b544de47055",
|
||||
"instance_id": "17c2e7117213",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:44.661795828Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "bf6ba452701684a5472f965f2b32c050fbd5bf31689e06615bb4d07fbfe049a5",
|
||||
"instance_id": "f417392196b0",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.618712995Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "f417392196b087a2fd36a2e87b6f0cd696143a6b34458a979b656cb1e24a108e",
|
||||
"instance_id": "f417392196b0",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.409238517Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c99e61dc0dbbc563d1d92209bc55c1f0d9ea5c2000bc494a6a39f1ba87570803",
|
||||
"instance_id": "c99e61dc0dbb",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:01.798637139Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "e53b1793c4ea79d9a9efe7939b2f7164cb152f2a3b3a290b3b6941142adb44bf",
|
||||
"instance_id": "e6aeb8abe611",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.70318538Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "e6aeb8abe611625144e87c7d4a5764b0fb41526b0719a3d0f922472835891b9a",
|
||||
"instance_id": "e6aeb8abe611",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.419312652Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "1085a2546a2341884dcf580433454da7c5f371d3ec1c52ede95a23cd09862e7d",
|
||||
"instance_id": "1085a2546a23",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:44.657991426Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "50df1f6d0afd59932e2cbc30bfed5e9af9364ab3a82ba50aa47e8133c3edd3ed",
|
||||
"instance_id": "50df1f6d0afd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:44.660488039Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "412927dd830c44e643ba032cc3e7e6c3177de649cfaa681655e817b426397704",
|
||||
"instance_id": "e6b8daff42c4",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.567798505Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "e6b8daff42c42451bde90069aaadf4f2d7829266349a7394df7ebdb5ebd98c6e",
|
||||
"instance_id": "e6b8daff42c4",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.413073061Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "b1de57ff5923d6f813cd13f5aa4cd7dc1179fcbaa48163ddd05327b47396712b",
|
||||
"instance_id": "6f2695c0bf2f",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.590235886Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "6f2695c0bf2f7a520988c45c90c858150dfb9b2b336092c6e39d55e026cbf0a2",
|
||||
"instance_id": "6f2695c0bf2f",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.42135589Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "0015bb1e54039ed569d3a48e0a28f30f16da86ecabf82b9373a7b0abc061b082",
|
||||
"instance_id": "bf952d045261",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.599075609Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "bf952d04526190ea40733af69bb18bf86685ba8ac87643cffb4ce2992196503c",
|
||||
"instance_id": "bf952d045261",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.423501002Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "edd617a7d04c88f6a613fb569c87ac4a43a596fba9aad9db1680c98015538cdb",
|
||||
"instance_id": "edd617a7d04c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.905207439Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 20.717
|
||||
}
|
||||
@@ -0,0 +1,408 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"mode": "persistence",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "c08128f088ec76993e3ada8f101dc058f04b0d62ee1e6968f422c3c9621484e3",
|
||||
"instance_id": "4b1968bd1a00",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:56.195883642Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "4b1968bd1a00598f29c172cbc436b722a88d6f1804489abf99093dd2f9137a64",
|
||||
"instance_id": "4b1968bd1a00",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.417382436Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8a3c7585de0dfafa9b70659555a0807ee1ca93fd60b68a606314308735a3f80c",
|
||||
"instance_id": "a8d37c0bbb20",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:56.203963093Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8d37c0bbb20cf6a0995d0a3e5fb407e7df535c04251526bdf66052309d136ab",
|
||||
"instance_id": "a8d37c0bbb20",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.422355384Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "e32eaaf20d0ddf0aef4ac471c65eadccf57c3db6f0d9a0f68316103bd7ac0570",
|
||||
"instance_id": "e32eaaf20d0d",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:50.654677636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "17c2e7117213fbe5a86d247b51664c8b9e352ef132c2b37b0c5a0b544de47055",
|
||||
"instance_id": "17c2e7117213",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:44.661795828Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "bf6ba452701684a5472f965f2b32c050fbd5bf31689e06615bb4d07fbfe049a5",
|
||||
"instance_id": "f417392196b0",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.618712995Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "f417392196b087a2fd36a2e87b6f0cd696143a6b34458a979b656cb1e24a108e",
|
||||
"instance_id": "f417392196b0",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.409238517Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c99e61dc0dbbc563d1d92209bc55c1f0d9ea5c2000bc494a6a39f1ba87570803",
|
||||
"instance_id": "c99e61dc0dbb",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:01.798637139Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "e53b1793c4ea79d9a9efe7939b2f7164cb152f2a3b3a290b3b6941142adb44bf",
|
||||
"instance_id": "e6aeb8abe611",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.70318538Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "e6aeb8abe611625144e87c7d4a5764b0fb41526b0719a3d0f922472835891b9a",
|
||||
"instance_id": "e6aeb8abe611",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.419312652Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "1085a2546a2341884dcf580433454da7c5f371d3ec1c52ede95a23cd09862e7d",
|
||||
"instance_id": "1085a2546a23",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:44.657991426Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "50df1f6d0afd59932e2cbc30bfed5e9af9364ab3a82ba50aa47e8133c3edd3ed",
|
||||
"instance_id": "50df1f6d0afd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:44.660488039Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "412927dd830c44e643ba032cc3e7e6c3177de649cfaa681655e817b426397704",
|
||||
"instance_id": "e6b8daff42c4",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.567798505Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "e6b8daff42c42451bde90069aaadf4f2d7829266349a7394df7ebdb5ebd98c6e",
|
||||
"instance_id": "e6b8daff42c4",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.413073061Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "b1de57ff5923d6f813cd13f5aa4cd7dc1179fcbaa48163ddd05327b47396712b",
|
||||
"instance_id": "6f2695c0bf2f",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.590235886Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "6f2695c0bf2f7a520988c45c90c858150dfb9b2b336092c6e39d55e026cbf0a2",
|
||||
"instance_id": "6f2695c0bf2f",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.42135589Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "0015bb1e54039ed569d3a48e0a28f30f16da86ecabf82b9373a7b0abc061b082",
|
||||
"instance_id": "bf952d045261",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.599075609Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "bf952d04526190ea40733af69bb18bf86685ba8ac87643cffb4ce2992196503c",
|
||||
"instance_id": "bf952d045261",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.423501002Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "edd617a7d04c88f6a613fb569c87ac4a43a596fba9aad9db1680c98015538cdb",
|
||||
"instance_id": "edd617a7d04c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:55:55.905207439Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"recreated_services": [
|
||||
"api",
|
||||
"api-tls",
|
||||
"api2",
|
||||
"api2-tls",
|
||||
"cache",
|
||||
"db",
|
||||
"grafana",
|
||||
"grafana-tls",
|
||||
"lb",
|
||||
"loki",
|
||||
"loki-tls",
|
||||
"minio",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"otel-collector-tls",
|
||||
"prometheus",
|
||||
"prometheus-tls",
|
||||
"tempo",
|
||||
"tempo-tls",
|
||||
"worker"
|
||||
],
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "ac9535571a0af1e9a69be3840da29ea33df48966fece9db50f2f4622875daba2",
|
||||
"instance_id": "8cbc7cdae99d",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:44.352635658Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "8cbc7cdae99d18d5dffd3d89337b244f7035d7eba50d867904a3306728f51f72",
|
||||
"instance_id": "8cbc7cdae99d",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.705643567Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "23c6aeeaed0c7628dc7c749340624f468da6bb5c5d7baca91fd79d8644afea6a",
|
||||
"instance_id": "36be08cb195e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:44.34594897Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "36be08cb195e91688af819871ec9775e1cbbf62b2eef819ffb892139e215be7d",
|
||||
"instance_id": "36be08cb195e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.700940058Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "b938ce5f811c5051f5407345f8fc7b795f5f10b332d296ddea4623593d7bb68f",
|
||||
"instance_id": "b938ce5f811c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:38.688651433Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "5a120872fe6ace787407607ebf28f3c069ade86875d92ca154a54be2a94ebbf8",
|
||||
"instance_id": "5a120872fe6a",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:32.719464857Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "625831e507153eb837f53543dcd20b6ee32dd7fcf23afdca1bcea31dc8e8bec2",
|
||||
"instance_id": "22d63eb2a0dd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.957565695Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "22d63eb2a0dd62100770cef52465e9bde93c53d826193e3dd8dcd76bff209cba",
|
||||
"instance_id": "22d63eb2a0dd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.710753537Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "42390bb4fdda2499f61f6cd35af706ba13ff05f493580ac49c6c77a40a525e02",
|
||||
"instance_id": "42390bb4fdda",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:49.929282427Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "1c1af310f126184df998c40ec555540786852cb2b0b13c5c2873a644ea6a6183",
|
||||
"instance_id": "3621b57d41e2",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.944399693Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "3621b57d41e2c72434ac5bc08aedf187f1e2456b788d6d8da85686e8c76806dd",
|
||||
"instance_id": "3621b57d41e2",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.714834562Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8e0bc62bee4bc325bff78d614cf83afcca56df955d24fe1401599aef1693d614",
|
||||
"instance_id": "8e0bc62bee4b",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:32.724476062Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "d726adeb87b7c6e0135993b20b74d556cf0aaade52722652d4b5e779fd95b8b6",
|
||||
"instance_id": "d726adeb87b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:32.72374893Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "adb00a46caf5b6d6b852e603e3f91b956e90f3f7bfe0567ba7917193864abe40",
|
||||
"instance_id": "4639ca56e86a",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.903971334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "4639ca56e86a5d37225397bc50e3f562fda6d5395a57f2ece847f064c5f27d64",
|
||||
"instance_id": "4639ca56e86a",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.711707206Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "1cd951910d807513a2520521dfa33e494f58a692d17cca47a8d2beda9266e550",
|
||||
"instance_id": "ecb7a6d88912",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.946011801Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "ecb7a6d88912da3f1de665d52387eeeeb157122dbad17956ca1dcd61791cd99c",
|
||||
"instance_id": "ecb7a6d88912",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.707260499Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "181738e1ffa3dd185caf4df1a220353e460eba2b8a11235d0a27bd6f169ee9d1",
|
||||
"instance_id": "3c779a0a6ecd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.949003043Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "3c779a0a6ecd468e517ef3df9200bf40264e77d9ae73025ff59bbc2060e6d671",
|
||||
"instance_id": "3c779a0a6ecd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:43.709970403Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "2b96dddcec464cc52c43dc1cf68caa81316e1a07fcd711e10b91bc6e28e474a8",
|
||||
"instance_id": "2b96dddcec46",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:56:44.204481391Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 20.316
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"old": "095d3e6f4d494c4655345352c871b47ecc6976b75787a684e6797cf40c64289b",
|
||||
"new": "19b005a07b10f62201a8544f9a9e33146b1f9f73e021da5d54f1948692e964e9",
|
||||
"phase": "retired",
|
||||
"trust_distributed": true,
|
||||
"offline_test": false,
|
||||
"events": [
|
||||
{
|
||||
"phase": "overlap",
|
||||
"unix_time": 1795157768.0538008,
|
||||
"trusted_roots": 2,
|
||||
"new_root_client_checks": [
|
||||
{
|
||||
"endpoint": "lb:443",
|
||||
"server_name": "lb",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api2-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "minio:9000",
|
||||
"server_name": "minio",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "openbao:8200",
|
||||
"server_name": "openbao",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector:4318",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector-tls:9464",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "loki-tls:3100",
|
||||
"server_name": "loki",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:4318",
|
||||
"server_name": "tempo",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:3200",
|
||||
"server_name": "tempo",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "prometheus-tls:9090",
|
||||
"server_name": "prometheus",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "grafana-tls:3000",
|
||||
"server_name": "grafana",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "db:5432",
|
||||
"server_name": "db",
|
||||
"application_response": "PostgreSQL Authentication"
|
||||
},
|
||||
{
|
||||
"endpoint": "redis:6379",
|
||||
"server_name": "redis",
|
||||
"application_response": "Redis NOAUTH"
|
||||
}
|
||||
],
|
||||
"old_root_client": "accepted"
|
||||
},
|
||||
{
|
||||
"phase": "reissued",
|
||||
"unix_time": 1795157805.6714563,
|
||||
"trusted_roots": 2,
|
||||
"new_root_server_checks": [
|
||||
{
|
||||
"endpoint": "lb:443",
|
||||
"server_name": "lb",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api2-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "minio:9000",
|
||||
"server_name": "minio",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "openbao:8200",
|
||||
"server_name": "openbao",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector:4318",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector-tls:9464",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "loki-tls:3100",
|
||||
"server_name": "loki",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:4318",
|
||||
"server_name": "tempo",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:3200",
|
||||
"server_name": "tempo",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "prometheus-tls:9090",
|
||||
"server_name": "prometheus",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "grafana-tls:3000",
|
||||
"server_name": "grafana",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "db:5432",
|
||||
"server_name": "db",
|
||||
"application_response": "PostgreSQL Authentication"
|
||||
},
|
||||
{
|
||||
"endpoint": "redis:6379",
|
||||
"server_name": "redis",
|
||||
"application_response": "Redis NOAUTH"
|
||||
}
|
||||
],
|
||||
"old_root_client": "accepted during overlap",
|
||||
"leaf_roles": [
|
||||
"lb",
|
||||
"api",
|
||||
"worker",
|
||||
"db",
|
||||
"minio",
|
||||
"redis",
|
||||
"client-api",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"collector",
|
||||
"prometheus",
|
||||
"tempo",
|
||||
"loki",
|
||||
"grafana",
|
||||
"operator"
|
||||
]
|
||||
},
|
||||
{
|
||||
"phase": "retired",
|
||||
"unix_time": 1795157854.7140448,
|
||||
"trusted_roots": 1,
|
||||
"old_ca_revocation_recorded": true,
|
||||
"old_root_client": "rejected on both API replicas",
|
||||
"new_root_server_checks": [
|
||||
{
|
||||
"endpoint": "lb:443",
|
||||
"server_name": "lb",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api2-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "minio:9000",
|
||||
"server_name": "minio",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "openbao:8200",
|
||||
"server_name": "openbao",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector:4318",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector-tls:9464",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "loki-tls:3100",
|
||||
"server_name": "loki",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:4318",
|
||||
"server_name": "tempo",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:3200",
|
||||
"server_name": "tempo",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "prometheus-tls:9090",
|
||||
"server_name": "prometheus",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "grafana-tls:3000",
|
||||
"server_name": "grafana",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "db:5432",
|
||||
"server_name": "db",
|
||||
"application_response": "PostgreSQL Authentication"
|
||||
},
|
||||
{
|
||||
"endpoint": "redis:6379",
|
||||
"server_name": "redis",
|
||||
"application_response": "Redis NOAUTH"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"old": "15aafec55399d4ec1632be7b702e7811d61b05a615ab78851f1baf2994205ea6",
|
||||
"new": "fb87e810ca80ed42d26e318cdefe55f95674648f60df337798cff4c0c912a035",
|
||||
"phase": "retired",
|
||||
"trust_distributed": true,
|
||||
"offline_test": false,
|
||||
"events": [
|
||||
{
|
||||
"phase": "overlap",
|
||||
"unix_time": 1795722939.1857848,
|
||||
"trusted_roots": 2,
|
||||
"new_root_client_checks": [
|
||||
{
|
||||
"endpoint": "lb:443",
|
||||
"server_name": "lb",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api2-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "minio:9000",
|
||||
"server_name": "minio",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "openbao:8200",
|
||||
"server_name": "openbao",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector:4318",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector-tls:9464",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "loki-tls:3100",
|
||||
"server_name": "loki",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:4318",
|
||||
"server_name": "tempo",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:3200",
|
||||
"server_name": "tempo",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "prometheus-tls:9090",
|
||||
"server_name": "prometheus",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "grafana-tls:3000",
|
||||
"server_name": "grafana",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "db:5432",
|
||||
"server_name": "db",
|
||||
"application_response": "PostgreSQL Authentication"
|
||||
},
|
||||
{
|
||||
"endpoint": "redis:6379",
|
||||
"server_name": "redis",
|
||||
"application_response": "Redis NOAUTH"
|
||||
}
|
||||
],
|
||||
"old_root_client": "accepted"
|
||||
},
|
||||
{
|
||||
"phase": "reissued",
|
||||
"unix_time": 1795722976.669059,
|
||||
"trusted_roots": 2,
|
||||
"new_root_server_checks": [
|
||||
{
|
||||
"endpoint": "lb:443",
|
||||
"server_name": "lb",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api2-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "minio:9000",
|
||||
"server_name": "minio",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "openbao:8200",
|
||||
"server_name": "openbao",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector:4318",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector-tls:9464",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "loki-tls:3100",
|
||||
"server_name": "loki",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:4318",
|
||||
"server_name": "tempo",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:3200",
|
||||
"server_name": "tempo",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "prometheus-tls:9090",
|
||||
"server_name": "prometheus",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "grafana-tls:3000",
|
||||
"server_name": "grafana",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "db:5432",
|
||||
"server_name": "db",
|
||||
"application_response": "PostgreSQL Authentication"
|
||||
},
|
||||
{
|
||||
"endpoint": "redis:6379",
|
||||
"server_name": "redis",
|
||||
"application_response": "Redis NOAUTH"
|
||||
}
|
||||
],
|
||||
"old_root_client": "accepted during overlap",
|
||||
"leaf_roles": [
|
||||
"lb",
|
||||
"api",
|
||||
"worker",
|
||||
"db",
|
||||
"minio",
|
||||
"redis",
|
||||
"client-api",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"collector",
|
||||
"prometheus",
|
||||
"tempo",
|
||||
"loki",
|
||||
"grafana",
|
||||
"operator"
|
||||
]
|
||||
},
|
||||
{
|
||||
"phase": "retired",
|
||||
"unix_time": 1795723024.6039836,
|
||||
"trusted_roots": 1,
|
||||
"old_ca_revocation_recorded": true,
|
||||
"old_root_client": "rejected on both API replicas",
|
||||
"new_root_server_checks": [
|
||||
{
|
||||
"endpoint": "lb:443",
|
||||
"server_name": "lb",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "api2-tls:8443",
|
||||
"server_name": "api",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "minio:9000",
|
||||
"server_name": "minio",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "openbao:8200",
|
||||
"server_name": "openbao",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector:4318",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "otel-collector-tls:9464",
|
||||
"server_name": "otel-collector",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "loki-tls:3100",
|
||||
"server_name": "loki",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:4318",
|
||||
"server_name": "tempo",
|
||||
"http_status": 405
|
||||
},
|
||||
{
|
||||
"endpoint": "tempo-tls:3200",
|
||||
"server_name": "tempo",
|
||||
"http_status": 503
|
||||
},
|
||||
{
|
||||
"endpoint": "prometheus-tls:9090",
|
||||
"server_name": "prometheus",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "grafana-tls:3000",
|
||||
"server_name": "grafana",
|
||||
"http_status": 200
|
||||
},
|
||||
{
|
||||
"endpoint": "db:5432",
|
||||
"server_name": "db",
|
||||
"application_response": "PostgreSQL Authentication"
|
||||
},
|
||||
{
|
||||
"endpoint": "redis:6379",
|
||||
"server_name": "redis",
|
||||
"application_response": "Redis NOAUTH"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,349 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"docker_version": "29.1.3",
|
||||
"docker_root_dir": "/var/lib/docker",
|
||||
"context": "main compose.yaml, no diagnostic override",
|
||||
"services": [
|
||||
{
|
||||
"service": "lb",
|
||||
"container_id": "42390bb4fdda2499f61f6cd35af706ba13ff05f493580ac49c6c77a40a525e02",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {
|
||||
"443/tcp": [
|
||||
{
|
||||
"HostIp": "",
|
||||
"HostPort": "8443"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"service": "loki",
|
||||
"container_id": "1c1af310f126184df998c40ec555540786852cb2b0b13c5c2873a644ea6a6183",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "prometheus",
|
||||
"container_id": "1cd951910d807513a2520521dfa33e494f58a692d17cca47a8d2beda9266e550",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "grafana",
|
||||
"container_id": "625831e507153eb837f53543dcd20b6ee32dd7fcf23afdca1bcea31dc8e8bec2",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "otel-collector",
|
||||
"container_id": "adb00a46caf5b6d6b852e603e3f91b956e90f3f7bfe0567ba7917193864abe40",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "tempo",
|
||||
"container_id": "181738e1ffa3dd185caf4df1a220353e460eba2b8a11235d0a27bd6f169ee9d1",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "api2",
|
||||
"container_id": "23c6aeeaed0c7628dc7c749340624f468da6bb5c5d7baca91fd79d8644afea6a",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 402653184,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "api",
|
||||
"container_id": "ac9535571a0af1e9a69be3840da29ea33df48966fece9db50f2f4622875daba2",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 402653184,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "tempo-tls",
|
||||
"container_id": "3c779a0a6ecd468e517ef3df9200bf40264e77d9ae73025ff59bbc2060e6d671",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "api-tls",
|
||||
"container_id": "8cbc7cdae99d18d5dffd3d89337b244f7035d7eba50d867904a3306728f51f72",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "grafana-tls",
|
||||
"container_id": "22d63eb2a0dd62100770cef52465e9bde93c53d826193e3dd8dcd76bff209cba",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {
|
||||
"3000/tcp": [
|
||||
{
|
||||
"HostIp": "127.0.0.1",
|
||||
"HostPort": "3000"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"service": "otel-collector-tls",
|
||||
"container_id": "4639ca56e86a5d37225397bc50e3f562fda6d5395a57f2ece847f064c5f27d64",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "api2-tls",
|
||||
"container_id": "36be08cb195e91688af819871ec9775e1cbbf62b2eef819ffb892139e215be7d",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "loki-tls",
|
||||
"container_id": "3621b57d41e2c72434ac5bc08aedf187f1e2456b788d6d8da85686e8c76806dd",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "prometheus-tls",
|
||||
"container_id": "ecb7a6d88912da3f1de665d52387eeeeb157122dbad17956ca1dcd61791cd99c",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "worker",
|
||||
"container_id": "2b96dddcec464cc52c43dc1cf68caa81316e1a07fcd711e10b91bc6e28e474a8",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "db",
|
||||
"container_id": "5a120872fe6ace787407607ebf28f3c069ade86875d92ca154a54be2a94ebbf8",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "openbao",
|
||||
"container_id": "d726adeb87b7c6e0135993b20b74d556cf0aaade52722652d4b5e779fd95b8b6",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {
|
||||
"8200/tcp": [
|
||||
{
|
||||
"HostIp": "127.0.0.1",
|
||||
"HostPort": "8200"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"service": "cache",
|
||||
"container_id": "b938ce5f811c5051f5407345f8fc7b795f5f10b332d296ddea4623593d7bb68f",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
},
|
||||
{
|
||||
"service": "minio",
|
||||
"container_id": "8e0bc62bee4bc325bff78d614cf83afcca56df955d24fe1401599aef1693d614",
|
||||
"user": "1000:1000",
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"ALL"
|
||||
],
|
||||
"no_new_privs": 1,
|
||||
"effective_capabilities": 0,
|
||||
"seccomp": "2",
|
||||
"apparmor": "docker-default",
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 500000000,
|
||||
"published_ports": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
{
|
||||
"scanner": "Trivy 0.60.0",
|
||||
"date": "2026-11-20",
|
||||
"scope": "API/Worker Ubuntu runtime OS packages; unmanaged C++ libraries are not covered by this OS-only scan",
|
||||
"before": {
|
||||
"CRITICAL": 0,
|
||||
"HIGH": 0,
|
||||
"MEDIUM": 38,
|
||||
"LOW": 5,
|
||||
"UNKNOWN": 0
|
||||
},
|
||||
"after": {
|
||||
"CRITICAL": 0,
|
||||
"HIGH": 0,
|
||||
"MEDIUM": 24,
|
||||
"LOW": 5,
|
||||
"UNKNOWN": 0
|
||||
},
|
||||
"scan_image_id": "sha256:fc606bd73c48b73c1ede7f515d92c4684a53f45c86a065711d6bd1d3e67fd185",
|
||||
"archive_sha256": "6ed3502291c1bde2c846f9df15484c838238ad3b61c0fae7cdde976890c9da5d",
|
||||
"findings": [
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "bsdutils",
|
||||
"InstalledVersion": "1:2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-102473",
|
||||
"PkgName": "dash",
|
||||
"InstalledVersion": "0.5.12-6ubuntu5",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "dash: dash: Super-polynomial backtracking in pmatch when libc fnmatch is disabled"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-102474",
|
||||
"PkgName": "dash",
|
||||
"InstalledVersion": "0.5.12-6ubuntu5",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "dash: dash: Heap out-of-bounds write in conv_escape via undersized Unicode escape reservation"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-105712",
|
||||
"PkgName": "gpgv",
|
||||
"InstalledVersion": "2.4.4-2ubuntu17.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "LOW",
|
||||
"Status": "affected",
|
||||
"Title": "gnupg2: gnupg: Arbitrary file overwrite via symlink traversal in gpgtar"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "libblkid1",
|
||||
"InstalledVersion": "2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-67693",
|
||||
"PkgName": "libgnutls30t64",
|
||||
"InstalledVersion": "3.8.3-1.1ubuntu3.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "gnutls: gnutls: Information disclosure via contradictory Key Usage and Extended Key Usage extensions"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-88647",
|
||||
"PkgName": "libgnutls30t64",
|
||||
"InstalledVersion": "3.8.3-1.1ubuntu3.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "gnutls: gnutls: Information disclosure via hostname verification bypass"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-88648",
|
||||
"PkgName": "libgnutls30t64",
|
||||
"InstalledVersion": "3.8.3-1.1ubuntu3.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "gnutls: gnutls: Cross-domain certificate restriction bypass via incomplete X.509 validation"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-95184",
|
||||
"PkgName": "libgnutls30t64",
|
||||
"InstalledVersion": "3.8.3-1.1ubuntu3.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "gnutls: gnutls: legitimate user certificates incorrectly rejected causing denial of service"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-95210",
|
||||
"PkgName": "libgnutls30t64",
|
||||
"InstalledVersion": "3.8.3-1.1ubuntu3.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "gnutls: gnutls: certificates with invalid extensions incorrectly accepted"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-107778",
|
||||
"PkgName": "libgssapi-krb5-2",
|
||||
"InstalledVersion": "1.20.1-6ubuntu2.10",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "krb5: krb5: Denial of Service via crafted forwarded credentials"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-107778",
|
||||
"PkgName": "libk5crypto3",
|
||||
"InstalledVersion": "1.20.1-6ubuntu2.10",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "krb5: krb5: Denial of Service via crafted forwarded credentials"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-107778",
|
||||
"PkgName": "libkrb5-3",
|
||||
"InstalledVersion": "1.20.1-6ubuntu2.10",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "krb5: krb5: Denial of Service via crafted forwarded credentials"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-107778",
|
||||
"PkgName": "libkrb5support0",
|
||||
"InstalledVersion": "1.20.1-6ubuntu2.10",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "krb5: krb5: Denial of Service via crafted forwarded credentials"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "libmount1",
|
||||
"InstalledVersion": "2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-107161",
|
||||
"PkgName": "libsasl2-2",
|
||||
"InstalledVersion": "2.1.28+dfsg1-5ubuntu3.1",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "cyrus-sasl: Heap buffer overflow in cyrus-sasl add_to_challenge() allows malicious server to crash or compromise DIGEST-MD5 clients"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-107161",
|
||||
"PkgName": "libsasl2-modules-db",
|
||||
"InstalledVersion": "2.1.28+dfsg1-5ubuntu3.1",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "cyrus-sasl: Heap buffer overflow in cyrus-sasl add_to_challenge() allows malicious server to crash or compromise DIGEST-MD5 clients"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "libsmartcols1",
|
||||
"InstalledVersion": "2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-121876",
|
||||
"PkgName": "libsystemd0",
|
||||
"InstalledVersion": "255.4-1ubuntu8.19",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "sandboxed-containers: kernel: systemd-gpt-auto-generator: Guest Data Leakage in Confidential Computing (Sandboxed Containers)"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-40228",
|
||||
"PkgName": "libsystemd0",
|
||||
"InstalledVersion": "255.4-1ubuntu8.19",
|
||||
"FixedVersion": "",
|
||||
"Severity": "LOW",
|
||||
"Status": "affected",
|
||||
"Title": "systemd: systemd-journald: Unintended output to user terminals via logger command"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-121876",
|
||||
"PkgName": "libudev1",
|
||||
"InstalledVersion": "255.4-1ubuntu8.19",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "sandboxed-containers: kernel: systemd-gpt-auto-generator: Guest Data Leakage in Confidential Computing (Sandboxed Containers)"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-40228",
|
||||
"PkgName": "libudev1",
|
||||
"InstalledVersion": "255.4-1ubuntu8.19",
|
||||
"FixedVersion": "",
|
||||
"Severity": "LOW",
|
||||
"Status": "affected",
|
||||
"Title": "systemd: systemd-journald: Unintended output to user terminals via logger command"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "libuuid1",
|
||||
"InstalledVersion": "2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2024-56433",
|
||||
"PkgName": "login",
|
||||
"InstalledVersion": "1:4.13+dfsg1-4ubuntu3.2",
|
||||
"FixedVersion": "",
|
||||
"Severity": "LOW",
|
||||
"Status": "affected",
|
||||
"Title": "shadow-utils: Default subordinate ID configuration in /etc/login.defs could lead to compromise"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "mount",
|
||||
"InstalledVersion": "2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2024-56433",
|
||||
"PkgName": "passwd",
|
||||
"InstalledVersion": "1:4.13+dfsg1-4ubuntu3.2",
|
||||
"FixedVersion": "",
|
||||
"Severity": "LOW",
|
||||
"Status": "affected",
|
||||
"Title": "shadow-utils: Default subordinate ID configuration in /etc/login.defs could lead to compromise"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-18477",
|
||||
"PkgName": "tar",
|
||||
"InstalledVersion": "1.35+dfsg-3ubuntu0.4",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "tar: tar: TOCTOU in incremental dumpdir 'X' rename handling allows restore path escape"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-18508",
|
||||
"PkgName": "tar",
|
||||
"InstalledVersion": "1.35+dfsg-3ubuntu0.4",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "tar: tar: --one-top-level hardlink targets not confined to top-level directory enabling arbitrary file overwrite"
|
||||
},
|
||||
{
|
||||
"VulnerabilityID": "CVE-2026-76642",
|
||||
"PkgName": "util-linux",
|
||||
"InstalledVersion": "2.39.3-9ubuntu6.6",
|
||||
"FixedVersion": "",
|
||||
"Severity": "MEDIUM",
|
||||
"Status": "affected",
|
||||
"Title": "util-linux: util-linux: failed external mount helper still runs privileged X-mount post-hooks"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ok": 78,
|
||||
"errors": 2,
|
||||
"first_failure_seconds": 1.542,
|
||||
"recovered_seconds": 2.048,
|
||||
"elapsed_seconds": 22.048
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"mode": "failover",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.03276334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"stopped_service": "api2",
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": false,
|
||||
"started_at": "2026-11-26T19:52:36.03276334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 0.582
|
||||
}
|
||||
@@ -0,0 +1,408 @@
|
||||
{
|
||||
"status": "PASS",
|
||||
"mode": "persistence",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "827e6c360b4249f011301015d98a3276a8d7d7144ad3580c4a601032126690ec",
|
||||
"instance_id": "1076841a0a1b",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:51:51.491216224Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "1076841a0a1b45576a166563ab7c010af096ba204444a32fbba45ffb48a005f3",
|
||||
"instance_id": "1076841a0a1b",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.06237241Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "6e43ccf8f0fc5185159256ce56e68906769d544c119fada3c31a0eb7b08dc5e6",
|
||||
"instance_id": "12e9b50053f6",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:51:51.487803105Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "12e9b50053f6e35f6a5fe11adcc93cfb452dd18f7da5cdd85cb5aa86234fbcf3",
|
||||
"instance_id": "12e9b50053f6",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.063491467Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "3c8bf3228f8faa186171fec5d107c2628a6b9b12e37ce50ba4b7a36aeef17ae9",
|
||||
"instance_id": "3c8bf3228f8f",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:14.075189195Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "adf7ce0487e20c8e1240df82d55219d1ca8662952836567df38de556a8b27753",
|
||||
"instance_id": "adf7ce0487e2",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.072304649Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "6ea01229abce9cf9122e0fa77d42d246ceac6eeb87b2fa46867ace8847d985c4",
|
||||
"instance_id": "c23d7be473cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.513434947Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "c23d7be473cd724d4a07ac6b4bfe6ba944cc48ccc9d2bd0da88cad15d11a3c64",
|
||||
"instance_id": "c23d7be473cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.072715543Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "81dc0d7d1ffe37b1522e4f40e405567f75e7a320a2f824968d8d6dfa61867a05",
|
||||
"instance_id": "81dc0d7d1ffe",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.045255963Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "6cf786b1f0b6650c45dc9ee793465f02cc5ebe790546f336813e06328b4c21e5",
|
||||
"instance_id": "42305abe4aaa",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.490498112Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "42305abe4aaa21a2baa0530b1c2d8b043888733ff155d503c5e3a2d393f83c1d",
|
||||
"instance_id": "42305abe4aaa",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.064488989Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "98d5bcc77dac3b3c460abda63155db76bebf170752172f32c41be0188477f893",
|
||||
"instance_id": "98d5bcc77dac",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.044131123Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "01f3701c6d943471aa5d02caa2191ead30bbae4fc9cd6f5212020c8fd29c07d1",
|
||||
"instance_id": "01f3701c6d94",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.07375811Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "5f3e896b09970fa3fb0739424b3771287420fb264f32851d554f782924745f2b",
|
||||
"instance_id": "cace99182d53",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.383341061Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "cace99182d53ed570c1e5c6e2bf1afb7b2a3e04b7b83ed55b6990265752338e3",
|
||||
"instance_id": "cace99182d53",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.07051233Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "af17ba0c78b5a623b8cd2ff63401f68fce0f0e72a7c3768eb879a7d0de9ac105",
|
||||
"instance_id": "be118c2a8737",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.455147695Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "be118c2a8737626721cbeeb1bfff99e2658ceb301682a060c2295efcdb6c371e",
|
||||
"instance_id": "be118c2a8737",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.067304011Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "aff0fc36caf8733311ac7714818fe32dd98f17cac5e587114f66b349679e665f",
|
||||
"instance_id": "fdd6fbc9c094",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.47844644Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "fdd6fbc9c0946b9e3c8ed08beee8ff7a86d520d137553adc2b7a021ca2964378",
|
||||
"instance_id": "fdd6fbc9c094",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.069724963Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "814905e40722f9281ea7d85b37d511aa8afd143330c3e886fad124e49241ed13",
|
||||
"instance_id": "814905e40722",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:51:58.672825767Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"recreated_services": [
|
||||
"api",
|
||||
"api-tls",
|
||||
"api2",
|
||||
"api2-tls",
|
||||
"cache",
|
||||
"db",
|
||||
"grafana",
|
||||
"grafana-tls",
|
||||
"lb",
|
||||
"loki",
|
||||
"loki-tls",
|
||||
"minio",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"otel-collector-tls",
|
||||
"prometheus",
|
||||
"prometheus-tls",
|
||||
"tempo",
|
||||
"tempo-tls",
|
||||
"worker"
|
||||
],
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.03276334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 20.569
|
||||
}
|
||||
@@ -0,0 +1,817 @@
|
||||
{
|
||||
"base_url": "https://localhost:8443",
|
||||
"hardening": "main compose, NoNewPrivs=1 probe passed",
|
||||
"tests": [
|
||||
{
|
||||
"mode": "persistence",
|
||||
"status": "PASS",
|
||||
"elapsed_seconds": 21.911,
|
||||
"hook": {
|
||||
"status": "PASS",
|
||||
"mode": "persistence",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "827e6c360b4249f011301015d98a3276a8d7d7144ad3580c4a601032126690ec",
|
||||
"instance_id": "1076841a0a1b",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:51:51.491216224Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "1076841a0a1b45576a166563ab7c010af096ba204444a32fbba45ffb48a005f3",
|
||||
"instance_id": "1076841a0a1b",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.06237241Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "6e43ccf8f0fc5185159256ce56e68906769d544c119fada3c31a0eb7b08dc5e6",
|
||||
"instance_id": "12e9b50053f6",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:51:51.487803105Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "12e9b50053f6e35f6a5fe11adcc93cfb452dd18f7da5cdd85cb5aa86234fbcf3",
|
||||
"instance_id": "12e9b50053f6",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.063491467Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "3c8bf3228f8faa186171fec5d107c2628a6b9b12e37ce50ba4b7a36aeef17ae9",
|
||||
"instance_id": "3c8bf3228f8f",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:14.075189195Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "adf7ce0487e20c8e1240df82d55219d1ca8662952836567df38de556a8b27753",
|
||||
"instance_id": "adf7ce0487e2",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.072304649Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "6ea01229abce9cf9122e0fa77d42d246ceac6eeb87b2fa46867ace8847d985c4",
|
||||
"instance_id": "c23d7be473cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.513434947Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "c23d7be473cd724d4a07ac6b4bfe6ba944cc48ccc9d2bd0da88cad15d11a3c64",
|
||||
"instance_id": "c23d7be473cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.072715543Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "81dc0d7d1ffe37b1522e4f40e405567f75e7a320a2f824968d8d6dfa61867a05",
|
||||
"instance_id": "81dc0d7d1ffe",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.045255963Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "6cf786b1f0b6650c45dc9ee793465f02cc5ebe790546f336813e06328b4c21e5",
|
||||
"instance_id": "42305abe4aaa",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.490498112Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "42305abe4aaa21a2baa0530b1c2d8b043888733ff155d503c5e3a2d393f83c1d",
|
||||
"instance_id": "42305abe4aaa",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.064488989Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "98d5bcc77dac3b3c460abda63155db76bebf170752172f32c41be0188477f893",
|
||||
"instance_id": "98d5bcc77dac",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.044131123Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "01f3701c6d943471aa5d02caa2191ead30bbae4fc9cd6f5212020c8fd29c07d1",
|
||||
"instance_id": "01f3701c6d94",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.07375811Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "5f3e896b09970fa3fb0739424b3771287420fb264f32851d554f782924745f2b",
|
||||
"instance_id": "cace99182d53",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.383341061Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "cace99182d53ed570c1e5c6e2bf1afb7b2a3e04b7b83ed55b6990265752338e3",
|
||||
"instance_id": "cace99182d53",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.07051233Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "af17ba0c78b5a623b8cd2ff63401f68fce0f0e72a7c3768eb879a7d0de9ac105",
|
||||
"instance_id": "be118c2a8737",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.455147695Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "be118c2a8737626721cbeeb1bfff99e2658ceb301682a060c2295efcdb6c371e",
|
||||
"instance_id": "be118c2a8737",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.067304011Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "aff0fc36caf8733311ac7714818fe32dd98f17cac5e587114f66b349679e665f",
|
||||
"instance_id": "fdd6fbc9c094",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.47844644Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "fdd6fbc9c0946b9e3c8ed08beee8ff7a86d520d137553adc2b7a021ca2964378",
|
||||
"instance_id": "fdd6fbc9c094",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T12:50:28.069724963Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "814905e40722f9281ea7d85b37d511aa8afd143330c3e886fad124e49241ed13",
|
||||
"instance_id": "814905e40722",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:51:58.672825767Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"recreated_services": [
|
||||
"api",
|
||||
"api-tls",
|
||||
"api2",
|
||||
"api2-tls",
|
||||
"cache",
|
||||
"db",
|
||||
"grafana",
|
||||
"grafana-tls",
|
||||
"lb",
|
||||
"loki",
|
||||
"loki-tls",
|
||||
"minio",
|
||||
"openbao",
|
||||
"otel-collector",
|
||||
"otel-collector-tls",
|
||||
"prometheus",
|
||||
"prometheus-tls",
|
||||
"tempo",
|
||||
"tempo-tls",
|
||||
"worker"
|
||||
],
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.03276334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 20.569
|
||||
}
|
||||
},
|
||||
{
|
||||
"mode": "failover",
|
||||
"status": "PASS",
|
||||
"elapsed_seconds": 16.593,
|
||||
"public_metrics": {
|
||||
"observed_instances_before": 2,
|
||||
"successful_writes": 126,
|
||||
"failed_attempts": 0,
|
||||
"first_recovery_seconds": 0.697
|
||||
},
|
||||
"hook": {
|
||||
"status": "PASS",
|
||||
"mode": "failover",
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.03276334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"volumes_removed": false,
|
||||
"stopped_service": "api2",
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "3915ccdf8371c3bc6d5ddec5b8f9381324ba1369f0fb7117516499d5bafe223d",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.985374784Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api-tls": {
|
||||
"id": "3e51f064401ce49bea58cdd799174903ff247fd2bbbbf04994faabb4b0237877",
|
||||
"instance_id": "3e51f064401c",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.238611766Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "1720fbef0087cd23e3d46673123465eb542be176fbd4a8dd6c05a75fa73dd8e8",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": false,
|
||||
"started_at": "2026-11-26T19:52:36.03276334Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"api2-tls": {
|
||||
"id": "a8467e2307978d205c6618a685f79f6a556af71a3d4b208a823c433cc52ae720",
|
||||
"instance_id": "a8467e230797",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.244623235Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"cache": {
|
||||
"id": "86cd6caea8dcf218ecbf02d4e52a91e3f773c19725f06ed60b6ba602b0d24e2e",
|
||||
"instance_id": "86cd6caea8dc",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:30.600608669Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/redis",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"db": {
|
||||
"id": "ad35652344cd3320a48780d3d71d73acf49b13e269514d94377ab05d6b848eec",
|
||||
"instance_id": "ad35652344cd",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.590600075Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/postgres",
|
||||
"destination": "/var/lib/postgresql/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana": {
|
||||
"id": "3bf340ab10e025b96d416433dd61bd00afb4eaf539acdadbef539cc8c56d2ba1",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.590940472Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/grafana",
|
||||
"destination": "/var/lib/grafana",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"id": "ca10109e0837dc01138910c28ac67509213c62e1911b4360c9be18c9a1369e0e",
|
||||
"instance_id": "ca10109e0837",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.234181387Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"lb": {
|
||||
"id": "c710247c5c2507b69ce9f58f6ef8bbc652af8aab0176d94c6f97f1f5cdefa780",
|
||||
"instance_id": "c710247c5c25",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:41.611078892Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"loki": {
|
||||
"id": "9e71ff771066b2ba86d22dad3dcf4a7edcef574fde262e28272d18a93a382b92",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.583933169Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/loki",
|
||||
"destination": "/loki",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"loki-tls": {
|
||||
"id": "b9744aef675e4b1511a35bdf10a41a363b691b0353c19cf2d5c55bf10e660c0e",
|
||||
"instance_id": "b9744aef675e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.22998546Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"minio": {
|
||||
"id": "8eea616e277817e189406c98a7733ea1db4b9e2350def13f83aa22288cf2d93d",
|
||||
"instance_id": "8eea616e2778",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.588525279Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/minio",
|
||||
"destination": "/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"id": "23286dd776603669676fbd26018303fb33632a38b73a2ce61b6230d6ce8f7fdd",
|
||||
"instance_id": "23286dd77660",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:24.591406345Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/openbao",
|
||||
"destination": "/bao/data",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"otel-collector": {
|
||||
"id": "f00f9a2a5f7c3d0913eb00a312581f116223b5fcfd87fff75feaeb74ba38433e",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.494528165Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"otel-collector-tls": {
|
||||
"id": "6ec056668183e6578abdfb6344e8f0a3bab61478ea1a651bcf5e9062a11aef07",
|
||||
"instance_id": "6ec056668183",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.237501298Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"prometheus": {
|
||||
"id": "16bbe162f005de5e58ecd29184cbd9b06fa6adf86bea1c91c0ab3059b294a38f",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.540107996Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/prometheus",
|
||||
"destination": "/prometheus",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"prometheus-tls": {
|
||||
"id": "7b9124252b6ecbfd96fee0455820a677fe157e223d8a35e18a0ff66974d94470",
|
||||
"instance_id": "7b9124252b6e",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.23246679Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"tempo": {
|
||||
"id": "233524855b7b578f62ba4c608c78270ce3de010c9b747cb4c74d97a801bf388a",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.483755636Z",
|
||||
"data_mounts": [
|
||||
{
|
||||
"source": "/home/andrey/MTUCI/mtusi2026lab7/secrets/state/tempo",
|
||||
"destination": "/var/tempo",
|
||||
"rw": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"tempo-tls": {
|
||||
"id": "451e2b434aae2595370e38c11ed9c29458ecc7bb720010fc6801905ba441dfe4",
|
||||
"instance_id": "451e2b434aae",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:35.239737152Z",
|
||||
"data_mounts": []
|
||||
},
|
||||
"worker": {
|
||||
"id": "522cdaddd5b7343bc869ddde97d307d6a89ae256cd5cbdadc303fe8fc566b917",
|
||||
"instance_id": "522cdaddd5b7",
|
||||
"running": true,
|
||||
"started_at": "2026-11-26T19:52:36.224052958Z",
|
||||
"data_mounts": []
|
||||
}
|
||||
},
|
||||
"elapsed_seconds": 0.582
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"date": "2026-11-20",
|
||||
"runtime_context": "Diagnostic Compose; no-new-privileges removed only because host fails exec with this flag. Delivered compose.yaml requires it.",
|
||||
"live_containers_checked": 20,
|
||||
"published_ports": {
|
||||
"lb": {
|
||||
"443/tcp": [
|
||||
{
|
||||
"HostIp": "",
|
||||
"HostPort": "8443"
|
||||
}
|
||||
]
|
||||
},
|
||||
"grafana-tls": {
|
||||
"3000/tcp": [
|
||||
{
|
||||
"HostIp": "127.0.0.1",
|
||||
"HostPort": "3000"
|
||||
}
|
||||
]
|
||||
},
|
||||
"openbao": {
|
||||
"8200/tcp": [
|
||||
{
|
||||
"HostIp": "127.0.0.1",
|
||||
"HostPort": "8200"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tests": {
|
||||
"argon2id-parameters-verify-rehash": "PASS",
|
||||
"session-hash-at-rest-ttl-logout": "PASS",
|
||||
"tls-untrusted-ca": "PASS",
|
||||
"mtls-no-cert-both-api-replicas": "PASS",
|
||||
"mtls-wrong-san-both-api-replicas": "PASS",
|
||||
"mtls-foreign-ca-both-api-replicas": "PASS",
|
||||
"shared-rate-limit-two-api-replicas": "PASS",
|
||||
"collector-mtls-identity": "PASS",
|
||||
"openbao-policy-allow-deny": "PASS",
|
||||
"worker-db-redis-s3-acl": "PASS",
|
||||
"credential-rotation-old-denied-new-allowed": "PASS",
|
||||
"sealed-bao-fail-closed": "PASS",
|
||||
"telemetry-delivery-mtls": "PASS",
|
||||
"public-https-smoke": "PASS",
|
||||
"public-tls-security": "PASS",
|
||||
"pki-offline-san-crl": "PASS",
|
||||
"pki-live-renewal-revocation-expiry": "PASS",
|
||||
"source-contract-openapi-validation": "PASS",
|
||||
"static-container-hardening": "PASS",
|
||||
"source-secret-leak-check": "PASS"
|
||||
},
|
||||
"not_verified": [
|
||||
"Full hardening runtime with no-new-privileges on a repaired host",
|
||||
"all infrastructure image scans",
|
||||
"source C++ dependency SBOM",
|
||||
"CA rollover",
|
||||
"long max-TTL/outage/load soak",
|
||||
"independent failover/persistence resilience suite"
|
||||
],
|
||||
"pki_load": {
|
||||
"ok": 77,
|
||||
"errors": 3,
|
||||
"first_failure_seconds": 1.33,
|
||||
"recovered_seconds": 2.095,
|
||||
"elapsed_seconds": 22.117
|
||||
},
|
||||
"final_state": "Diagnostic containers/networks and diagnostic compose removed; persistent bind data/secrets/PKI preserved; cron installed; delivered compose remains hardened."
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_8080
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 8080
|
||||
name: local_8080
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 8443
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_8080
|
||||
stat_prefix: local_8080
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/api.crt
|
||||
private_key:
|
||||
filename: /identity/api.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: client-api
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_8443
|
||||
@@ -0,0 +1,40 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_13000
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 13000
|
||||
name: local_13000
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 3000
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_13000
|
||||
stat_prefix: local_13000
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/grafana.crt
|
||||
private_key:
|
||||
filename: /identity/grafana.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
require_client_certificate: false
|
||||
name: tls_3000
|
||||
@@ -0,0 +1,52 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_13100
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 13100
|
||||
name: local_13100
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 3100
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_13100
|
||||
stat_prefix: local_13100
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/loki.crt
|
||||
private_key:
|
||||
filename: /identity/loki.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: otel-collector
|
||||
san_type: DNS
|
||||
- matcher:
|
||||
exact: grafana
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_3100
|
||||
@@ -0,0 +1,98 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_14318
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 14318
|
||||
name: local_14318
|
||||
type: STATIC
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_19464
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 19464
|
||||
name: local_19464
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 4318
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_14318
|
||||
stat_prefix: local_14318
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/otel-collector.crt
|
||||
private_key:
|
||||
filename: /identity/otel-collector.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: api
|
||||
san_type: DNS
|
||||
- matcher:
|
||||
exact: worker
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_4318
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 9464
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_19464
|
||||
stat_prefix: local_19464
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/otel-collector.crt
|
||||
private_key:
|
||||
filename: /identity/otel-collector.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: prometheus
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_9464
|
||||
@@ -0,0 +1,49 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_19090
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 19090
|
||||
name: local_19090
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 9090
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_19090
|
||||
stat_prefix: local_19090
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/prometheus.crt
|
||||
private_key:
|
||||
filename: /identity/prometheus.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: grafana
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_9090
|
||||
@@ -0,0 +1,95 @@
|
||||
static_resources:
|
||||
clusters:
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_14318
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 14318
|
||||
name: local_14318
|
||||
type: STATIC
|
||||
- connect_timeout: 3s
|
||||
load_assignment:
|
||||
cluster_name: local_13200
|
||||
endpoints:
|
||||
- lb_endpoints:
|
||||
- endpoint:
|
||||
address:
|
||||
socket_address:
|
||||
address: 127.0.0.1
|
||||
port_value: 13200
|
||||
name: local_13200
|
||||
type: STATIC
|
||||
listeners:
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 4318
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_14318
|
||||
stat_prefix: local_14318
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/tempo.crt
|
||||
private_key:
|
||||
filename: /identity/tempo.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: otel-collector
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_4318
|
||||
- address:
|
||||
socket_address:
|
||||
address: 0.0.0.0
|
||||
port_value: 3200
|
||||
filter_chains:
|
||||
- filters:
|
||||
- name: envoy.filters.network.tcp_proxy
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
|
||||
cluster: local_13200
|
||||
stat_prefix: local_13200
|
||||
transport_socket:
|
||||
name: envoy.transport_sockets.tls
|
||||
typed_config:
|
||||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
||||
common_tls_context:
|
||||
tls_certificates:
|
||||
- certificate_chain:
|
||||
filename: /identity/tempo.crt
|
||||
private_key:
|
||||
filename: /identity/tempo.key
|
||||
tls_params:
|
||||
tls_minimum_protocol_version: TLSv1_2
|
||||
validation_context:
|
||||
crl:
|
||||
filename: /pki/ca.crl
|
||||
match_typed_subject_alt_names:
|
||||
- matcher:
|
||||
exact: grafana
|
||||
san_type: DNS
|
||||
trusted_ca:
|
||||
filename: /pki/ca.crt
|
||||
require_client_certificate: true
|
||||
name: tls_3200
|
||||
@@ -0,0 +1,485 @@
|
||||
{
|
||||
"uid": "messenger-observability",
|
||||
"title": "Messenger — Observability",
|
||||
"schemaVersion": 40,
|
||||
"version": 1,
|
||||
"refresh": "5s",
|
||||
"time": {
|
||||
"from": "now-15m",
|
||||
"to": "now"
|
||||
},
|
||||
"panels": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "API RPS (business requests)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum by(http_route)(rate(http_server_requests_total[$__rate_interval]))",
|
||||
"legendFormat": "{{http_route}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "reqps"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "API p50 / p95 / p99 (all replicas)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 0,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "histogram_quantile(0.5, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p50"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "histogram_quantile(0.95, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p95"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "histogram_quantile(0.99, sum by(le)(rate(http_server_request_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p99"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "API error rate (5xx / all business requests)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "(sum(rate(http_server_requests_total{http_response_status_class=\"5xx\"}[$__rate_interval])) or vector(0)) / clamp_min(sum(rate(http_server_requests_total[$__rate_interval])),0.001)",
|
||||
"legendFormat": "5xx ratio"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percentunit"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"title": "Queue depth (durable outstanding jobs)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 8,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "max(queue_depth)",
|
||||
"legendFormat": "jobs"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"title": "Oldest outstanding job / observation age",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "max(queue_oldest_age)",
|
||||
"legendFormat": "oldest"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "time()-max(queue_observation_timestamp)",
|
||||
"legendFormat": "observation age"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"title": "Worker saturation (busy / capacity)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 16,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum(worker_busy) / clamp_min(sum(worker_capacity),1)",
|
||||
"legendFormat": "saturation"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "percentunit"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"title": "Worker outcomes per second",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 24,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum by(outcome)(rate(worker_jobs_total[$__rate_interval]))",
|
||||
"legendFormat": "{{outcome}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "ops"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"title": "Worker p50 / p95 / p99",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 24,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "histogram_quantile(0.5,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p50"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "histogram_quantile(0.95,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p95"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "histogram_quantile(0.99,sum by(le)(rate(worker_job_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p99"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"title": "DB pools (application + outbox)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 32,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum(db_pool_used)",
|
||||
"legendFormat": "used"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "sum(db_pool_waiting)",
|
||||
"legendFormat": "waiting"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "sum(db_pool_capacity)",
|
||||
"legendFormat": "capacity"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"title": "Acceptance to ready p50 / p95 / p99",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 32,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "histogram_quantile(0.5,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p50"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p95"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "histogram_quantile(0.99,sum by(le)(rate(attachment_ready_duration_seconds_bucket[$__rate_interval])))",
|
||||
"legendFormat": "p99"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "s"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"title": "Process resident memory",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 40,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "process_memory_usage",
|
||||
"legendFormat": "{{service_name}} / {{service_instance_id}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "bytes"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"title": "Process CPU (cores)",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 40,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(process_cpu_time[$__rate_interval])",
|
||||
"legendFormat": "{{service_name}} / {{service_instance_id}}"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"title": "Collector rejected/failed signal export",
|
||||
"type": "timeseries",
|
||||
"gridPos": {
|
||||
"x": 0,
|
||||
"y": 48,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "sum(rate(otelcol_exporter_send_failed_spans[$__rate_interval]))",
|
||||
"legendFormat": "exporter_send_failed_spans"
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"expr": "sum(rate(otelcol_exporter_send_failed_log_records[$__rate_interval]))",
|
||||
"legendFormat": "exporter_send_failed_log_records"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"expr": "sum(rate(otelcol_processor_refused_spans[$__rate_interval]))",
|
||||
"legendFormat": "processor_refused_spans"
|
||||
},
|
||||
{
|
||||
"refId": "D",
|
||||
"expr": "sum(rate(otelcol_exporter_enqueue_failed_spans[$__rate_interval]))",
|
||||
"legendFormat": "exporter_enqueue_failed_spans"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"title": "Correlated application events",
|
||||
"type": "logs",
|
||||
"gridPos": {
|
||||
"x": 12,
|
||||
"y": 48,
|
||||
"w": 12,
|
||||
"h": 8
|
||||
},
|
||||
"datasource": {
|
||||
"type": "loki",
|
||||
"uid": "loki"
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "{service_name=~\"messenger-api|messenger-worker\"}",
|
||||
"legendFormat": "logs"
|
||||
}
|
||||
],
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "short"
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"lab6"
|
||||
],
|
||||
"annotations": {
|
||||
"list": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
apiVersion: 1
|
||||
providers:
|
||||
- name: messenger
|
||||
folder: Messenger
|
||||
type: file
|
||||
options:
|
||||
path: /var/lib/grafana/dashboards
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"apiVersion": 1,
|
||||
"datasources": [
|
||||
{
|
||||
"access": "proxy",
|
||||
"isDefault": true,
|
||||
"jsonData": {
|
||||
"serverName": "prometheus",
|
||||
"tlsAuth": true,
|
||||
"tlsAuthWithCACert": true
|
||||
},
|
||||
"name": "Prometheus",
|
||||
"secureJsonData": {
|
||||
"tlsCACert": "$__file{/pki/ca.crt}",
|
||||
"tlsClientCert": "$__file{/identity/grafana.crt}",
|
||||
"tlsClientKey": "$__file{/identity/grafana.key}"
|
||||
},
|
||||
"type": "prometheus",
|
||||
"uid": "prometheus",
|
||||
"url": "https://prometheus-tls:9090"
|
||||
},
|
||||
{
|
||||
"access": "proxy",
|
||||
"jsonData": {
|
||||
"derivedFields": [
|
||||
{
|
||||
"datasourceUid": "tempo",
|
||||
"matcherRegex": "trace_id",
|
||||
"matcherType": "label",
|
||||
"name": "TraceID",
|
||||
"url": "$${__value.raw}"
|
||||
}
|
||||
],
|
||||
"serverName": "loki",
|
||||
"tlsAuth": true,
|
||||
"tlsAuthWithCACert": true
|
||||
},
|
||||
"name": "Loki",
|
||||
"secureJsonData": {
|
||||
"tlsCACert": "$__file{/pki/ca.crt}",
|
||||
"tlsClientCert": "$__file{/identity/grafana.crt}",
|
||||
"tlsClientKey": "$__file{/identity/grafana.key}"
|
||||
},
|
||||
"type": "loki",
|
||||
"uid": "loki",
|
||||
"url": "https://loki-tls:3100"
|
||||
},
|
||||
{
|
||||
"access": "proxy",
|
||||
"jsonData": {
|
||||
"serverName": "tempo",
|
||||
"tlsAuth": true,
|
||||
"tlsAuthWithCACert": true,
|
||||
"tracesToLogsV2": {
|
||||
"datasourceUid": "loki",
|
||||
"filterBySpanID": true,
|
||||
"filterByTraceID": true,
|
||||
"spanEndTimeShift": "1m",
|
||||
"spanStartTimeShift": "-1m",
|
||||
"tags": [
|
||||
{
|
||||
"key": "service.name",
|
||||
"value": "service_name"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "Tempo",
|
||||
"secureJsonData": {
|
||||
"tlsCACert": "$__file{/pki/ca.crt}",
|
||||
"tlsClientCert": "$__file{/identity/grafana.crt}",
|
||||
"tlsClientKey": "$__file{/identity/grafana.key}"
|
||||
},
|
||||
"type": "tempo",
|
||||
"uid": "tempo",
|
||||
"url": "https://tempo-tls:3200"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
analytics:
|
||||
reporting_enabled: false
|
||||
auth_enabled: false
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /loki
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /loki/chunks
|
||||
rules_directory: /loki/rules
|
||||
compactor:
|
||||
delete_request_store: filesystem
|
||||
retention_enabled: true
|
||||
working_directory: /loki/compactor
|
||||
limits_config:
|
||||
allow_structured_metadata: true
|
||||
retention_period: 168h
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2024-01-01
|
||||
index:
|
||||
period: 24h
|
||||
prefix: index_
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
store: tsdb
|
||||
server:
|
||||
grpc_listen_address: 127.0.0.1
|
||||
http_listen_address: 127.0.0.1
|
||||
http_listen_port: 13100
|
||||
@@ -0,0 +1,21 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Local MinIO Client (mc) from the official GitHub release binary (pinned).
|
||||
# Fallback when docker.io/minio/mc cannot be pulled.
|
||||
FROM ubuntu:24.04 AS runtime
|
||||
|
||||
ARG MC_VERSION=RELEASE.2025-04-16T18-13-26Z
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl \
|
||||
&& curl -fsSL -o /tmp/mc.bin \
|
||||
"https://github.com/minio/mc/releases/download/${MC_VERSION}/mc.linux-amd64.${MC_VERSION}" \
|
||||
&& curl -fsSL -o /tmp/mc.sha256sum \
|
||||
"https://github.com/minio/mc/releases/download/${MC_VERSION}/mc.linux-amd64.${MC_VERSION}.sha256sum" \
|
||||
&& expected="$(awk '{print $1}' /tmp/mc.sha256sum)" \
|
||||
&& echo "${expected} /tmp/mc.bin" | sha256sum -c - \
|
||||
&& install -m 0755 /tmp/mc.bin /usr/local/bin/mc \
|
||||
&& rm -f /tmp/mc.bin /tmp/mc.sha256sum \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
USER 10001:10001
|
||||
ENTRYPOINT ["mc"]
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
mkdir -p "$MC_CONFIG_DIR/certs/CAs"
|
||||
cp /pki/ca.crt "$MC_CONFIG_DIR/certs/CAs/ca.crt"
|
||||
exec /bin/sh "$@"
|
||||
@@ -0,0 +1,24 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Local MinIO image from the official GitHub release binary (pinned).
|
||||
# Fallback when docker.io/minio/minio cannot be pulled.
|
||||
FROM ubuntu:24.04 AS runtime
|
||||
|
||||
ARG MINIO_VERSION=RELEASE.2025-04-22T22-12-26Z
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl \
|
||||
&& curl -fsSL -o /tmp/minio.bin \
|
||||
"https://github.com/minio/minio/releases/download/${MINIO_VERSION}/minio.linux-amd64.${MINIO_VERSION}" \
|
||||
&& curl -fsSL -o /tmp/minio.sha256sum \
|
||||
"https://github.com/minio/minio/releases/download/${MINIO_VERSION}/minio.linux-amd64.${MINIO_VERSION}.sha256sum" \
|
||||
&& expected="$(awk '{print $1}' /tmp/minio.sha256sum)" \
|
||||
&& echo "${expected} /tmp/minio.bin" | sha256sum -c - \
|
||||
&& install -m 0755 /tmp/minio.bin /usr/local/bin/minio \
|
||||
&& rm -f /tmp/minio.bin /tmp/minio.sha256sum \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
VOLUME ["/data"]
|
||||
EXPOSE 9000 9001
|
||||
USER 10001:10001
|
||||
ENTRYPOINT ["minio"]
|
||||
CMD ["server", "/data", "--console-address", ":9001"]
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:ListBucketMultipartUploads",
|
||||
"s3:GetBucketLocation",
|
||||
"s3:ListBucket"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::__S3_BUCKET__"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:PutObject",
|
||||
"s3:GetObject",
|
||||
"s3:DeleteObject",
|
||||
"s3:AbortMultipartUpload",
|
||||
"s3:ListMultipartUploadParts"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::__S3_BUCKET__/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
path "database/creds/api-role" { capabilities=["read"] }
|
||||
path "secret/data/api" { capabilities=["read"] }
|
||||
path "sys/leases/renew" { capabilities=["update"] }
|
||||
path "auth/token/renew-self" { capabilities=["update"] }
|
||||
path "auth/token/revoke-self" { capabilities=["update"] }
|
||||
@@ -0,0 +1,9 @@
|
||||
ui = false
|
||||
api_addr = "https://openbao:8200"
|
||||
storage "file" { path = "/bao/data" }
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:8200"
|
||||
tls_cert_file = "/identity/openbao.crt"
|
||||
tls_key_file = "/identity/openbao.key"
|
||||
tls_min_version = "tls12"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
path "database/creds/worker-role" { capabilities=["read"] }
|
||||
path "secret/data/worker" { capabilities=["read"] }
|
||||
path "sys/leases/renew" { capabilities=["update"] }
|
||||
path "auth/token/renew-self" { capabilities=["update"] }
|
||||
path "auth/token/revoke-self" { capabilities=["update"] }
|
||||
@@ -0,0 +1,62 @@
|
||||
exporters:
|
||||
otlphttp/loki:
|
||||
endpoint: https://loki-tls:3100/otlp
|
||||
timeout: 3s
|
||||
tls:
|
||||
ca_file: /pki/ca.crt
|
||||
cert_file: /identity/otel-collector.crt
|
||||
key_file: /identity/otel-collector.key
|
||||
server_name_override: loki
|
||||
otlphttp/tempo:
|
||||
endpoint: https://tempo-tls:4318
|
||||
timeout: 3s
|
||||
tls:
|
||||
ca_file: /pki/ca.crt
|
||||
cert_file: /identity/otel-collector.crt
|
||||
key_file: /identity/otel-collector.key
|
||||
server_name_override: tempo
|
||||
prometheus:
|
||||
endpoint: 127.0.0.1:19464
|
||||
resource_to_telemetry_conversion:
|
||||
enabled: true
|
||||
processors:
|
||||
batch:
|
||||
timeout: 1s
|
||||
memory_limiter:
|
||||
check_interval: 1s
|
||||
limit_mib: 192
|
||||
spike_limit_mib: 32
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
http:
|
||||
endpoint: 127.0.0.1:14318
|
||||
service:
|
||||
pipelines:
|
||||
logs:
|
||||
exporters:
|
||||
- otlphttp/loki
|
||||
processors:
|
||||
- memory_limiter
|
||||
- batch
|
||||
receivers:
|
||||
- otlp
|
||||
metrics:
|
||||
exporters:
|
||||
- prometheus
|
||||
processors:
|
||||
- memory_limiter
|
||||
- batch
|
||||
receivers:
|
||||
- otlp
|
||||
traces:
|
||||
exporters:
|
||||
- otlphttp/tempo
|
||||
processors:
|
||||
- memory_limiter
|
||||
- batch
|
||||
receivers:
|
||||
- otlp
|
||||
telemetry:
|
||||
metrics:
|
||||
level: none
|
||||
@@ -0,0 +1,3 @@
|
||||
local all all trust
|
||||
hostssl messenger all 0.0.0.0/0 scram-sha-256 clientcert=verify-ca
|
||||
host all all 0.0.0.0/0 reject
|
||||
@@ -0,0 +1,27 @@
|
||||
groups:
|
||||
- name: messenger-slo
|
||||
rules:
|
||||
- alert: ApiHighErrorRate
|
||||
expr: (sum(rate(http_server_requests_total{http_response_status_class="5xx"}[1m])) or vector(0)) / clamp_min(sum(rate(http_server_requests_total[1m])), 0.001) > 0.05
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: API 5xx ratio above 5% for 30 seconds (1 minute window)
|
||||
description: Check server spans, postgresql.pool.acquire and DB pool metrics. Runbook in REPORT.md.
|
||||
- alert: QueueLagGrowing
|
||||
expr: max(queue_oldest_age) > 30 and max(queue_depth) > 0 and max(delta(queue_oldest_age[1m])) > 0
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: Durable backlog is ageing beyond 30 seconds
|
||||
description: Check worker capacity/busy, worker logs and Redis/DB/S3 spans. Runbook in REPORT.md.
|
||||
- alert: QueueObservationStale
|
||||
expr: time() - max(queue_observation_timestamp) > 30 or absent(queue_observation_timestamp)
|
||||
for: 30s
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: Queue observer unavailable
|
||||
description: Queue values may be stale; check PostgreSQL and API observer logs.
|
||||
@@ -0,0 +1,15 @@
|
||||
global:
|
||||
scrape_interval: 5s
|
||||
rule_files:
|
||||
- /etc/prometheus/alerts.yaml
|
||||
scrape_configs:
|
||||
- job_name: messenger
|
||||
scheme: https
|
||||
static_configs:
|
||||
- targets:
|
||||
- otel-collector-tls:9464
|
||||
tls_config:
|
||||
ca_file: /pki/ca.crt
|
||||
cert_file: /identity/prometheus.crt
|
||||
key_file: /identity/prometheus.key
|
||||
server_name: otel-collector
|
||||
@@ -0,0 +1,11 @@
|
||||
port 0
|
||||
tls-port 6379
|
||||
tls-cert-file /identity/redis.crt
|
||||
tls-key-file /identity/redis.key
|
||||
tls-ca-cert-file /pki/ca.crt
|
||||
tls-auth-clients yes
|
||||
tls-protocols "TLSv1.2 TLSv1.3"
|
||||
aclfile /run/redis/users.acl
|
||||
appendonly yes
|
||||
appendfsync always
|
||||
dir /data
|
||||
@@ -0,0 +1,24 @@
|
||||
compactor:
|
||||
compaction:
|
||||
block_retention: 168h
|
||||
distributor:
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
http:
|
||||
endpoint: 127.0.0.1:14318
|
||||
ingester:
|
||||
max_block_duration: 5m
|
||||
server:
|
||||
grpc_listen_address: 127.0.0.1
|
||||
http_listen_address: 127.0.0.1
|
||||
http_listen_port: 13200
|
||||
storage:
|
||||
trace:
|
||||
backend: local
|
||||
local:
|
||||
path: /var/tempo/blocks
|
||||
wal:
|
||||
path: /var/tempo/wal
|
||||
usage_report:
|
||||
reporting_enabled: false
|
||||
@@ -0,0 +1,50 @@
|
||||
pid /tmp/nginx.pid;
|
||||
worker_processes 1;
|
||||
error_log /dev/stderr warn;
|
||||
events { worker_connections 1024; }
|
||||
http {
|
||||
access_log off;
|
||||
client_body_temp_path /tmp/client_temp;
|
||||
proxy_temp_path /tmp/proxy_temp;
|
||||
fastcgi_temp_path /tmp/fastcgi_temp;
|
||||
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||
scgi_temp_path /tmp/scgi_temp;
|
||||
client_max_body_size 11m;
|
||||
client_header_timeout 10s;
|
||||
client_body_timeout 30s;
|
||||
upstream api_pool { server api-tls:8443; server api2-tls:8443; }
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name localhost;
|
||||
ssl_certificate /identity/lb.crt;
|
||||
ssl_certificate_key /identity/lb.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
location /attachments/ {
|
||||
# Upstream errors can contain SigV4 query credentials. Never log these URLs.
|
||||
error_log /dev/null crit;
|
||||
proxy_pass https://minio:9000;
|
||||
proxy_ssl_trusted_certificate /pki/ca.crt;
|
||||
proxy_ssl_verify on;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_ssl_name minio;
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
location / {
|
||||
proxy_pass https://api_pool;
|
||||
proxy_ssl_certificate /lb-client/client-api.crt;
|
||||
proxy_ssl_certificate_key /lb-client/client-api.key;
|
||||
proxy_ssl_trusted_certificate /pki/ca.crt;
|
||||
proxy_ssl_crl /pki/ca.crl;
|
||||
proxy_ssl_verify on;
|
||||
proxy_ssl_verify_depth 2;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_ssl_name api;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_connect_timeout 3s;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
CREATE TABLE users (
|
||||
id uuid PRIMARY KEY,
|
||||
username text NOT NULL UNIQUE
|
||||
CHECK (username ~ '^[a-z0-9_]{3,32}$'),
|
||||
display_name text NOT NULL,
|
||||
password_hash text NOT NULL,
|
||||
created_at timestamptz NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE chats (
|
||||
id uuid PRIMARY KEY,
|
||||
title text NOT NULL,
|
||||
created_at timestamptz NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE chat_members (
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (chat_id, user_id)
|
||||
);
|
||||
|
||||
CREATE INDEX chat_members_user_idx ON chat_members(user_id);
|
||||
|
||||
CREATE TABLE messages (
|
||||
id uuid PRIMARY KEY,
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
sender_id uuid NOT NULL REFERENCES users(id),
|
||||
text text NOT NULL,
|
||||
created_at timestamptz NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX messages_chat_keyset_idx
|
||||
ON messages (chat_id, created_at, id);
|
||||
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE sessions (
|
||||
token text PRIMARY KEY,
|
||||
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
expires_at timestamptz NOT NULL
|
||||
);
|
||||
CREATE INDEX sessions_expires_at_idx ON sessions (expires_at);
|
||||
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE idempotency_keys (
|
||||
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
|
||||
request_hash text NOT NULL,
|
||||
message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (user_id, chat_id, key)
|
||||
);
|
||||
|
||||
CREATE INDEX idempotency_keys_created_at_idx ON idempotency_keys (created_at);
|
||||
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE attachments (
|
||||
id uuid PRIMARY KEY,
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
owner_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
filename text NOT NULL
|
||||
CHECK (char_length(filename) BETWEEN 1 AND 255),
|
||||
content_type text NOT NULL
|
||||
CHECK (content_type IN ('image/png', 'image/jpeg')),
|
||||
size_bytes integer NOT NULL
|
||||
CHECK (size_bytes >= 1 AND size_bytes <= 10485760),
|
||||
sha256 text NOT NULL
|
||||
CHECK (sha256 ~ '^[a-f0-9]{64}$'),
|
||||
status text NOT NULL
|
||||
CHECK (status IN ('ready')),
|
||||
s3_key text NOT NULL UNIQUE,
|
||||
error_code text NULL,
|
||||
created_at timestamptz NOT NULL,
|
||||
updated_at timestamptz NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX attachments_chat_id_idx ON attachments (chat_id);
|
||||
CREATE INDEX attachments_created_at_idx ON attachments (created_at);
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE message_attachments (
|
||||
message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
|
||||
attachment_id uuid NOT NULL REFERENCES attachments(id),
|
||||
position integer NOT NULL CHECK (position >= 0 AND position < 10),
|
||||
PRIMARY KEY (message_id, attachment_id)
|
||||
);
|
||||
|
||||
CREATE INDEX message_attachments_attachment_idx
|
||||
ON message_attachments (attachment_id);
|
||||
|
||||
CREATE UNIQUE INDEX message_attachments_order_idx
|
||||
ON message_attachments (message_id, position);
|
||||
@@ -0,0 +1,26 @@
|
||||
-- Track 1 (grade 5): pending direct/presigned upload sessions.
|
||||
-- Attachment rows stay status=ready only; incomplete uploads live here.
|
||||
CREATE TABLE direct_uploads (
|
||||
id uuid PRIMARY KEY,
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
owner_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
filename text NOT NULL
|
||||
CHECK (char_length(filename) BETWEEN 1 AND 255),
|
||||
content_type text NOT NULL
|
||||
CHECK (content_type IN ('image/png', 'image/jpeg')),
|
||||
expected_size integer NOT NULL
|
||||
CHECK (expected_size >= 1 AND expected_size <= 10485760),
|
||||
expected_sha256 text NOT NULL
|
||||
CHECK (expected_sha256 ~ '^[a-f0-9]{64}$'),
|
||||
s3_key text NOT NULL UNIQUE,
|
||||
status text NOT NULL
|
||||
CHECK (status IN ('pending', 'completed', 'aborted', 'expired')),
|
||||
attachment_id uuid NULL REFERENCES attachments(id),
|
||||
expires_at timestamptz NOT NULL,
|
||||
created_at timestamptz NOT NULL,
|
||||
updated_at timestamptz NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX direct_uploads_status_expires_idx
|
||||
ON direct_uploads (status, expires_at);
|
||||
CREATE INDEX direct_uploads_owner_idx ON direct_uploads (owner_id);
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Track 1: presigned PUT lands in staging/; complete copies to attachments/.
|
||||
-- Existing rows keep the old key as staging so in-flight sessions still resolve.
|
||||
ALTER TABLE direct_uploads ADD COLUMN staging_key text;
|
||||
|
||||
UPDATE direct_uploads
|
||||
SET staging_key = s3_key
|
||||
WHERE staging_key IS NULL;
|
||||
|
||||
ALTER TABLE direct_uploads ALTER COLUMN staging_key SET NOT NULL;
|
||||
|
||||
ALTER TABLE direct_uploads
|
||||
ADD CONSTRAINT direct_uploads_staging_key_key UNIQUE (staging_key);
|
||||
@@ -0,0 +1,21 @@
|
||||
-- Keep existing lab4 originals ready; new jobs set queued explicitly.
|
||||
ALTER TABLE attachments DROP CONSTRAINT attachments_status_check;
|
||||
ALTER TABLE attachments
|
||||
ADD CONSTRAINT attachments_status_check
|
||||
CHECK (status IN ('queued', 'processing', 'ready', 'failed')),
|
||||
ADD COLUMN variants jsonb NOT NULL DEFAULT '[]'::jsonb
|
||||
CHECK (jsonb_typeof(variants) = 'array');
|
||||
|
||||
CREATE TABLE jobs (
|
||||
id uuid PRIMARY KEY,
|
||||
attachment_id uuid NOT NULL UNIQUE
|
||||
REFERENCES attachments(id) ON DELETE CASCADE,
|
||||
status text NOT NULL DEFAULT 'queued'
|
||||
CHECK (status IN ('queued', 'processing', 'ready', 'failed')),
|
||||
retries integer NOT NULL DEFAULT 0 CHECK (retries >= 0),
|
||||
error_code text,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX jobs_status_created_at_idx ON jobs (status, created_at);
|
||||
@@ -0,0 +1,20 @@
|
||||
ALTER TABLE jobs ADD COLUMN next_attempt_at timestamptz NOT NULL DEFAULT now();
|
||||
|
||||
CREATE TABLE outbox (
|
||||
id bigserial PRIMARY KEY,
|
||||
payload jsonb NOT NULL CHECK (jsonb_typeof(payload) = 'object'),
|
||||
published boolean NOT NULL DEFAULT false,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
available_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX outbox_pending_idx ON outbox (available_at, id) WHERE NOT published;
|
||||
|
||||
-- Upgrade jobs accepted before outbox existed; duplicates are safe.
|
||||
INSERT INTO outbox (payload, available_at)
|
||||
SELECT jsonb_build_object(
|
||||
'schema_version', 1, 'type', 'attachment.process.v1',
|
||||
'job_id', id::text, 'attachment_id', attachment_id::text,
|
||||
'pipeline_version', 1, 'attempt', retries + 1,
|
||||
'created_at', to_char(created_at AT TIME ZONE 'UTC', 'YYYY-MM-DD"T"HH24:MI:SS"Z"')
|
||||
), next_attempt_at FROM jobs WHERE status IN ('queued', 'processing');
|
||||
@@ -0,0 +1,22 @@
|
||||
ALTER TABLE attachments
|
||||
ADD COLUMN staging_key text,
|
||||
ADD COLUMN staging_cleaned_at timestamptz;
|
||||
|
||||
UPDATE attachments a SET staging_key='staging/' || a.chat_id::text || '/' || a.id::text
|
||||
WHERE EXISTS (SELECT 1 FROM jobs j WHERE j.attachment_id=a.id);
|
||||
|
||||
CREATE INDEX attachments_staging_cleanup_idx ON attachments(status, updated_at)
|
||||
WHERE staging_key IS NOT NULL AND staging_cleaned_at IS NULL;
|
||||
|
||||
ALTER TABLE jobs ADD COLUMN retry_base integer NOT NULL DEFAULT 0
|
||||
CHECK (retry_base >= 0 AND retry_base <= retries);
|
||||
|
||||
CREATE TABLE job_replays (
|
||||
id bigserial PRIMARY KEY,
|
||||
job_id uuid NOT NULL REFERENCES jobs(id),
|
||||
actor text NOT NULL CHECK (char_length(actor) BETWEEN 1 AND 100),
|
||||
reason text NOT NULL CHECK (char_length(reason) BETWEEN 1 AND 500),
|
||||
previous_error_code text,
|
||||
retries_before integer NOT NULL CHECK (retries_before >= 0),
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
@@ -0,0 +1,41 @@
|
||||
ALTER TABLE attachments
|
||||
ADD COLUMN pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version > 0),
|
||||
ADD COLUMN published_version integer CHECK (published_version > 0),
|
||||
ADD CONSTRAINT attachments_version_order CHECK (published_version <= pipeline_version);
|
||||
UPDATE attachments SET published_version=1 WHERE status='ready';
|
||||
|
||||
ALTER TABLE jobs
|
||||
ADD COLUMN pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version > 0),
|
||||
ADD COLUMN source_key text;
|
||||
UPDATE jobs j SET source_key=a.s3_key FROM attachments a WHERE a.id=j.attachment_id;
|
||||
ALTER TABLE jobs ALTER COLUMN source_key SET NOT NULL;
|
||||
ALTER TABLE jobs DROP CONSTRAINT jobs_attachment_id_key;
|
||||
ALTER TABLE jobs ADD CONSTRAINT jobs_attachment_version_key UNIQUE (attachment_id, pipeline_version);
|
||||
ALTER TABLE jobs DROP CONSTRAINT jobs_status_check;
|
||||
ALTER TABLE jobs ADD CONSTRAINT jobs_status_check
|
||||
CHECK (status IN ('queued','processing','ready','failed','superseded'));
|
||||
|
||||
-- One immutable logical result per (attachment, pipeline version).
|
||||
CREATE TABLE attachment_results (
|
||||
attachment_id uuid NOT NULL REFERENCES attachments(id) ON DELETE CASCADE,
|
||||
pipeline_version integer NOT NULL CHECK (pipeline_version > 0),
|
||||
job_id uuid UNIQUE REFERENCES jobs(id),
|
||||
original_key text NOT NULL,
|
||||
variants jsonb NOT NULL CHECK (jsonb_typeof(variants)='array'),
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (attachment_id, pipeline_version)
|
||||
);
|
||||
INSERT INTO attachment_results(attachment_id,pipeline_version,job_id,original_key,variants)
|
||||
SELECT a.id,1,j.id,a.s3_key,a.variants FROM attachments a
|
||||
LEFT JOIN jobs j ON j.attachment_id=a.id AND j.pipeline_version=1 WHERE a.status='ready';
|
||||
|
||||
CREATE TABLE pipeline_requests (
|
||||
id bigserial PRIMARY KEY,
|
||||
attachment_id uuid NOT NULL REFERENCES attachments(id),
|
||||
pipeline_version integer NOT NULL CHECK (pipeline_version > 0),
|
||||
job_id uuid NOT NULL UNIQUE REFERENCES jobs(id),
|
||||
actor text NOT NULL CHECK (char_length(actor) BETWEEN 1 AND 100),
|
||||
reason text NOT NULL CHECK (char_length(reason) BETWEEN 1 AND 500),
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
UNIQUE(attachment_id,pipeline_version)
|
||||
);
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
umask 077
|
||||
exec python3 scripts/bootstrap_openbao.py "$@"
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
umask 077
|
||||
export PKI_DIR="${PKI_DIR:-$PWD/certs}"
|
||||
export CA_DIR="${CA_DIR:-$PWD/secrets/operator/ca}"
|
||||
mkdir -p "$PKI_DIR" "$CA_DIR/newcerts"
|
||||
exec 8> "$CA_DIR/ca.lock"
|
||||
flock 8
|
||||
if [[ ! -f "$CA_DIR/ca.key" ]]; then
|
||||
if [[ -e "$CA_DIR/active" || -L "$CA_DIR/active" || -e "$PKI_DIR/ca.crt" || -L "$PKI_DIR/ca.crt" ]]; then
|
||||
echo 'CA state exists but its signing key is missing; restore it explicitly, never silently regenerate trust.' >&2
|
||||
exit 1
|
||||
fi
|
||||
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -out "$CA_DIR/ca.key" 2>/dev/null
|
||||
openssl req -new -x509 -sha256 -days 3650 -key "$CA_DIR/ca.key" -out "$PKI_DIR/ca.crt" -subj /CN=Lab7-Root-CA -addext basicConstraints=critical,CA:true -addext keyUsage=critical,keyCertSign,cRLSign
|
||||
touch "$CA_DIR/index.txt"
|
||||
echo 1000 > "$CA_DIR/serial"
|
||||
echo 1000 > "$CA_DIR/crlnumber"
|
||||
fi
|
||||
python3 scripts/pki_state.py init
|
||||
|
||||
issue() {
|
||||
local name="$1" san="$2" usage="$3"
|
||||
local dir="$PKI_DIR/$name"
|
||||
mkdir -p "$dir"
|
||||
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "$dir/$name.key.next" 2>/dev/null
|
||||
openssl req -new -key "$dir/$name.key.next" -out "$dir/request.csr" -subj "/CN=$name"
|
||||
cat > "$dir/extensions.cnf" <<EOF
|
||||
basicConstraints=critical,CA:false
|
||||
keyUsage=critical,digitalSignature,keyEncipherment
|
||||
extendedKeyUsage=$usage
|
||||
subjectAltName=$san
|
||||
EOF
|
||||
openssl ca -batch -notext -config "$CA_DIR/openssl.cnf" -extfile "$dir/extensions.cnf" -in "$dir/request.csr" -out "$dir/$name.crt.next" >/dev/null 2>&1
|
||||
if [[ -f "$dir/$name.crt" ]]; then
|
||||
cp "$dir/$name.crt" "$CA_DIR/$name.previous.crt"
|
||||
# During CA overlap an old-generation leaf stays valid until explicit retirement.
|
||||
# Never import its serial into another issuer's revocation database.
|
||||
if openssl verify -no_check_time -no-CApath -no-CAstore -CAfile "$CA_DIR/issuer.crt" "$dir/$name.crt" >/dev/null 2>&1; then
|
||||
serial=$(openssl x509 -in "$dir/$name.crt" -noout -serial | cut -d= -f2)
|
||||
status=$(openssl ca -config "$CA_DIR/openssl.cnf" -status "$serial" 2>&1 || true)
|
||||
if [[ "$status" != *Revoked* ]]; then
|
||||
openssl ca -config "$CA_DIR/openssl.cnf" -revoke "$dir/$name.crt" >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
mv "$dir/$name.key.next" "$dir/$name.key"
|
||||
mv "$dir/$name.crt.next" "$dir/$name.crt"
|
||||
chmod 700 "$dir"; chmod 600 "$dir/$name.key"; chmod 644 "$dir/$name.crt"
|
||||
rm "$dir/request.csr" "$dir/extensions.cnf"
|
||||
}
|
||||
if [[ $# -gt 0 ]]; then
|
||||
name="$1"
|
||||
case "$name" in
|
||||
client-api) issue "$name" DNS:client-api clientAuth ;;
|
||||
lb) issue lb DNS:lb,DNS:localhost,IP:127.0.0.1 serverAuth ;;
|
||||
openbao|grafana) issue "$name" "DNS:$name,DNS:localhost,IP:127.0.0.1" serverAuth,clientAuth ;;
|
||||
api|worker|redis|db|minio|otel-collector|prometheus|tempo|loki|collector|operator)
|
||||
issue "$name" "DNS:$name" serverAuth,clientAuth ;;
|
||||
*) echo 'Unknown identity' >&2; exit 2 ;;
|
||||
esac
|
||||
else
|
||||
for name in lb api worker db minio redis client-api openbao otel-collector collector prometheus tempo loki grafana operator; do
|
||||
[[ -f "$PKI_DIR/$name/$name.crt" ]] && continue
|
||||
case "$name" in
|
||||
lb) issue lb DNS:lb,DNS:localhost,IP:127.0.0.1 serverAuth ;;
|
||||
client-api) issue client-api DNS:client-api clientAuth ;;
|
||||
openbao|grafana) issue "$name" "DNS:$name,DNS:localhost,IP:127.0.0.1" serverAuth,clientAuth ;;
|
||||
*) issue "$name" "DNS:$name" serverAuth,clientAuth ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
if [[ -f "$PKI_DIR/minio/minio.crt" ]]; then
|
||||
cp "$PKI_DIR/minio/minio.crt" "$PKI_DIR/minio/public.crt"
|
||||
cp "$PKI_DIR/minio/minio.key" "$PKI_DIR/minio/private.key"
|
||||
fi
|
||||
openssl ca -gencrl -config "$CA_DIR/openssl.cnf" -out "$CA_DIR/active.crl" >/dev/null 2>&1
|
||||
python3 scripts/pki_state.py publish
|
||||
chmod 755 "$PKI_DIR"; chmod 644 "$PKI_DIR/ca.crt" "$PKI_DIR/ca.crl"
|
||||
echo 'PKI ready: private CA stays in secrets/operator/ca; leaf lifetime 7 days.'
|
||||
@@ -0,0 +1,157 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Operator-only provisioning. Never emits secret values or passes them in argv."""
|
||||
import fcntl, json, os, secrets, ssl, subprocess, sys, time, urllib.request, urllib.error
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent.parent
|
||||
os.chdir(ROOT)
|
||||
os.umask(0o077)
|
||||
DC=[str(ROOT/'scripts/dc.sh')]
|
||||
OP=ROOT/'secrets/operator'
|
||||
def run(*args, data=None):
|
||||
p=subprocess.run(DC+list(args),input=data,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||
if p.returncode:
|
||||
raise RuntimeError('Compose operation failed: '+' '.join(args[:3])+' (details withheld to protect secrets)')
|
||||
return p.stdout
|
||||
|
||||
def save(path,value):
|
||||
path.parent.mkdir(parents=True,exist_ok=True)
|
||||
path.write_text(value);path.chmod(0o600)
|
||||
def secret(name):
|
||||
path=OP/name
|
||||
if not path.exists():save(path,secrets.token_hex(24))
|
||||
return path.read_text().strip()
|
||||
|
||||
def prepare():
|
||||
OP.mkdir(parents=True,exist_ok=True)
|
||||
for name in ['db-password','minio-user','minio-password','grafana-password','redis-api','redis-worker','s3-api','s3-worker']:secret(name)
|
||||
for name in ['postgres','redis','minio','openbao','grafana','prometheus','loki','tempo']:
|
||||
(ROOT/'secrets/state'/name).mkdir(parents=True,exist_ok=True)
|
||||
# Grafana datasource provisioning embeds public CA and this service's own private key
|
||||
# in an ignored runtime file; provider expansion is not supported in datasource YAML.
|
||||
source=next((ROOT/'infra/grafana/provisioning/datasources').glob('*'))
|
||||
provisioning=json.loads(source.read_text())
|
||||
for ds in provisioning['datasources']:
|
||||
ds['secureJsonData']={'tlsCACert':(ROOT/'certs/ca.crt').read_text(),
|
||||
'tlsClientCert':(ROOT/'certs/grafana/grafana.crt').read_text(),
|
||||
'tlsClientKey':(ROOT/'certs/grafana/grafana.key').read_text()}
|
||||
save(ROOT/'secrets/grafana-datasources/datasources.yaml',json.dumps(provisioning))
|
||||
# Use current operator UID consistently; leaf keys remain 0600, not world-readable.
|
||||
if not (ROOT/'.env').exists():
|
||||
save(ROOT/'.env',f'LOCAL_UID={os.getuid()}\nLOCAL_GID={os.getgid()}\nHTTPS_PORT=8443\nBAO_PORT=8200\nGRAFANA_PORT=3000\n')
|
||||
import hashlib
|
||||
acl='user default off\n'
|
||||
for role,commands,keys in [
|
||||
('api','+ping +get +set +del +eval +incr +expire +xadd','~session:* ~ratelimit:login:* ~jobs:attachments'),
|
||||
('worker','+ping (+xgroup +xreadgroup +xautoclaim +xack ~jobs:attachments) (+xadd ~jobs:attachments:dlq)','')]:
|
||||
digest=hashlib.sha256(secret('redis-'+role).encode()).hexdigest()
|
||||
acl+=f'user {role} on #{digest} {keys} -@all {commands}\n'
|
||||
save(ROOT/'secrets/redis/users.acl',acl)
|
||||
for role in ['api','worker']:(ROOT/'secrets/approle'/role).mkdir(parents=True,exist_ok=True)
|
||||
|
||||
OP.mkdir(parents=True,exist_ok=True)
|
||||
bootstrap_lock=(OP/"bootstrap.lock").open("a")
|
||||
fcntl.flock(bootstrap_lock,fcntl.LOCK_EX)
|
||||
prepare()
|
||||
if '--prepare' in sys.argv:
|
||||
print('Local secret files prepared; .env contains only ports/UID/GID.');sys.exit(0)
|
||||
run('up','-d','--wait','--wait-timeout','90','db','cache','minio','openbao')
|
||||
# ACL file changes must become active even when the container already exists.
|
||||
run('restart','cache')
|
||||
ctx=ssl.create_default_context(cafile=str(ROOT/'certs/ca.crt'))
|
||||
local_settings=dict(line.split('=',1) for line in (ROOT/'.env').read_text().splitlines() if '=' in line and not line.startswith('#'))
|
||||
addr='https://localhost:'+os.environ.get('BAO_PORT',local_settings.get('BAO_PORT','8200'))
|
||||
token=None
|
||||
|
||||
def req(path,body=None):
|
||||
headers={'Content-Type':'application/json'}
|
||||
if token:headers['X-Vault-Token']=token
|
||||
request=urllib.request.Request(addr+'/v1/'+path,data=None if body is None else json.dumps(body).encode(),headers=headers)
|
||||
with urllib.request.urlopen(request,context=ctx,timeout=10) as r:
|
||||
b=r.read();return json.loads(b) if b else {}
|
||||
for _ in range(90):
|
||||
try:
|
||||
state=req('sys/seal-status');break
|
||||
except (OSError,urllib.error.URLError):time.sleep(1)
|
||||
else:raise RuntimeError('OpenBao TLS listener did not start')
|
||||
initfile=OP/'bao-init.json'
|
||||
if not state['initialized']:
|
||||
# init output is captured only in the operator's private file.
|
||||
save(initfile,run('exec','-T','openbao','bao','operator','init','-key-shares=1','-key-threshold=1','-format=json'))
|
||||
init=json.loads(initfile.read_text())
|
||||
if state['sealed']:req('sys/unseal',{'key':init['unseal_keys_b64'][0]})
|
||||
token=init['root_token']
|
||||
# Audit record payloads are HMACed by default; no raw secrets.
|
||||
if 'file/' not in req('sys/audit'):
|
||||
req('sys/audit/file',{'type':'file','options':{'file_path':'/bao/data/audit.json'}})
|
||||
# Migrations run over operator-local Unix socket, never with application credentials.
|
||||
sql="CREATE TABLE IF NOT EXISTS schema_migrations(version int PRIMARY KEY, applied_at timestamptz NOT NULL DEFAULT now());"
|
||||
run('exec','-T','db','psql','-U','postgres','-d','messenger','-v','ON_ERROR_STOP=1',data=sql)
|
||||
applied=set(run('exec','-T','db','psql','-U','postgres','-d','messenger','-Atc','SELECT version FROM schema_migrations').split())
|
||||
for p in sorted((ROOT/'migrations').glob('*.sql')):
|
||||
version=int(p.name.split('_')[0])
|
||||
if str(version) not in applied:
|
||||
run('exec','-T','db','psql','-U','postgres','-d','messenger','-v','ON_ERROR_STOP=1',data='BEGIN;\n'+p.read_text()+f'\nINSERT INTO schema_migrations(version) VALUES({version});COMMIT;')
|
||||
roles_sql="""
|
||||
DO $$ BEGIN
|
||||
IF NOT EXISTS(SELECT FROM pg_roles WHERE rolname='api_access') THEN CREATE ROLE api_access NOLOGIN; END IF;
|
||||
IF NOT EXISTS(SELECT FROM pg_roles WHERE rolname='worker_access') THEN CREATE ROLE worker_access NOLOGIN; END IF;
|
||||
END $$;
|
||||
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
|
||||
GRANT USAGE ON SCHEMA public TO api_access,worker_access;
|
||||
GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA public TO api_access;
|
||||
GRANT USAGE,SELECT ON ALL SEQUENCES IN SCHEMA public TO api_access;
|
||||
REVOKE ALL ON schema_migrations FROM api_access;
|
||||
GRANT SELECT,UPDATE ON attachments,jobs TO worker_access;
|
||||
GRANT SELECT,INSERT,UPDATE ON attachment_results TO worker_access;
|
||||
GRANT SELECT ON direct_uploads,outbox TO worker_access;
|
||||
"""
|
||||
run('exec','-T','db','psql','-U','postgres','-d','messenger','-v','ON_ERROR_STOP=1',data=roles_sql)
|
||||
mounts=req('sys/mounts')
|
||||
for name,typ in [('database','database'),('secret','kv')]:
|
||||
if name+'/' not in mounts:req('sys/mounts/'+name,{'type':typ,**({'options':{'version':'2'}} if typ=='kv' else {})})
|
||||
# OpenBao DB manager bootstraps using postgres; its secret is held only by the operator/Bao.
|
||||
req('database/config/messenger',{'plugin_name':'postgresql-database-plugin','allowed_roles':['api-role','worker-role'],
|
||||
'connection_url':'postgresql://{{username}}:{{password}}@db:5432/messenger?sslmode=verify-full&sslrootcert=/pki/ca.crt&sslcert=/identity/openbao.crt&sslkey=/identity/openbao.key',
|
||||
'username':'postgres','password':secret('db-password')})
|
||||
if 'approle/' not in req('sys/auth'):req('sys/auth/approle',{'type':'approle'})
|
||||
for role in ['api','worker']:
|
||||
creation=f'''CREATE ROLE "{{{{name}}}}" WITH LOGIN PASSWORD '{{{{password}}}}' VALID UNTIL '{{{{expiration}}}}' IN ROLE {role}_access;'''
|
||||
req('database/roles/'+role+'-role',{'db_name':'messenger','creation_statements':[creation],
|
||||
'revocation_statements':['''SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='{{name}}'; DROP ROLE IF EXISTS "{{name}}";'''],
|
||||
'default_ttl':'15m','max_ttl':'1h'})
|
||||
policy=f'''path "database/creds/{role}-role" {{ capabilities=["read"] }}
|
||||
path "secret/data/{role}" {{ capabilities=["read"] }}
|
||||
path "sys/leases/renew" {{ capabilities=["update"] }}
|
||||
path "auth/token/renew-self" {{ capabilities=["update"] }}
|
||||
path "auth/token/revoke-self" {{ capabilities=["update"] }}
|
||||
'''
|
||||
(ROOT/'infra/openbao'/f'{role}.hcl').write_text(policy)
|
||||
req('sys/policies/acl/'+role,{'policy':policy})
|
||||
req('auth/approle/role/'+role,{'token_policies':[role],'token_no_default_policy':True,
|
||||
'token_ttl':'15m','token_max_ttl':'1h','secret_id_ttl':'24h','secret_id_num_uses':0})
|
||||
previous=ROOT/'secrets/approle'/role/'secret-id'
|
||||
if previous.exists():
|
||||
try:req('auth/approle/role/'+role+'/secret-id/destroy',{'secret_id':previous.read_text()})
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code != 404:raise
|
||||
save(ROOT/'secrets/approle'/role/'role-id',req('auth/approle/role/'+role+'/role-id')['data']['role_id'])
|
||||
save(ROOT/'secrets/approle'/role/'secret-id',req('auth/approle/role/'+role+'/secret-id',{})['data']['secret_id'])
|
||||
req('secret/data/'+role,{'data':{'redis_url':f'rediss://{role}:{secret("redis-"+role)}@redis:6379/0',
|
||||
's3_access_key':'messenger-'+role,'s3_secret_key':secret('s3-'+role)}})
|
||||
# mc configuration and credentials live exclusively in its ephemeral /tmp.
|
||||
script='''set -eu
|
||||
mc alias set local https://minio:9000 "$(cat /operator/minio-user)" "$(cat /operator/minio-password)" >/dev/null
|
||||
mc mb --ignore-existing local/attachments >/dev/null
|
||||
mc anonymous set none local/attachments >/dev/null
|
||||
'''
|
||||
for role in ['api','worker']:
|
||||
# Track 2 chosen: worker needs all staging objects for lab6 processing and cleanup.
|
||||
actions=['s3:GetObject','s3:PutObject','s3:DeleteObject','s3:AbortMultipartUpload','s3:ListMultipartUploadParts']
|
||||
policy={'Version':'2012-10-17','Statement':[{'Effect':'Allow','Action':['s3:GetBucketLocation','s3:ListBucket'],'Resource':['arn:aws:s3:::attachments']},{'Effect':'Allow','Action':actions,'Resource':['arn:aws:s3:::attachments/staging/*','arn:aws:s3:::attachments/attachments/*']}]}
|
||||
script+=f"cat > /tmp/{role}.json <<'POLICY'\n{json.dumps(policy)}\nPOLICY\n"
|
||||
script+=f'mc admin user add local messenger-{role} "$(cat /operator/s3-{role})" >/dev/null\n'
|
||||
script+=f'mc admin policy create local {role} /tmp/{role}.json >/dev/null\n'
|
||||
script+=f'mc admin policy attach local {role} --user messenger-{role} >/dev/null\n'
|
||||
run('run','--rm','-T','mc','-s',data=script)
|
||||
print('OpenBao initialized/unsealed, database roles, scoped AppRoles, S3 policies provisioned. No secret values printed.')
|
||||
print('Protect secrets/operator/bao-init.json: lab auto-unseal uses it; production requires offline custody/external unseal.')
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec python3 scripts/ca_rollover.py "$@"
|
||||
@@ -0,0 +1,183 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Three-phase root rollover. Offline mode is restricted to an isolated test PKI."""
|
||||
import argparse,contextlib,fcntl,json,os,secrets,shutil,subprocess,time
|
||||
from pathlib import Path
|
||||
import pki_state as pki
|
||||
from resilience_hooks import command,DC,ROOT
|
||||
|
||||
CANARIES=('client-api','api','grafana','prometheus','otel-collector')
|
||||
ENDPOINTS=[
|
||||
('lb',443,'lb','api','/health/ready'),
|
||||
('api-tls',8443,'api','client-api','/health/ready'),('api2-tls',8443,'api','client-api','/health/ready'),
|
||||
('minio',9000,'minio','api','/minio/health/live'),('openbao',8200,'openbao','api','/v1/sys/seal-status'),
|
||||
('otel-collector',4318,'otel-collector','api','/v1/traces'),('otel-collector-tls',9464,'otel-collector','prometheus','/metrics'),
|
||||
('loki-tls',3100,'loki','grafana','/ready'),('tempo-tls',4318,'tempo','otel-collector','/v1/traces'),
|
||||
('tempo-tls',3200,'tempo','grafana','/ready'),('prometheus-tls',9090,'prometheus','grafana','/-/ready'),
|
||||
('grafana-tls',3000,'grafana','api','/api/health')]
|
||||
|
||||
@contextlib.contextmanager
|
||||
def ca_lock():
|
||||
with (pki.CA/'ca.lock').open('a') as f:
|
||||
fcntl.flock(f,fcntl.LOCK_EX);yield
|
||||
|
||||
def record(s,phase,details):
|
||||
s.setdefault('events',[]).append({'phase':phase,'unix_time':time.time(),**details})
|
||||
pki.save_state(s)
|
||||
if not OFFLINE:
|
||||
public={k:v for k,v in s.items() if k not in ('events',)}
|
||||
public['events']=s['events']
|
||||
pki.atomic(ROOT/'evidence/ca-rollover.json',json.dumps(public,indent=2)+'\n',0o644)
|
||||
|
||||
def verify_leaf(cert,root):
|
||||
p=pki.openssl('verify','-no_check_time','-no-CApath','-no-CAstore','-CAfile',root,cert)
|
||||
return p
|
||||
|
||||
def new_authority():
|
||||
directory=pki.CA/'generations'/('.pending-'+secrets.token_hex(6));directory.mkdir(mode=0o700)
|
||||
pki.openssl('genpkey','-algorithm','RSA','-pkeyopt','rsa_keygen_bits:3072','-out',directory/'ca.key')
|
||||
pki.openssl('req','-new','-x509','-sha256','-days','3650','-key',directory/'ca.key','-out',directory/'issuer.crt',
|
||||
'-subj','/CN=Lab7-Root-CA-'+time.strftime('%Y%m%d%H%M%S',time.gmtime())+'-'+secrets.token_hex(3),
|
||||
'-addext','basicConstraints=critical,CA:true','-addext','keyUsage=critical,keyCertSign,cRLSign')
|
||||
fp=pki.fingerprint(directory/'issuer.crt');target=pki.authority(fp);os.replace(directory,target)
|
||||
(target/'newcerts').mkdir();pki.atomic(target/'index.txt',b'')
|
||||
pki.atomic(target/'serial',secrets.token_hex(8)+'\n');pki.atomic(target/'crlnumber','1000\n')
|
||||
pki.atomic(target/'openssl.cnf',pki.config(target));pki.generate_crl(target)
|
||||
return target
|
||||
|
||||
def canaries(directory):
|
||||
for role in CANARIES:
|
||||
out=directory/'canaries'/role;out.mkdir(parents=True,mode=0o700,exist_ok=True)
|
||||
if (out/(role+'.crt')).exists():continue
|
||||
pki.openssl('genpkey','-algorithm','RSA','-pkeyopt','rsa_keygen_bits:2048','-out',out/(role+'.key'))
|
||||
pki.openssl('req','-new','-key',out/(role+'.key'),'-subj','/CN=rollover-canary-'+role,'-out',out/'request.csr')
|
||||
pki.atomic(out/'extensions.cnf',f'basicConstraints=critical,CA:false\nkeyUsage=critical,digitalSignature\nextendedKeyUsage=clientAuth\nsubjectAltName=DNS:{role}\n')
|
||||
pki.openssl('ca','-batch','-notext','-config',directory/'openssl.cnf','-extfile',out/'extensions.cnf','-in',out/'request.csr','-out',out/(role+'.crt'))
|
||||
pki.generate_crl(directory)
|
||||
|
||||
def reload_stack(phase):
|
||||
if OFFLINE:return
|
||||
env=dict(os.environ,HOOK_EVIDENCE_FILE='evidence/ca-'+phase+'-restart.json')
|
||||
p=subprocess.run([str(ROOT/'scripts/restart.sh')],cwd=ROOT,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=110)
|
||||
if p.returncode:raise RuntimeError('Rollover restart hook failed; dual trust is retained until recovery')
|
||||
|
||||
def client_directory(s,role,canary=False):
|
||||
return pki.authority(s['new'])/'canaries'/role if canary else pki.PKI/role
|
||||
|
||||
def probe_args(ca,client,role):
|
||||
return ['run','--rm','-T','--no-deps','-v',str(ca)+':/verify/ca.crt:ro','-v',str(client)+':/probe-client:ro','--entrypoint']
|
||||
|
||||
def http_probe(host,port,name,role,ca,client,path):
|
||||
args=probe_args(ca,client,role)+['curl','api','--silent','--show-error','--connect-timeout','3','--max-time','8',
|
||||
'--cacert','/verify/ca.crt','--cert','/probe-client/'+role+'.crt','--key','/probe-client/'+role+'.key',
|
||||
'--connect-to',f'{name}:{port}:{host}:{port}','--output','/dev/null','--write-out','%{http_code}',f'https://{name}:{port}/'+path.lstrip('/')]
|
||||
p=subprocess.run(DC+args,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=20)
|
||||
if p.returncode or not p.stdout.strip().isdigit() or int(p.stdout.strip())==0:
|
||||
raise RuntimeError('TLS endpoint verification failed: '+host+':'+str(port))
|
||||
return {'endpoint':host+':'+str(port),'server_name':name,'http_status':int(p.stdout.strip())}
|
||||
|
||||
def protocol_probe(host,port,name,ca,client,postgres=False):
|
||||
args=probe_args(ca,client,'api')+['/usr/bin/timeout','api','--kill-after=1s','4s','openssl','s_client','-quiet','-ign_eof',
|
||||
'-connect',f'{host}:{port}','-servername',name,'-verify_hostname',name,'-verify_return_error','-CAfile','/verify/ca.crt',
|
||||
'-cert','/probe-client/api.crt','-key','/probe-client/api.key']
|
||||
if postgres:
|
||||
import struct
|
||||
args+=['-starttls','postgres'];body=b'user\0pki_probe\0database\0messenger\0\0'
|
||||
payload=struct.pack('!II',len(body)+8,196608)+body
|
||||
else:payload=b'PING\r\n'
|
||||
p=subprocess.run(DC+args,input=payload,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=15)
|
||||
accepted=(p.stdout.startswith(b'R') if postgres else b'NOAUTH' in p.stdout)
|
||||
if p.returncode not in (0,124) or not accepted:
|
||||
raise RuntimeError('TLS protocol/application response failed: '+host)
|
||||
return {'endpoint':host+':'+str(port),'server_name':name,'application_response':'PostgreSQL Authentication' if postgres else 'Redis NOAUTH'}
|
||||
|
||||
def probes(s,new_only=False,canary=False):
|
||||
if OFFLINE:return []
|
||||
ca=pki.authority(s['new'])/'issuer.crt' if new_only else pki.PKI/'ca.crt'
|
||||
result=[]
|
||||
for host,port,name,role,path in ENDPOINTS:
|
||||
result.append(http_probe(host,port,name,role,ca,client_directory(s,role,canary),path))
|
||||
result.append(protocol_probe('db',5432,'db',ca,client_directory(s,'api',canary),True))
|
||||
result.append(protocol_probe('redis',6379,'redis',ca,client_directory(s,'api',canary)))
|
||||
return result
|
||||
|
||||
def old_client_probe(s,deny):
|
||||
if OFFLINE:return
|
||||
directory=pki.authority(s['old'])/'old-client-api'
|
||||
for host in ('api-tls','api2-tls'):
|
||||
args=probe_args(pki.PKI/'ca.crt',directory,'client-api')+['curl','api','--silent','--show-error','--fail','--connect-timeout','3','--max-time','8',
|
||||
'--cacert','/verify/ca.crt','--cert','/probe-client/client-api.crt','--key','/probe-client/client-api.key',
|
||||
'--connect-to',f'api:8443:{host}:8443','https://api:8443/health/ready']
|
||||
p=subprocess.run(DC+args,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=20)
|
||||
assert (p.returncode in (35,52,55,56)) if deny else p.returncode==0,host+' old-root identity verification'
|
||||
|
||||
def prepare():
|
||||
with ca_lock():
|
||||
pki.ensure_layout();s=pki.state()
|
||||
if not s or s['phase']=='retired':
|
||||
old=pki.active();new=new_authority();canaries(new)
|
||||
saved=old/'old-client-api';saved.mkdir(mode=0o700,exist_ok=True)
|
||||
for ext in ('crt','key'):shutil.copy2(pki.PKI/'client-api'/('client-api.'+ext),saved/('client-api.'+ext))
|
||||
s={'old':old.name,'new':new.name,'phase':'overlap','trust_distributed':False,'offline_test':OFFLINE,'events':[]}
|
||||
pki.save_state(s)
|
||||
if s['phase']!='overlap':raise RuntimeError('prepare is only valid before leaf reissue')
|
||||
pki.publish()
|
||||
reload_stack('overlap')
|
||||
checks=probes(s,canary=True);old_client_probe(s,False)
|
||||
with ca_lock():
|
||||
s['trust_distributed']=True;record(s,'overlap',{'trusted_roots':2,'new_root_client_checks':checks,'old_root_client':'accepted'})
|
||||
print(('OFFLINE model' if OFFLINE else 'PASS')+': old and new roots trusted; old leaves retained; new-root client identities accepted',flush=True)
|
||||
|
||||
def reissue():
|
||||
with ca_lock():
|
||||
s=pki.state();assert s and s['phase'] in ('overlap','reissued') and s['trust_distributed'],'Distribute/verify dual trust first'
|
||||
if pki.active().name!=s['new']:
|
||||
assert pki.active().name==s['old'];pki.link(pki.CA/'active',Path('generations')/s['new'])
|
||||
pki.publish()
|
||||
for role in pki.ROLES:
|
||||
cert=pki.PKI/role/(role+'.crt')
|
||||
try:verify_leaf(cert,pki.authority(s['new'])/'issuer.crt')
|
||||
except RuntimeError:
|
||||
env=dict(os.environ,PKI_DIR=str(pki.PKI),CA_DIR=str(pki.CA))
|
||||
p=subprocess.run([str(ROOT/'scripts/bootstrap-pki.sh'),role],env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||
if p.returncode:raise RuntimeError('Leaf reissue failed: '+role)
|
||||
verify_leaf(cert,pki.authority(s['new'])/'issuer.crt')
|
||||
with ca_lock():s['phase']='reissued';pki.save_state(s);pki.publish()
|
||||
reload_stack('reissued');checks=probes(s,new_only=True);old_client_probe(s,False)
|
||||
with ca_lock():record(s,'reissued',{'trusted_roots':2,'new_root_server_checks':checks,'old_root_client':'accepted during overlap','leaf_roles':list(pki.ROLES)})
|
||||
print(('OFFLINE model' if OFFLINE else 'PASS')+': all leaf/server identities switched to the new CA; overlap still accepts old clients',flush=True)
|
||||
|
||||
def revoke(directory,certificate):
|
||||
serial=pki.openssl('x509','-in',certificate,'-noout','-serial').decode().strip().split('=')[1]
|
||||
rows=[r.split('\t') for r in (directory/'index.txt').read_text().splitlines()]
|
||||
if not any(r[0]=='R' and r[3].upper()==serial.upper() for r in rows):
|
||||
pki.openssl('ca','-config',directory/'openssl.cnf','-revoke',certificate)
|
||||
|
||||
def retire():
|
||||
s=pki.state();assert s and s['phase'] in ('reissued','retired'),'Reissue every leaf before retirement'
|
||||
for role in pki.ROLES:verify_leaf(pki.PKI/role/(role+'.crt'),pki.authority(s['new'])/'issuer.crt')
|
||||
# Never remove old trust until every actual TLS endpoint proves its new chain.
|
||||
checks=probes(s,new_only=True)
|
||||
with ca_lock():
|
||||
old=pki.authority(s['old']);new=pki.authority(s['new'])
|
||||
for row in (old/'index.txt').read_text().splitlines():
|
||||
parts=row.split('\t')
|
||||
cert=old/'newcerts'/(parts[3]+'.pem')
|
||||
if parts[0]=='V' and cert.exists():revoke(old,cert)
|
||||
revoke(old,old/'issuer.crt');pki.generate_crl(old)
|
||||
for role in CANARIES:revoke(new,new/'canaries'/role/(role+'.crt'))
|
||||
pki.generate_crl(new)
|
||||
s['phase']='retired';pki.save_state(s);pki.publish()
|
||||
reload_stack('retired');checks=probes(s,new_only=True);old_client_probe(s,True)
|
||||
with ca_lock():record(s,'retired',{'trusted_roots':1,'old_ca_revocation_recorded':True,'old_root_client':'rejected on both API replicas','new_root_server_checks':checks})
|
||||
print(('OFFLINE model' if OFFLINE else 'PASS')+': old CA/leaf revocations recorded; old trust anchor removed; old identities rejected',flush=True)
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser();parser.add_argument('phase',choices=['prepare','reissue','retire','all']);parser.add_argument('--offline',action='store_true');args=parser.parse_args()
|
||||
OFFLINE=args.offline
|
||||
assert not OFFLINE or (pki.PKI!=ROOT/'certs' and pki.CA!=ROOT/'secrets/operator/ca'),'Offline mode requires isolated test paths'
|
||||
os.umask(0o077);pki.CA.mkdir(parents=True,exist_ok=True)
|
||||
# Same operator lock as cron; each CA mutation also takes the signing DB lock.
|
||||
with (pki.CA.parent/'pki.lock').open('a') as operator_lock:
|
||||
fcntl.flock(operator_lock,fcntl.LOCK_EX)
|
||||
if args.phase=='all':prepare();reissue();retire()
|
||||
else:{'prepare':prepare,'reissue':reissue,'retire':retire}[args.phase]()
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
image="${1:-postgres:16.15-alpine}"
|
||||
scripts/docker.sh run --rm --network none --user "${PROBE_UID:-$(id -u)}:${PROBE_GID:-$(id -g)}" \
|
||||
--read-only --cap-drop ALL --security-opt no-new-privileges:true \
|
||||
--entrypoint /bin/sh "$image" -ec '
|
||||
test "$(id -u)" -ne 0
|
||||
grep -Eq "^NoNewPrivs:[[:space:]]+1$" /proc/self/status
|
||||
grep -Eq "^CapEff:[[:space:]]+0+$" /proc/self/status
|
||||
echo "PASS: non-root, read_only, cap_drop=ALL, NoNewPrivs=1"
|
||||
'
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
if scripts/docker.sh compose version >/dev/null 2>&1; then
|
||||
exec scripts/docker.sh compose --project-directory "$PWD" "$@"
|
||||
fi
|
||||
if [[ -x /snap/docker/current/usr/libexec/docker/cli-plugins/docker-compose ]]; then
|
||||
exec /snap/docker/current/usr/libexec/docker/cli-plugins/docker-compose --project-directory "$PWD" "$@"
|
||||
fi
|
||||
echo 'Docker Compose v2 plugin is required.' >&2
|
||||
exit 1
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
if [[ -n "${DOCKER_BIN:-}" ]]; then exec "$DOCKER_BIN" "$@"; fi
|
||||
if [[ -x /usr/bin/docker ]]; then exec /usr/bin/docker "$@"; fi
|
||||
if [[ -x /snap/docker/current/bin/docker ]]; then exec /snap/docker/current/bin/docker "$@"; fi
|
||||
exec docker "$@"
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
# Review before running: sudo bash scripts/install-native-docker.sh --install
|
||||
# Does not remove Snap, its image/volume storage, or lab7 bind data.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
root="$PWD"
|
||||
case "${1:---check}" in
|
||||
--check) exec scripts/check-docker-hardening.sh ;;
|
||||
--install) ;;
|
||||
*) echo 'Usage: install-native-docker.sh [--check|--install]' >&2; exit 2 ;;
|
||||
esac
|
||||
[[ "$EUID" -eq 0 ]] || { echo 'Run from your terminal: sudo bash scripts/install-native-docker.sh --install' >&2; exit 1; }
|
||||
command -v apt-get >/dev/null
|
||||
command -v snap >/dev/null
|
||||
command -v systemctl >/dev/null
|
||||
# Global daemon switching is permitted only while no existing container is running.
|
||||
snap_cli=/snap/docker/current/bin/docker
|
||||
if systemctl is-active --quiet docker.service && ! systemctl is-active --quiet snap.docker.dockerd.service; then
|
||||
operator="${SUDO_USER:?Invoke via sudo as the repository owner}"
|
||||
exec env DOCKER_BIN=/usr/bin/docker PROBE_UID="$(id -u "$operator")" PROBE_GID="$(id -g "$operator")" scripts/check-docker-hardening.sh
|
||||
fi
|
||||
[[ -x "$snap_cli" ]]
|
||||
[[ -z "$("$snap_cli" ps -q)" ]] || { echo 'Stop existing containers safely before switching Docker daemons. Nothing changed.' >&2; exit 1; }
|
||||
mkdir -p build/docker-migration
|
||||
chmod 700 build/docker-migration
|
||||
# Export only the images used by this repository; no volume or secrets export.
|
||||
mapfile -t images < <(scripts/dc.sh --profile operator config --images | sort -u)
|
||||
[[ "${#images[@]}" -gt 0 ]]
|
||||
for image in "${images[@]}"; do "$snap_cli" image inspect "$image" >/dev/null; done
|
||||
"$snap_cli" image save -o "$root/build/docker-migration/lab7-images.tar" "${images[@]}"
|
||||
chmod 600 build/docker-migration/lab7-images.tar
|
||||
[[ -z "$("$snap_cli" ps -q)" ]] || { echo 'A container started during image export; aborting without stopping it.' >&2; exit 1; }
|
||||
restore_snap() {
|
||||
echo 'Native Docker installation failed; restoring the Snap daemon without deleting either storage.' >&2
|
||||
systemctl disable --now docker.service docker.socket 2>/dev/null || true
|
||||
snap enable docker >/dev/null 2>&1 || true
|
||||
snap start docker >/dev/null 2>&1 || true
|
||||
}
|
||||
trap restore_snap ERR
|
||||
# Reversible: Snap package and /var/snap/docker data are preserved.
|
||||
snap stop docker
|
||||
snap disable docker
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io docker-compose-v2
|
||||
systemctl enable --now docker.service
|
||||
/usr/bin/docker image load -i "$root/build/docker-migration/lab7-images.tar"
|
||||
# Materialize platform-specific public image blobs after a cross-version import.
|
||||
scripts/dc.sh --profile operator pull --ignore-buildable
|
||||
# Use the operator UID for the actual non-root probe, not root's UID.
|
||||
operator="${SUDO_USER:?Invoke via sudo as the repository owner}"
|
||||
uid=$(id -u "$operator")
|
||||
gid=$(id -g "$operator")
|
||||
/usr/bin/docker run --rm --network none --user "$uid:$gid" --read-only --cap-drop ALL \
|
||||
--security-opt no-new-privileges:true --entrypoint /bin/sh postgres:16.15-alpine -ec '
|
||||
test "$(id -u)" -ne 0
|
||||
grep -Eq "^NoNewPrivs:[[:space:]]+1$" /proc/self/status
|
||||
grep -Eq "^CapEff:[[:space:]]+0+$" /proc/self/status
|
||||
echo "PASS: native Docker starts non-root with NoNewPrivs=1 and no capabilities"
|
||||
'
|
||||
trap - ERR
|
||||
if ! id -nG "$operator" | tr ' ' '\n' | grep -qx docker; then
|
||||
usermod -aG docker "$operator"
|
||||
echo 'Docker group added. Start a new login session before non-sudo Docker commands.'
|
||||
fi
|
||||
printf 'Native Docker ready. Snap storage and all lab7 data preserved.\n'
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
root="$PWD"
|
||||
command -v crontab >/dev/null || { echo 'Install cron before enabling host certificate renewal.' >&2; exit 1; }
|
||||
(crontab -l 2>/dev/null | sed '\|# lab7-pki-renew$|d' || true
|
||||
printf '0 */12 * * * cd %q && scripts/renew-pki.sh >> secrets/operator/renewal.log 2>&1 # lab7-pki-renew\n' "$root") | crontab -
|
||||
echo 'Installed operator certificate renewal every 12 hours.'
|
||||
@@ -0,0 +1,115 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Private per-generation CA database; public atomic trust/CRL bundles only."""
|
||||
import json,os,re,secrets,shutil,subprocess
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent.parent
|
||||
PKI=Path(os.environ.get('PKI_DIR',ROOT/'certs')).resolve()
|
||||
CA=Path(os.environ.get('CA_DIR',ROOT/'secrets/operator/ca')).resolve()
|
||||
ROLES=('lb','api','worker','db','minio','redis','client-api','openbao','otel-collector','collector','prometheus','tempo','loki','grafana','operator')
|
||||
|
||||
def openssl(*args,data=None):
|
||||
p=subprocess.run(['openssl',*map(str,args)],input=data,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||
if p.returncode:raise RuntimeError('OpenSSL operation failed: '+str(args[0])+' (private command output withheld)')
|
||||
return p.stdout
|
||||
|
||||
def atomic(path,data,mode=0o600):
|
||||
path=Path(path);path.parent.mkdir(parents=True,exist_ok=True)
|
||||
temp=path.with_name(path.name+'.tmp-'+secrets.token_hex(4))
|
||||
fd=os.open(temp,os.O_WRONLY|os.O_CREAT|os.O_EXCL,mode)
|
||||
try:
|
||||
with os.fdopen(fd,'wb') as f:f.write(data if isinstance(data,bytes) else data.encode());f.flush();os.fsync(f.fileno())
|
||||
os.chmod(temp,mode);os.replace(temp,path)
|
||||
finally:
|
||||
if temp.exists():temp.unlink()
|
||||
|
||||
def link(path,target):
|
||||
path=Path(path);temp=path.with_name(path.name+'.link-'+secrets.token_hex(4))
|
||||
temp.symlink_to(target);os.replace(temp,path)
|
||||
|
||||
def fingerprint(cert):
|
||||
return openssl('x509','-in',cert,'-noout','-fingerprint','-sha256').decode().strip().split('=')[1].replace(':','').lower()
|
||||
|
||||
def config(directory):
|
||||
directory=Path(directory)
|
||||
return f'''[ca]
|
||||
default_ca=local
|
||||
[local]
|
||||
dir={directory}
|
||||
database=$dir/index.txt
|
||||
new_certs_dir=$dir/newcerts
|
||||
certificate=$dir/issuer.crt
|
||||
private_key=$dir/ca.key
|
||||
serial=$dir/serial
|
||||
crlnumber=$dir/crlnumber
|
||||
default_md=sha256
|
||||
default_days=7
|
||||
default_crl_days=7
|
||||
policy=policy
|
||||
unique_subject=no
|
||||
[policy]
|
||||
commonName=supplied
|
||||
'''
|
||||
|
||||
def state():
|
||||
path=CA/'rollover.json'
|
||||
return json.loads(path.read_text()) if path.exists() else None
|
||||
|
||||
def save_state(s):atomic(CA/'rollover.json',json.dumps(s,indent=2)+'\n')
|
||||
|
||||
def authority(identifier):
|
||||
assert re.fullmatch('[0-9a-f]{64}',identifier),'Invalid CA generation'
|
||||
return CA/'generations'/identifier
|
||||
|
||||
def active():return (CA/'active').resolve(strict=True)
|
||||
|
||||
def generate_crl(directory):
|
||||
directory=Path(directory)
|
||||
raw=openssl('ca','-gencrl','-config',directory/'openssl.cnf')
|
||||
atomic(directory/'ca.crl',raw,0o644)
|
||||
|
||||
def ensure_layout():
|
||||
"""Called under the CA lock, after initial root creation in bootstrap-pki."""
|
||||
CA.mkdir(parents=True,exist_ok=True);(CA/'generations').mkdir(exist_ok=True)
|
||||
(PKI/'trust').mkdir(parents=True,exist_ok=True);os.chmod(PKI/'trust',0o755)
|
||||
if not (CA/'active').exists():
|
||||
root_cert=PKI/'ca.crt'
|
||||
certs=re.findall(rb'-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----\s*',root_cert.read_bytes(),re.S)
|
||||
assert len(certs)==1,'Initial migration needs exactly one root certificate'
|
||||
fp=fingerprint(root_cert);directory=authority(fp)
|
||||
directory.mkdir(mode=0o700,exist_ok=True)
|
||||
# Copy first; until the active pointer exists, the legacy CA remains intact.
|
||||
for pattern in ('ca.key','index.txt*','serial*','crlnumber*'):
|
||||
for src in CA.glob(pattern):
|
||||
if src.is_file() and not (directory/src.name).exists():shutil.copy2(src,directory/src.name)
|
||||
if not (directory/'newcerts').exists():shutil.copytree(CA/'newcerts',directory/'newcerts')
|
||||
atomic(directory/'issuer.crt',certs[0],0o644)
|
||||
atomic(directory/'openssl.cnf',config(directory))
|
||||
crl=PKI/'ca.crl'
|
||||
if crl.exists():atomic(directory/'ca.crl',crl.read_bytes(),0o644)
|
||||
else:generate_crl(directory)
|
||||
link(CA/'active',Path('generations')/fp)
|
||||
# All signing paths resolve through one atomic generation pointer.
|
||||
for name,target in [('ca.key','ca.key'),('issuer.crt','issuer.crt'),('index.txt','index.txt'),('serial','serial'),('crlnumber','crlnumber'),('active.crl','ca.crl')]:
|
||||
link(CA/name,Path('active')/target)
|
||||
atomic(CA/'openssl.cnf',config(CA/'active'))
|
||||
for name in ('ca.crt','ca.crl'):
|
||||
path=PKI/name
|
||||
if path.exists() and not path.is_symlink() and not (PKI/'trust'/name).exists():atomic(PKI/'trust'/name,path.read_bytes(),0o644)
|
||||
link(path,Path('trust')/name)
|
||||
publish()
|
||||
|
||||
def publish():
|
||||
s=state()
|
||||
directories=[active()]
|
||||
if s and s['phase']=='retired':
|
||||
assert active().name==s['new'],'Refusing to restore a retired trust anchor'
|
||||
if s and s['phase'] in ('overlap','reissued'):
|
||||
directories=[authority(s['old']),authority(s['new'])]
|
||||
for directory in directories:
|
||||
if not (directory/'ca.crl').exists():generate_crl(directory)
|
||||
atomic(PKI/'trust/ca.crt',b''.join((d/'issuer.crt').read_bytes() for d in directories),0o644)
|
||||
atomic(PKI/'trust/ca.crl',b''.join((d/'ca.crl').read_bytes() for d in directories),0o644)
|
||||
|
||||
if __name__=='__main__':
|
||||
import sys
|
||||
{'init':ensure_layout,'publish':publish}[sys.argv[1]]()
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
# Operator cron: 0 */12 * * * cd /path/to/lab7 && scripts/renew-pki.sh
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec 9> secrets/operator/pki.lock
|
||||
flock -n 9 || exit 0
|
||||
for identity in lb api worker db minio redis client-api openbao otel-collector prometheus tempo loki grafana operator; do
|
||||
if ! openssl x509 -checkend 172800 -noout -in "certs/$identity/$identity.crt" >/dev/null; then
|
||||
scripts/bootstrap-pki.sh "$identity"
|
||||
fi
|
||||
done
|
||||
# Refresh CRL even when no leaf is due; invalidate cached TLS state by restarting proxies.
|
||||
scripts/bootstrap-pki.sh
|
||||
scripts/dc.sh restart lb api-tls api2-tls otel-collector-tls prometheus-tls tempo-tls loki-tls grafana-tls cache minio openbao
|
||||
scripts/dc.sh exec -T db psql -U postgres -d messenger -c 'SELECT pg_reload_conf()' >/dev/null
|
||||
# OpenBao restarts sealed with file storage. Operator script unseals using protected material.
|
||||
scripts/bootstrap-openbao.sh
|
||||
scripts/dc.sh restart api api2 worker otel-collector prometheus grafana loki tempo
|
||||
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Operator hooks for unmodified public resilience tests. Never remove volumes/data."""
|
||||
import json,os,ssl,subprocess,sys,time,urllib.request
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent.parent
|
||||
os.chdir(ROOT)
|
||||
DC=[str(ROOT/'scripts/dc.sh')]
|
||||
DOCKER=[str(ROOT/'scripts/docker.sh')]
|
||||
DATA={'db':'/var/lib/postgresql/data','cache':'/data','minio':'/data','openbao':'/bao/data','grafana':'/var/lib/grafana','prometheus':'/prometheus','loki':'/loki','tempo':'/var/tempo'}
|
||||
def command(argv,timeout=80):
|
||||
result=subprocess.run(argv,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=timeout)
|
||||
log=ROOT/'secrets/operator/resilience-hook.log';log.parent.mkdir(parents=True,exist_ok=True)
|
||||
fd=os.open(log,os.O_WRONLY|os.O_CREAT|os.O_APPEND,0o600)
|
||||
with os.fdopen(fd,'w') as stream:stream.write(result.stdout+result.stderr)
|
||||
if result.returncode:raise RuntimeError('Operator command failed; inspect private resilience-hook.log')
|
||||
return result.stdout
|
||||
|
||||
def snapshot():
|
||||
ids=command(DC+['ps','--all','--quiet']).split()
|
||||
if not ids:return {}
|
||||
result={}
|
||||
for c in json.loads(command(DOCKER+['inspect',*ids])):
|
||||
service=c['Config']['Labels']['com.docker.compose.service']
|
||||
instance=next((v.partition('=')[2] for v in c['Config'].get('Env',[]) if v.startswith('INSTANCE_ID=')),c['Config']['Hostname'])
|
||||
result[service]={'id':c['Id'],'instance_id':instance,'running':c['State']['Running'],'started_at':c['State']['StartedAt'],
|
||||
'data_mounts':[{'source':m['Source'],'destination':m['Destination'],'rw':m['RW']} for m in c.get('Mounts',[]) if m['Destination']==DATA.get(service)]}
|
||||
return result
|
||||
|
||||
def wait_ready(timeout=60):
|
||||
values={}
|
||||
envfile=ROOT/'.env'
|
||||
if envfile.exists():values=dict(x.split('=',1) for x in envfile.read_text().splitlines() if '=' in x and not x.startswith('#'))
|
||||
url=os.environ.get('BASE_URL','https://localhost:'+values.get('HTTPS_PORT','8443'))+'/health/ready'
|
||||
ctx=ssl.create_default_context(cafile=str(ROOT/'certs/ca.crt'))
|
||||
opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),urllib.request.HTTPSHandler(context=ctx))
|
||||
end=time.monotonic()+timeout
|
||||
while time.monotonic()<end:
|
||||
try:
|
||||
with opener.open(url,timeout=2) as r:
|
||||
if r.status==200:return
|
||||
except OSError:pass
|
||||
time.sleep(.25)
|
||||
raise RuntimeError('Verified HTTPS readiness did not recover before timeout')
|
||||
|
||||
def main():
|
||||
mode=sys.argv[1]
|
||||
assert mode in ('persistence','failover')
|
||||
started=time.monotonic();before=snapshot()
|
||||
evidence={'status':'RUNNING','mode':mode,'before':before,'volumes_removed':False}
|
||||
out=ROOT/os.environ.get('HOOK_EVIDENCE_FILE','evidence/resilience-'+mode+'-hook.json')
|
||||
assert out.resolve().is_relative_to((ROOT/'evidence').resolve())
|
||||
try:
|
||||
if mode=='persistence':
|
||||
assert all(before.get(s,{}).get('running') for s in ('api','api2','worker','db','cache','minio','openbao','lb')),'Start the full stack before the persistence hook'
|
||||
# Full process replacement includes DB, sessions, broker and S3.
|
||||
command(DC+['down'],timeout=30)
|
||||
command([str(ROOT/'scripts/bootstrap-openbao.sh')],timeout=45)
|
||||
command(DC+['up','-d','--no-build','--wait','--wait-timeout','50'],timeout=55)
|
||||
wait_ready(10)
|
||||
after=snapshot()
|
||||
for service in ('api','api2','worker','db','cache','minio','openbao','lb'):
|
||||
assert after[service]['running'] and after[service]['id']!=before[service]['id'],service
|
||||
for service in DATA:
|
||||
mounts=before[service]['data_mounts']
|
||||
assert len(mounts)==1 and mounts==after[service]['data_mounts'],service
|
||||
evidence['recreated_services']=sorted(s for s in before if s in after and before[s]['id']!=after[s]['id'])
|
||||
else:
|
||||
target=os.environ.get('TARGET_INSTANCE_ID','')
|
||||
candidates=[s for s in ('api','api2') if before.get(s,{}).get('running') and before[s]['instance_id']==target]
|
||||
assert target and len(candidates)==1,'TARGET_INSTANCE_ID must identify exactly one API process'
|
||||
service=candidates[0]
|
||||
command(DC+['stop','--timeout','5',service],timeout=8)
|
||||
after=snapshot()
|
||||
assert not after[service]['running'],'Target API is still running'
|
||||
other='api2' if service=='api' else 'api'
|
||||
assert after[other]['running'],'Surviving replica is not running'
|
||||
for untouched in ('db','cache','minio','openbao','lb','api-tls','api2-tls',other):
|
||||
assert before[untouched]['id']==after[untouched]['id'] and before[untouched]['started_at']==after[untouched]['started_at'],untouched
|
||||
evidence['stopped_service']=service
|
||||
evidence.update(status='PASS',after=after,elapsed_seconds=round(time.monotonic()-started,3))
|
||||
except Exception as e:
|
||||
evidence.update(status='FAIL',error=str(e),elapsed_seconds=round(time.monotonic()-started,3));raise
|
||||
finally:out.write_text(json.dumps(evidence,indent=2)+'\n')
|
||||
if __name__=='__main__':main()
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec python3 scripts/resilience_hooks.py persistence
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
identity="${1:?Usage: revoke-cert.sh identity}"
|
||||
[[ "$identity" =~ ^[a-z-]+$ ]] || exit 2
|
||||
exec 9> secrets/operator/pki.lock
|
||||
flock 9
|
||||
exec 8> secrets/operator/ca/ca.lock
|
||||
flock 8
|
||||
# A stale leaf must never be imported into a different issuer's CRL database.
|
||||
openssl verify -no_check_time -no-CApath -no-CAstore -CAfile secrets/operator/ca/issuer.crt "certs/$identity/$identity.crt" >/dev/null
|
||||
openssl ca -config secrets/operator/ca/openssl.cnf -revoke "certs/$identity/$identity.crt"
|
||||
openssl ca -config secrets/operator/ca/openssl.cnf -gencrl -out secrets/operator/ca/active.crl
|
||||
python3 scripts/pki_state.py publish
|
||||
scripts/dc.sh exec -T db psql -U postgres -d messenger -c 'SELECT pg_reload_conf()' >/dev/null
|
||||
# New handshakes must use the new CRL. Existing TCP sessions close on restart.
|
||||
scripts/dc.sh restart lb api-tls api2-tls otel-collector-tls tempo-tls loki-tls prometheus-tls grafana-tls
|
||||
scripts/dc.sh restart api api2 worker otel-collector tempo loki prometheus grafana
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
role="${1:?Usage: rotate-service-secret.sh api|worker}"
|
||||
[[ "$role" == api || "$role" == worker ]] || exit 2
|
||||
python3 - "$role" <<'PY'
|
||||
import secrets,sys
|
||||
from pathlib import Path
|
||||
for name in ['redis-'+sys.argv[1],'s3-'+sys.argv[1]]:
|
||||
p=Path('secrets/operator')/name
|
||||
p.write_text(secrets.token_hex(24));p.chmod(0o600)
|
||||
PY
|
||||
scripts/bootstrap-openbao.sh
|
||||
scripts/dc.sh restart cache
|
||||
if [[ "$role" == api ]]; then scripts/dc.sh restart api api2; else scripts/dc.sh restart worker; fi
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
image="${1:-lab7-api:local}"
|
||||
docker_bin="${DOCKER_BIN:-docker}"
|
||||
mkdir -p build/security-scan/cache build/security-scan/reports
|
||||
# Export only an image, never mount the Docker socket or any secret directory.
|
||||
"$docker_bin" save -o build/security-scan/image.tar "$image"
|
||||
"$docker_bin" run --rm --user "$(id -u):$(id -g)" --read-only --cap-drop ALL \
|
||||
--security-opt no-new-privileges:true --memory 2g --cpus 2 --tmpfs /tmp:rw,nosuid,size=1g \
|
||||
-v "$PWD/build/security-scan/image.tar:/image.tar:ro" \
|
||||
-v "$PWD/build/security-scan/cache:/cache" \
|
||||
-v "$PWD/build/security-scan/reports:/reports" aquasec/trivy:0.60.0 \
|
||||
image --input /image.tar --cache-dir /cache --scanners vuln --format json \
|
||||
--output /reports/image-scan.json --timeout 5m
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec python3 scripts/resilience_hooks.py failover
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
import json,ssl,subprocess,urllib.request
|
||||
from pathlib import Path
|
||||
root=Path(__file__).resolve().parent.parent
|
||||
init=json.loads((root/'secrets/operator/bao-init.json').read_text())
|
||||
ctx=ssl.create_default_context(cafile=str(root/'certs/ca.crt'))
|
||||
def write(path,body,token=None):
|
||||
headers={'Content-Type':'application/json'}
|
||||
if token:headers['X-Vault-Token']=token
|
||||
request=urllib.request.Request('https://localhost:8200/v1/'+path,data=json.dumps(body).encode(),headers=headers)
|
||||
with urllib.request.urlopen(request,context=ctx,timeout=10) as response:response.read()
|
||||
try:
|
||||
write('sys/seal',{},init['root_token'])
|
||||
p=subprocess.run([str(root/'scripts/dc.sh'),'run','--rm','-T','--no-deps','--entrypoint','/app/worker','worker'],stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=20)
|
||||
assert p.returncode==1,'Worker must fail closed when OpenBao is sealed'
|
||||
finally:write('sys/unseal',{'key':init['unseal_keys_b64'][0]})
|
||||
print('PASS: fresh Worker refuses startup with sealed OpenBao; operator unseal restores access')
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
temp=$(mktemp -d)
|
||||
trap 'rm -rf "$temp"' EXIT
|
||||
export PKI_DIR="$temp/certs" CA_DIR="$temp/ca"
|
||||
scripts/bootstrap-pki.sh >/dev/null
|
||||
cp "$PKI_DIR/client-api/client-api.crt" "$temp/old-client.crt"
|
||||
cp "$PKI_DIR/ca.crt" "$temp/old-root.crt"
|
||||
scripts/ca-rollover.sh prepare --offline
|
||||
# During overlap both old production leaves and candidate-root canaries verify.
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$temp/old-client.crt" >/dev/null
|
||||
scripts/ca-rollover.sh reissue --offline
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$temp/old-client.crt" >/dev/null
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$PKI_DIR/client-api/client-api.crt" >/dev/null
|
||||
scripts/ca-rollover.sh retire --offline
|
||||
if openssl verify -CAfile "$PKI_DIR/ca.crt" "$temp/old-client.crt" >"$temp/error" 2>&1; then echo 'FAIL: retired root still trusted'; exit 1; fi
|
||||
grep -Eq 'unable to get local issuer certificate|unable to verify' "$temp/error"
|
||||
for cert in "$PKI_DIR"/*/*.crt; do
|
||||
[[ "$cert" == "$PKI_DIR/trust/"* ]] && continue
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$cert" >/dev/null
|
||||
done
|
||||
python3 - <<'PY'
|
||||
import json,os,subprocess
|
||||
from pathlib import Path
|
||||
ca=Path(os.environ['CA_DIR']);pki=Path(os.environ['PKI_DIR']);s=json.loads((ca/'rollover.json').read_text())
|
||||
assert s['phase']=='retired' and s['old']!=s['new']
|
||||
assert (pki/'ca.crt').read_text().count('BEGIN CERTIFICATE')==1
|
||||
assert (ca/'active').resolve().name==s['new']
|
||||
assert (ca/'generations'/s['old']/'ca.key').stat().st_mode & 0o077 == 0
|
||||
old = ca/'generations'/s['old']
|
||||
serial = subprocess.check_output(['openssl','x509','-in',old/'issuer.crt','-noout','-serial'],text=True).strip().split('=')[1]
|
||||
rows = [row.split('\t') for row in (old/'index.txt').read_text().splitlines()]
|
||||
assert any(row[0]=='R' and int(row[3],16)==int(serial,16) for row in rows), 'Old root serial was not revoked'
|
||||
print('PASS: isolated dual trust, cross-issuer leaf reissue, current CRL, old anchor removal, protected CA generations')
|
||||
PY
|
||||
# Existing renewal/revocation remains usable after a completed rollover.
|
||||
scripts/bootstrap-pki.sh client-api >/dev/null
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$PKI_DIR/client-api/client-api.crt" >/dev/null
|
||||
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Live root rollover: TLS overlap, data/session retention, latency/resource samples."""
|
||||
import argparse,hashlib,json,math,os,ssl,subprocess,sys,threading,time,urllib.error,urllib.request
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0,str(ROOT/'tests'))
|
||||
from client import Client,check
|
||||
sys.path.insert(0,str(ROOT/'scripts'))
|
||||
import pki_state as pki
|
||||
|
||||
|
||||
def percentile(values,p):
|
||||
if not values:return None
|
||||
return round(sorted(values)[max(0,math.ceil(len(values)*p)-1)],3)
|
||||
|
||||
def memory_bytes(text):
|
||||
import re
|
||||
match=re.fullmatch(r'([0-9.]+)\s*([A-Za-z]+)',text.strip())
|
||||
if not match:raise ValueError('Unavailable memory sample')
|
||||
value,unit=match.groups()
|
||||
factor={'B':1,'kB':1000,'KB':1000,'MB':1000**2,'GB':1000**3,'KiB':1024,'MiB':1024**2,'GiB':1024**3}[unit]
|
||||
return float(value)*factor
|
||||
|
||||
def main():
|
||||
parser=argparse.ArgumentParser();parser.add_argument('--base-url',default=os.environ.get('BASE_URL','https://localhost:8443'));args=parser.parse_args()
|
||||
os.environ['BASE_URL']=args.base_url
|
||||
before=pki.fingerprint(ROOT/'certs/ca.crt')
|
||||
client=Client(args.base_url,str(ROOT/'certs/ca.crt'))
|
||||
alice,bob,eve,chat=client.bootstrap()
|
||||
original=client.message(alice,chat,'CA rollover confirmed data')['json']
|
||||
attachment,content=client.attachment(alice,chat);client.wait_ready(alice,attachment)
|
||||
checks=[]
|
||||
def retained(phase):
|
||||
# Explicitly reload the distributed trust bundle; keep the same bearer tokens.
|
||||
c=Client(args.base_url,str(ROOT/'certs/ca.crt'))
|
||||
c.call('GET','/api/v1/users/me',actor=alice,schema='User')
|
||||
history=c.call('GET','/api/v1/chats/'+chat['id']+'/messages?limit=100',actor=bob,schema='MessagePage')['json']['items']
|
||||
check(any(m==original for m in history),'Confirmed message changed during rollover')
|
||||
data=c.call('GET','/api/v1/attachments/'+attachment['id']+'/content',actor=bob)['bytes']
|
||||
check(data==content,'Attachment changed during rollover')
|
||||
checks.append({'phase':phase,'existing_session':'PASS','message':'PASS','attachment_sha256':hashlib.sha256(data).hexdigest(),'trusted_roots':(ROOT/'certs/ca.crt').read_text().count('BEGIN CERTIFICATE')})
|
||||
retained('before')
|
||||
stopping=threading.Event();samples=[];resources={};resource_failures=[];started=time.monotonic()
|
||||
def load():
|
||||
while not stopping.is_set():
|
||||
now=time.monotonic();status='200'
|
||||
try:
|
||||
ctx=ssl.create_default_context(cafile=str(ROOT/'certs/ca.crt'))
|
||||
opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),urllib.request.HTTPSHandler(context=ctx))
|
||||
with opener.open(args.base_url+'/health/ready',timeout=2) as r:assert r.status==200
|
||||
except urllib.error.HTTPError as e:status=str(e.code)
|
||||
except (OSError,ValueError) as e:
|
||||
cause=e.reason if isinstance(e,urllib.error.URLError) else e
|
||||
status=type(cause).__name__
|
||||
samples.append({'seconds':round(time.monotonic()-started,3),'latency_ms':round((time.monotonic()-now)*1000,3),'status':status})
|
||||
stopping.wait(.25)
|
||||
def stats():
|
||||
while not stopping.is_set():
|
||||
try:
|
||||
r=subprocess.run([str(ROOT/'scripts/docker.sh'),'stats','--no-stream','--format','{{json .}}'],text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=8)
|
||||
for line in r.stdout.splitlines():
|
||||
row=json.loads(line);name=row['Name']
|
||||
if not name.startswith('lab7-') or not name.endswith('-1'):continue
|
||||
cpu=float(row['CPUPerc'].rstrip('%'));memory=memory_bytes(row['MemUsage'].split('/')[0])
|
||||
entry=resources.setdefault(name,{'max_sampled_cpu_percent':0.,'max_sampled_memory_bytes':0.,'samples':0})
|
||||
entry['max_sampled_cpu_percent']=max(entry['max_sampled_cpu_percent'],cpu)
|
||||
entry['max_sampled_memory_bytes']=max(entry['max_sampled_memory_bytes'],memory);entry['samples']+=1
|
||||
except (OSError,ValueError,KeyError,subprocess.TimeoutExpired):resource_failures.append(time.monotonic()-started)
|
||||
stopping.wait(3)
|
||||
threads=[threading.Thread(target=load),threading.Thread(target=stats)]
|
||||
for thread in threads:thread.start()
|
||||
result={'status':'RUNNING','old_root':before,'profile':'one sequential HTTPS readiness client, 250ms pause, 2s request timeout; nearest-rank percentiles','warmup':'fixture creation before sampling','hardware':{'logical_cpus':os.cpu_count(),'mem_total':next((s.strip() for s in Path('/proc/meminfo').read_text().splitlines() if s.startswith('MemTotal:')),None)},'data_checks':checks}
|
||||
try:
|
||||
for phase in ('prepare','reissue','retire'):
|
||||
print('Running CA phase: '+phase,flush=True)
|
||||
log=ROOT/'secrets/operator'/('ca-'+phase+'.log')
|
||||
fd=os.open(log,os.O_WRONLY|os.O_CREAT|os.O_TRUNC,0o600)
|
||||
with os.fdopen(fd,'wb') as f:
|
||||
r=subprocess.run([str(ROOT/'scripts/ca-rollover.sh'),phase],cwd=ROOT,stdout=f,stderr=f,timeout=240)
|
||||
check(r.returncode==0,'CA '+phase+' failed; inspect private operator log')
|
||||
retained(phase)
|
||||
if phase=='reissue':
|
||||
old=pki.authority(pki.state()['old'])/'issuer.crt'
|
||||
try:
|
||||
urllib.request.urlopen(args.base_url+'/health/ready',context=ssl.create_default_context(cafile=str(old)),timeout=3)
|
||||
raise AssertionError('Old-root-only client still trusts the new server')
|
||||
except urllib.error.URLError as e:
|
||||
check(isinstance(e.reason,ssl.SSLCertVerificationError),'Old-only client failed for a non-certificate reason')
|
||||
result['old_root_only_client']='rejected with certificate verification error'
|
||||
result['new_root']=pki.fingerprint(ROOT/'certs/ca.crt')
|
||||
check(result['old_root']!=result['new_root'],'Root fingerprint did not change')
|
||||
stopping.wait(2)
|
||||
stopping.set()
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
check(resources,'No resource samples collected')
|
||||
check(any(s['status']=='200' for s in samples),'No successful HTTPS readiness samples')
|
||||
check(not any(s['status']=='SSLCertVerificationError' for s in samples),'Unexpected certificate verification error under dual trust')
|
||||
result['status']='PASS'
|
||||
finally:
|
||||
stopping.set()
|
||||
for thread in threads:thread.join(timeout=10)
|
||||
elapsed=time.monotonic()-started;good=[s['latency_ms'] for s in samples if s['status']=='200'];all_times=[s['latency_ms'] for s in samples]
|
||||
result.update(elapsed_seconds=round(elapsed,3),requests=len(samples),successes=len(good),errors=len(samples)-len(good),successful_rps=round(len(good)/elapsed,3),latency_ms={'all':{f'p{int(p*100)}':percentile(all_times,p) for p in (.5,.95,.99)},'successful':{f'p{int(p*100)}':percentile(good,p) for p in (.5,.95,.99)}},resource_samples=resources,resource_sampler_failures=len(resource_failures),raw_requests=samples)
|
||||
if result['status']=='RUNNING':result['status']='FAIL'
|
||||
(ROOT/'evidence/ca-rollover-load.json').write_text(json.dumps(result,indent=2,ensure_ascii=False)+'\n')
|
||||
print('PASS: three CA phases, old-root rejection, same session/message/attachment preserved; metrics saved',flush=True)
|
||||
if __name__=='__main__':main()
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec python3 scripts/test-ca-rollover.py "$@"
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
# Allowed API cert; a valid empty OTLP envelope succeeds.
|
||||
scripts/dc.sh run --rm -T --no-deps --entrypoint curl api \
|
||||
-fsS --cacert /pki/ca.crt --cert /identity/api.crt --key /identity/api.key \
|
||||
-H 'Content-Type: application/json' -d '{}' https://otel-collector:4318/v1/traces >/dev/null
|
||||
set +e
|
||||
scripts/dc.sh run --rm -T --no-deps -v "$PWD/certs/client-api:/wrong:ro" --entrypoint curl api \
|
||||
-fsS --connect-timeout 3 --max-time 10 --cacert /pki/ca.crt --cert /wrong/client-api.crt --key /wrong/client-api.key \
|
||||
-H 'Content-Type: application/json' -d '{}' https://otel-collector:4318/v1/traces >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
case "$rc" in 35|52|55|56) echo 'PASS: Collector accepts api SAN and rejects client-api SAN' ;; *) echo "FAIL: unexpected result $rc"; exit 1 ;; esac
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Operator test: rotates worker secrets; never prints old or new values."""
|
||||
import json,ssl,subprocess,urllib.request,urllib.error,shlex
|
||||
from pathlib import Path
|
||||
root=Path(__file__).resolve().parent.parent
|
||||
op=root/'secrets/operator'
|
||||
old_redis=(op/'redis-worker').read_text().strip()
|
||||
old_s3=(op/'s3-worker').read_text().strip()
|
||||
role=(root/'secrets/approle/worker/role-id').read_text()
|
||||
old_sid=(root/'secrets/approle/worker/secret-id').read_text()
|
||||
dc=[str(root/'scripts/dc.sh')]
|
||||
subprocess.run([str(root/'scripts/rotate-service-secret.sh'),'worker'],cwd=root,check=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=120)
|
||||
ctx=ssl.create_default_context(cafile=str(root/'certs/ca.crt'))
|
||||
r=urllib.request.Request('https://localhost:8200/v1/auth/approle/login',data=json.dumps({'role_id':role,'secret_id':old_sid}).encode(),headers={'Content-Type':'application/json'})
|
||||
try:
|
||||
urllib.request.urlopen(r,context=ctx,timeout=10)
|
||||
raise AssertionError('old SecretID still accepted')
|
||||
except urllib.error.HTTPError as e:assert e.code in (400,403)
|
||||
script=f'valkey-cli --tls --cacert /pki/ca.crt --cert /identity/redis.crt --key /identity/redis.key --sni redis -h redis --user worker --pass {shlex.quote(old_redis)} PING\n'
|
||||
p=subprocess.run(dc+['run','--rm','-T','--no-deps','--entrypoint','/bin/sh','cache','-s'],cwd=root,input=script,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=20)
|
||||
assert 'WRONGPASS' in p.stdout+p.stderr,'old Redis password did not fail authentication'
|
||||
script=f'mc alias set old https://minio:9000 messenger-worker {shlex.quote(old_s3)} >/dev/null && mc ls old/attachments/staging\n'
|
||||
p=subprocess.run(dc+['run','--rm','-T','mc','-s'],cwd=root,input=script,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=20)
|
||||
assert p.returncode!=0 and any(x in (p.stdout+p.stderr).lower() for x in ['signature','access denied','access key']),'old S3 secret did not fail authentication'
|
||||
p=subprocess.run(dc+['run','--rm','-T','--no-deps','--entrypoint','/app/dependency_security_test','worker'],cwd=root,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=30)
|
||||
assert p.returncode==0,'fresh worker credentials failed validation'
|
||||
print('PASS: worker SecretID, Redis password and S3 secret rotated; old credentials denied; fresh worker credentials succeed')
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Inspect delivered flags and real PID 1 kernel state without target shell/tools."""
|
||||
import json,os,subprocess
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent.parent
|
||||
DOCKER=[str(ROOT/'scripts/docker.sh')]
|
||||
def run(*args):return subprocess.check_output(DOCKER+list(args),text=True,stderr=subprocess.PIPE)
|
||||
ids=run('ps','--quiet','--filter','label=com.docker.compose.project=lab7','--filter','label=com.docker.compose.oneoff=False').split()
|
||||
assert ids,'No running lab7 services'
|
||||
containers=json.loads(run('inspect',*ids));result=[]
|
||||
for c in containers:
|
||||
service=c['Config']['Labels']['com.docker.compose.service'];h=c['HostConfig'];user=c['Config']['User']
|
||||
assert user.split(':')[0] not in ('','0','root'),service
|
||||
assert h['ReadonlyRootfs'] and 'ALL' in h['CapDrop'] and h['Memory']>0,service
|
||||
assert any(x in ('no-new-privileges','no-new-privileges:true') for x in h['SecurityOpt']),service
|
||||
assert h['NetworkMode']!='host' and not h['Privileged'],service
|
||||
assert not any(m['Destination']=='/var/run/docker.sock' for m in c['Mounts']),service
|
||||
bindings={k:v for k,v in (h.get('PortBindings') or {}).items() if v}
|
||||
if bindings:
|
||||
assert service in ('lb','grafana-tls','openbao'),service
|
||||
if service!='lb':assert all(x['HostIp']=='127.0.0.1' for v in bindings.values() for x in v),service
|
||||
# A trusted helper shares only the target PID namespace, no network or mounts.
|
||||
# PID 1 remains the target service; inspect its kernel status, not the helper's.
|
||||
status=run('run','--rm','--network','none','--pid','container:'+c['Id'],'--user',user,'--read-only','--cap-drop','ALL','--security-opt','no-new-privileges:true','--entrypoint','/bin/cat','lab7-api:local','/proc/1/status')
|
||||
fields=dict(line.split(':',1) for line in status.splitlines() if ':' in line)
|
||||
assert fields['NoNewPrivs'].strip()=='1',service
|
||||
assert int(fields['CapEff'].strip(),16)==0,service
|
||||
assert int(fields['Uid'].split()[0])!=0,service
|
||||
result.append({'service':service,'container_id':c['Id'],'user':user,'read_only':True,'cap_drop':['ALL'],'no_new_privs':1,'effective_capabilities':0,'seccomp':fields['Seccomp'].strip(),'apparmor':c.get('AppArmorProfile'),'memory_limit_bytes':h['Memory'],'nano_cpus':h['NanoCpus'],'published_ports':bindings})
|
||||
expected={'api','api2','worker','api-tls','api2-tls','db','cache','minio','openbao','lb','otel-collector','otel-collector-tls','loki','loki-tls','tempo','tempo-tls','prometheus','prometheus-tls','grafana','grafana-tls'}
|
||||
assert {x['service'] for x in result}==expected,'The complete stack must be running'
|
||||
server=json.loads(run('version','--format','{{json .Server}}'))
|
||||
output={'status':'PASS','docker_version':server['Version'],'docker_root_dir':run('info','--format','{{.DockerRootDir}}').strip(),'context':'main compose.yaml, no diagnostic override','services':result}
|
||||
(ROOT/'evidence/hardening-native.json').write_text(json.dumps(output,indent=2)+'\n')
|
||||
print('PASS: all 20 real service PID 1 processes are non-root, NoNewPrivs=1, CapEff=0; read_only/resources/ports verified')
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
mode="${1:?no-cert or wrong-identity}"
|
||||
args=()
|
||||
if [[ "$mode" == wrong-identity ]]; then args=(--cert /identity/worker.crt --key /identity/worker.key); fi
|
||||
for target in api-tls api2-tls; do
|
||||
# Positive control proves each listener/application and permitted LB identity.
|
||||
scripts/dc.sh run --rm -T --no-deps -v "$PWD/certs/client-api:/test-client:ro" --entrypoint curl api \
|
||||
--silent --show-error --fail --connect-timeout 3 --max-time 10 --cacert /pki/ca.crt \
|
||||
--cert /test-client/client-api.crt --key /test-client/client-api.key \
|
||||
--connect-to "api:8443:$target:8443" https://api:8443/health/ready >/dev/null
|
||||
set +e
|
||||
scripts/dc.sh run --rm -T --no-deps --entrypoint curl worker \
|
||||
--silent --show-error --fail --connect-timeout 3 --max-time 10 --cacert /pki/ca.crt \
|
||||
"${args[@]}" --connect-to "api:8443:$target:8443" https://api:8443/health/ready >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
case "$rc" in 35|52|55|56) echo "PASS: $target rejects $mode (curl $rc)" ;; *) echo "FAIL: unexpected result $rc"; exit 1 ;; esac
|
||||
done
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
work=secrets/operator/foreign-test
|
||||
mkdir -p "$work"
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
openssl req -new -x509 -newkey rsa:2048 -nodes -days 1 -subj /CN=client-api \
|
||||
-addext subjectAltName=DNS:client-api -addext extendedKeyUsage=clientAuth \
|
||||
-keyout "$work/client.key" -out "$work/client.crt" >/dev/null 2>&1
|
||||
for target in api-tls api2-tls; do
|
||||
set +e
|
||||
scripts/dc.sh run --rm -T --no-deps -v "$PWD/$work:/foreign:ro" --entrypoint curl api \
|
||||
-fsS --connect-timeout 3 --max-time 10 --cacert /pki/ca.crt --cert /foreign/client.crt --key /foreign/client.key \
|
||||
--connect-to "api:8443:$target:8443" https://api:8443/health/ready >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
case "$rc" in 35|52|55|56) echo "PASS: $target rejects untrusted client CA with otherwise correct SAN" ;; *) echo "FAIL: unexpected result $rc"; exit 1 ;; esac
|
||||
done
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
exec "$(dirname "$0")/test-mtls-common.sh" no-cert
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
exec "$(dirname "$0")/test-mtls-common.sh" wrong-identity
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
import json,ssl,urllib.request,urllib.error
|
||||
from pathlib import Path
|
||||
root=Path(__file__).resolve().parent.parent
|
||||
ctx=ssl.create_default_context(cafile=str(root/'certs/ca.crt'))
|
||||
def call(path,body=None,token=None,expected=200):
|
||||
h={'Content-Type':'application/json'}
|
||||
if token:h['X-Vault-Token']=token
|
||||
r=urllib.request.Request('https://localhost:8200/v1/'+path,headers=h,data=None if body is None else json.dumps(body).encode())
|
||||
try:
|
||||
with urllib.request.urlopen(r,context=ctx,timeout=10) as response:
|
||||
assert response.status==expected,(path,response.status)
|
||||
raw=response.read();return json.loads(raw) if raw else {}
|
||||
except urllib.error.HTTPError as e:
|
||||
assert e.code==expected,(path,e.code)
|
||||
for role,other in [('api','worker'),('worker','api')]:
|
||||
creds=root/'secrets/approle'/role
|
||||
token=call('auth/approle/login',{'role_id':(creds/'role-id').read_text(),'secret_id':(creds/'secret-id').read_text()})['auth']['client_token']
|
||||
try:
|
||||
call('secret/data/'+role,token=token)
|
||||
call('database/creds/'+role+'-role',token=token)
|
||||
call('secret/data/'+other,token=token,expected=403)
|
||||
call('database/creds/'+other+'-role',token=token,expected=403)
|
||||
call('sys/policies/acl/root',token=token,expected=403)
|
||||
call('sys/policies/acl/'+role,{'policy':''},token,403)
|
||||
finally:call('auth/token/revoke-self',{},token,204)
|
||||
print('PASS: both AppRoles read own KV/DB path; cross-role and policy read/write denied; test tokens revoked')
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
# Destructive only to the current LB leaf: rotates it, then verifies old/expired cert denial.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
old=secrets/operator/lifecycle
|
||||
mkdir -p "$old"
|
||||
chmod 700 "$old"
|
||||
cp certs/client-api/client-api.crt "$old/old.crt"
|
||||
cp certs/client-api/client-api.key "$old/old.key"
|
||||
python3 - <<'PY' &
|
||||
import json,time,ssl,urllib.request,urllib.error
|
||||
from pathlib import Path
|
||||
ctx=ssl.create_default_context(cafile='certs/ca.crt')
|
||||
counts={'ok':0,'errors':0,'first_failure_seconds':None,'recovered_seconds':None}
|
||||
start=time.monotonic()
|
||||
for _ in range(80):
|
||||
try:
|
||||
with urllib.request.urlopen('https://localhost:8443/health/ready',context=ctx,timeout=2) as r:
|
||||
assert r.status==200
|
||||
counts['ok']+=1
|
||||
if counts['first_failure_seconds'] is not None and counts['recovered_seconds'] is None:counts['recovered_seconds']=round(time.monotonic()-start,3)
|
||||
except (OSError,urllib.error.URLError,AssertionError):
|
||||
counts['errors']+=1
|
||||
if counts['first_failure_seconds'] is None:counts['first_failure_seconds']=round(time.monotonic()-start,3)
|
||||
time.sleep(.25)
|
||||
counts['elapsed_seconds']=round(time.monotonic()-start,3)
|
||||
Path('evidence/pki-load.json').write_text(json.dumps(counts,indent=2)+'\n')
|
||||
PY
|
||||
load_pid=$!
|
||||
scripts/bootstrap-pki.sh client-api
|
||||
scripts/dc.sh restart api-tls api2-tls
|
||||
scripts/dc.sh restart api api2
|
||||
scripts/dc.sh restart lb
|
||||
# Wait for fresh TLS listeners; this also checks the new LB client leaf succeeds.
|
||||
for i in {1..30}; do
|
||||
if curl --silent --fail --cacert certs/ca.crt https://localhost:8443/health/ready >/dev/null; then break; fi
|
||||
sleep 1
|
||||
done
|
||||
curl --silent --show-error --fail --cacert certs/ca.crt https://localhost:8443/health/ready >/dev/null
|
||||
reject() {
|
||||
set +e
|
||||
scripts/dc.sh run --rm -T --no-deps -v "$PWD/$old:/old-client:ro" --entrypoint curl api \
|
||||
--silent --show-error --fail --connect-timeout 3 --max-time 10 --cacert /pki/ca.crt \
|
||||
--cert "/old-client/$1.crt" --key "/old-client/$1.key" \
|
||||
--resolve api:8443:127.0.0.1 https://api:8443/health/ready >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
case "$rc" in 35|52|55|56) ;; *) echo "FAIL: expected TLS rejection for $1; got $rc"; exit 1 ;; esac
|
||||
}
|
||||
reject old
|
||||
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "$old/expired.key" 2>/dev/null
|
||||
openssl req -new -key "$old/expired.key" -out "$old/expired.csr" -subj /CN=expired-client-api
|
||||
cat > "$old/ext.cnf" <<'EOF'
|
||||
basicConstraints=critical,CA:false
|
||||
keyUsage=critical,digitalSignature
|
||||
extendedKeyUsage=clientAuth
|
||||
subjectAltName=DNS:client-api
|
||||
EOF
|
||||
flock secrets/operator/ca/ca.lock openssl ca -batch -notext -config secrets/operator/ca/openssl.cnf -extfile "$old/ext.cnf" \
|
||||
-startdate 200101000000Z -enddate 210101000000Z -in "$old/expired.csr" -out "$old/expired.crt" >/dev/null 2>&1
|
||||
reject expired
|
||||
wait "$load_pid"
|
||||
echo 'PASS: renewed leaf succeeds; old leaf revoked; expired leaf rejected; load results: evidence/pki-load.json'
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
temp=$(mktemp -d)
|
||||
trap 'rm -rf "$temp"' EXIT
|
||||
export PKI_DIR="$temp/certs" CA_DIR="$temp/ca"
|
||||
scripts/bootstrap-pki.sh >/dev/null
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -verify_hostname api "$PKI_DIR/api/api.crt"
|
||||
if openssl verify -CAfile "$PKI_DIR/ca.crt" -verify_hostname worker "$PKI_DIR/api/api.crt" >/dev/null 2>&1; then echo 'FAIL hostname accepted'; exit 1; fi
|
||||
cp "$PKI_DIR/client-api/client-api.crt" "$temp/old.crt"
|
||||
scripts/bootstrap-pki.sh client-api >/dev/null
|
||||
openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$PKI_DIR/client-api/client-api.crt"
|
||||
if openssl verify -CAfile "$PKI_DIR/ca.crt" -CRLfile "$PKI_DIR/ca.crl" -crl_check "$temp/old.crt" >"$temp/revoked.out" 2>&1; then echo 'FAIL revoked cert accepted'; exit 1; fi
|
||||
grep -q 'certificate revoked' "$temp/revoked.out"
|
||||
echo 'PASS: SAN verification; leaf renewal; previous leaf revoked by CRL'
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
# Dedicated caller IP on the private network; exercise both replicas through one ingress.
|
||||
headers=$(mktemp)
|
||||
trap 'rm -f "$headers"' EXIT
|
||||
instances=""
|
||||
for i in 1 2 3 4 5 6; do
|
||||
code=$(scripts/dc.sh run --rm -T --no-deps --entrypoint curl api \
|
||||
-sS --cacert /pki/ca.crt --connect-to localhost:8443:lb:443 \
|
||||
-X POST -H 'Authorization: Basic bm9uZXhpc3RlbnQ6d3Jvbmc=' \
|
||||
-D - -o - https://localhost:8443/api/v1/auth/sessions)
|
||||
printf '%s\n' "$code" > "$headers"
|
||||
instances+="$(tr -d '\r' < "$headers" | sed -n 's/^X-Instance-Id: //Ip') "
|
||||
if [[ "$i" -le 5 ]]; then
|
||||
[[ "$code" == *'401 Unauthorized'* ]] || { echo "FAIL: request $i expected 401"; exit 1; }
|
||||
else
|
||||
[[ "$code" == *'429 Too Many Requests'* ]]
|
||||
tr -d '\r' < "$headers" | grep -qi '^Retry-After: 60$'
|
||||
python3 - "$headers" <<'PYCODE'
|
||||
import json,sys
|
||||
raw=open(sys.argv[1]).read().split('\n\n',1)[1]
|
||||
j=json.loads(raw)['error']
|
||||
assert j['code']=='rate_limited' and j['request_id'] and j['message']
|
||||
PYCODE
|
||||
fi
|
||||
done
|
||||
[[ $(printf '%s\n' "$instances" | tr ' ' '\n' | sed '/^$/d' | sort -u | wc -l) -eq 2 ]] || { echo 'FAIL: both replicas must participate'; exit 1; }
|
||||
echo 'PASS: first 5 invalid logins return 401; sixth returns 429 with Retry-After: 60'
|
||||
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Runs public tests unchanged, checks hook scope and restores stopped replicas."""
|
||||
import argparse,json,os,subprocess,time
|
||||
from pathlib import Path
|
||||
from resilience_hooks import ROOT,DC,command,wait_ready
|
||||
|
||||
def main():
|
||||
p=argparse.ArgumentParser();p.add_argument('--mode',choices=['persistence','failover','all'],default='all');p.add_argument('--base-url',default=os.environ.get('BASE_URL','https://localhost:8443'));args=p.parse_args()
|
||||
os.environ['BASE_URL']=args.base_url
|
||||
# Fail before changing the stack if the host cannot run the delivered hardening.
|
||||
command([str(ROOT/'scripts/check-docker-hardening.sh')],timeout=15)
|
||||
command([str(ROOT/'scripts/bootstrap-openbao.sh')],timeout=100)
|
||||
up = DC+['up','-d','--no-build','--wait','--wait-timeout','90']
|
||||
try:
|
||||
command(up,timeout=100)
|
||||
except RuntimeError:
|
||||
# After unseal, previously failing workloads can still be in restart backoff.
|
||||
container_ids = command(DC+['ps','--all','--quiet','api','api2','worker']).split()
|
||||
if not container_ids:
|
||||
raise
|
||||
fmt = '{{index .Config.Labels "com.docker.compose.service"}} {{.State.Status}} {{if .State.Health}}{{.State.Health.Status}}{{else}}none{{end}}'
|
||||
states = command([str(ROOT/'scripts/docker.sh'),'inspect','--format',fmt,*container_ids])
|
||||
stale = []
|
||||
for line in states.splitlines():
|
||||
service, status, health = line.split()
|
||||
if status in ('restarting','exited') or health=='unhealthy':
|
||||
stale.append(service)
|
||||
if not stale:
|
||||
raise
|
||||
command(DC+['up','-d','--no-build','--no-deps','--force-recreate',*stale],timeout=90)
|
||||
command(up,timeout=100)
|
||||
wait_ready()
|
||||
modes=['persistence','failover'] if args.mode=='all' else [args.mode]
|
||||
summary={'base_url':args.base_url,'hardening':'main compose, NoNewPrivs=1 probe passed','tests':[]}
|
||||
try:
|
||||
for index,mode in enumerate(modes):
|
||||
if index:
|
||||
print('Waiting 61s for a fresh shared login limiter window.',flush=True)
|
||||
for _ in range(61):time.sleep(1)
|
||||
hook=ROOT/'evidence'/('resilience-'+mode+'-hook.json')
|
||||
previous_hook_mtime=hook.stat().st_mtime_ns if hook.exists() else None
|
||||
started=time.monotonic()
|
||||
result=subprocess.run(['python3',str(ROOT/'tests/resilience.py'),'--mode',mode,'--action-script',str(ROOT/'scripts'/('restart.sh' if mode=='persistence' else 'stop-one.sh')),'--base-url',args.base_url,'--ca-file',str(ROOT/'certs/ca.crt')],cwd=ROOT,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=220)
|
||||
# Public tests keep bearer tokens in memory and print only aggregate results.
|
||||
print(result.stdout,flush=True)
|
||||
entry={'mode':mode,'status':'PASS' if result.returncode==0 else 'FAIL','elapsed_seconds':round(time.monotonic()-started,3)}
|
||||
for line in result.stdout.splitlines():
|
||||
if line.startswith('{'):
|
||||
values=json.loads(line)
|
||||
entry['public_metrics']={k:values[k] for k in ['observed_instances_before','successful_writes','failed_attempts','first_recovery_seconds'] if k in values}
|
||||
if hook.exists() and hook.stat().st_mtime_ns!=previous_hook_mtime:
|
||||
entry['hook']=json.loads(hook.read_text())
|
||||
if entry.get('hook',{}).get('status')!='PASS':
|
||||
entry['status']='FAIL'
|
||||
summary['tests'].append(entry)
|
||||
if result.returncode:
|
||||
raise RuntimeError(f'Public {mode} test failed (exit {result.returncode})')
|
||||
if entry['status']!='PASS':
|
||||
raise RuntimeError(f'Missing or failed hook evidence for {mode}')
|
||||
print('PASS: '+mode+' data/session check AND real process/mount scope',flush=True)
|
||||
finally:
|
||||
# Restore even when failover assertions fail; never remove volumes.
|
||||
command(DC+['up','-d','--no-deps','--wait','--wait-timeout','60','api','api2'],timeout=70)
|
||||
(ROOT/'evidence/resilience-results.json').write_text(json.dumps(summary,indent=2,ensure_ascii=False)+'\n')
|
||||
if __name__=='__main__':main()
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec python3 scripts/test-resilience.py "$@"
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
import base64,json,ssl,time,urllib.request,urllib.parse,urllib.error
|
||||
from pathlib import Path
|
||||
ctx=ssl.create_default_context(cafile='certs/ca.crt')
|
||||
password=Path('secrets/operator/grafana-password').read_text().strip()
|
||||
headers={'Authorization':'Basic '+base64.b64encode(('admin:'+password).encode()).decode()}
|
||||
def get(path):
|
||||
r=urllib.request.Request('https://localhost:3000'+path,headers=headers)
|
||||
with urllib.request.urlopen(r,context=ctx,timeout=20) as response:return json.load(response)
|
||||
for uid in ['prometheus','loki']:
|
||||
for attempt in range(30):
|
||||
try:
|
||||
result=get('/api/datasources/uid/'+uid+'/health')
|
||||
assert result.get('status')=='OK',(uid,result.get('status'))
|
||||
break
|
||||
except urllib.error.HTTPError as e:
|
||||
if e.code not in (400,502,503) or attempt==29:raise
|
||||
time.sleep(1)
|
||||
up=get('/api/datasources/proxy/uid/prometheus/api/v1/query?query=up')
|
||||
assert any(x['value'][1]=='1' for x in up['data']['result'])
|
||||
traces=get('/api/datasources/proxy/uid/tempo/api/search?limit=1')
|
||||
assert traces.get('traces'),'No traces found'
|
||||
logs=get('/api/datasources/proxy/uid/loki/loki/api/v1/query_range?'+urllib.parse.urlencode({'query':'{service_name="messenger-api"}','limit':10,'start':str(time.time_ns()-120_000_000_000)}))
|
||||
assert logs['data']['result'],'No API logs found'
|
||||
print('PASS: Grafana mTLS datasource health; Prometheus TLS scrape up; traces and logs reach Tempo/Loki')
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
url="${BASE_URL:-https://localhost:8443}/health/ready"
|
||||
curl --noproxy '*' --silent --show-error --fail --cacert certs/ca.crt "$url" >/dev/null
|
||||
set +e
|
||||
curl --noproxy '*' --silent --output /dev/null "$url"
|
||||
rc=$?
|
||||
set -e
|
||||
[[ "$rc" == 60 ]] || { echo "FAIL: expected CA verification error 60, got $rc"; exit 1; }
|
||||
echo 'PASS: trusted CA succeeds; untrusted CA fails verification (60)'
|
||||
@@ -0,0 +1,17 @@
|
||||
# CVE scan runtime, 20.11.2026
|
||||
|
||||
Trivy 0.60.0, актуальная скачанная vulnerability DB. Источник: `evidence/image-scan-summary.json`. Scan выполнялся по `docker save` архиву API/Worker, без mounts secrets, private keys или Docker socket. Raw JSON остаётся в ignored `build/security-scan/reports/`. Scanner использовал отдельные cache/report directories; первоначальный слишком широкий mount был отклонён auto-review и не выполнялся.
|
||||
|
||||
До исправлений: Critical 0, High 0, Medium 38, Low 5. После: Critical 0, High 0, Medium 24, Low 5. В оставшихся строках Trivy нет указанного FixedVersion на дату проверки. Это результат сканера, а не утверждение об отсутствии всех уязвимостей.
|
||||
|
||||
Исправлены доступные обновления базового Ubuntu userspace, включая libc6/libc-bin 2.39-0ubuntu8.12 и perl-base 5.38.2-3.2ubuntu0.7: runtime выполняет `apt-get upgrade` перед установкой библиотек. Убраны избыточная distro-копия hiredis (используется отдельно собранная версия с SSL) и явная установка util-linux, нужная старому root entrypoint.
|
||||
|
||||
## Применимость и остаточный риск
|
||||
|
||||
- GnuTLS, Kerberos и SASL присутствуют транзитивно. Основной API TLS использует OpenSSL/libcurl/libpq; сервер БД настроен на SCRAM. GnuTLS server в процессе API не запускается. Это уменьшает заявленную поверхность, но не доказывает недостижимость каждой CVE через все транзитивные зависимости; строки остаются открытыми.
|
||||
- dash/tar/util-linux/login/passwd — userspace utilities, бизнес-обработчики не запускают их на данных пользователя. Контейнер non-root/read-only/cap_drop и отсутствие host mounts ограничивают последствия локального выполнения. Это компенсирующие меры, не исправление пакетов. `no-new-privileges` в этой Docker-среде проверен только как обязательная конфигурация: runtime limitation описан в отчёте.
|
||||
- libsystemd/libudev не означают, что в контейнере запущен systemd/udevd: PID 1 — C++ процесс. Нельзя переносить этот факт на все library-call сценарии без анализа конкретного advisory.
|
||||
- Trivy OS scan не строит полный SBOM статически собранных libpqxx/MinIO C++/OTel C++/hiredis. Удаление distro hiredis убирает неиспользуемую копию, но само по себе не является исправлением исходной библиотеки. В первом отчёте vendor mapping дал CVE-2026-88382 для distro hiredis; описание указывало commit после v1.5.0, тогда как здесь pinned v1.2.0. Применимость к исходной версии отдельно не подтверждена и не закрыта. Требуется upstream/source audit, а не трактовка исчезнувшей строки как устранения риска.
|
||||
- Этот запуск не охватывает образы PostgreSQL, Valkey, MinIO, OpenBao, Envoy и Grafana/backends. Перед production нужны scans всех images, immutable digests и SBOM исходных C++ зависимостей. Стенд не заявляется аттестованным или готовым к реальному production.
|
||||
|
||||
Повтор: `scripts/scan-image.sh lab7-api:local`. Для Snap Docker в этой среде можно задать `DOCKER_BIN=/snap/docker/current/bin/docker`; scanner сохраняет обязательный `no-new-privileges`, поэтому его обычный запуск также требует исправления host runtime. Диагностический scan здесь выполнялся без этого одного флага, с прочими ограничениями и без доступа к секретам.
|
||||
@@ -0,0 +1,22 @@
|
||||
# Модель угроз lab7
|
||||
|
||||
Активы: пароли и session tokens, сообщения и ACL чатов, оригиналы/варианты вложений, очередь и outbox, private keys, AppRole SecretID, DB/S3 credentials, audit trail. Оператор/host/Docker daemon доверены. Worker и другие сервисы могут быть скомпрометированы по отдельности; контейнерная сеть не является доказательством identity. Компрометация host, CA key или Docker daemon вне модели.
|
||||
|
||||
| Угроза | Контроль | Воспроизводимая проверка |
|
||||
|---|---|---|
|
||||
| MITM или подмена hostname | CA + SAN verify-full/SSL_set1_host/libcurl, TLS-only listeners | test-tls-untrusted.sh; test-pki-offline.sh |
|
||||
| Подключение к API без сертификата | Envoy require_client_certificate; C++ только на loopback | test-mtls-no-cert.sh |
|
||||
| Worker предъявляет валидный cert для входа в API | Точная allowlist SAN client-api | test-mtls-wrong-identity.sh |
|
||||
| Кража AppRole Worker для получения API/root secret | Отдельные policies KV/DB, token TTL/maxTTL, изолированные mounts | test-openbao-policy.py |
|
||||
| Компрометация DB identity worker | LOGIN без SUPERUSER/CREATEROLE, ограниченные grants, отдельный operator migration boundary | test-dependency-acl.py |
|
||||
| Offline подбор паролей и online login DoS | Argon2id 64 MiB/t2/p1, общий Redis limit 5/min/IP, 2 HTTP worker threads/реплику | auth_security_test.cpp; test-rate-limit.sh |
|
||||
| Кража session store | SHA256 digest random 256-bit bearer tokens; TTL/logout | public smoke/logout, test-dependency-acl.py |
|
||||
| Чтение вложения посторонним, spoofed X-User-Id | Сохранён lab6 Bearer + chat ACL; приватный S3 bucket | public smoke и tests attachments |
|
||||
| Старый/просроченный сертификат | Короткий TTL, CRL у ingress/API/telemetry/DB, restart закрывает старые TCP sessions | test-pki-lifecycle.sh |
|
||||
| Доступ к broker через identity другого сервиса | mTLS + раздельные ACL username/password, ограниченные key patterns/commands | test-dependency-acl.py |
|
||||
| Доступ к telemetry ingest произвольного контейнера | Envoy SAN allowlist; backend локален в namespace proxy | test-collector-mtls.sh |
|
||||
| Запись в образ / privilege escalation | non-root/read_only/cap_drop/no-new-privileges, tmpfs и CPU/RAM/pids limits | test_secure_config.py; runtime host limitation в REPORT.md |
|
||||
|
||||
Bootstrap trust: публичный CA доставляется через read-only bind mount. AppRole RoleID/SecretID выдаёт оператор в отдельные service каталоги; в Git/образе bootstrap credential нет. Учебный unseal 1-of-1 автоматизирован для стенда; это не production custody: для реальной эксплуатации нужны offline shares/внешний auto-unseal, защищённое хранение CA и перенос root token с host.
|
||||
|
||||
Известные границы: Redis проверяет client CA, ACL определяет роль (нет SAN→username binding); CRL native S3/Redis/OpenBao не заявляется. Worker обрабатывает общий staging, не является tenant-isolated sandbox. Выбран PKI track, а не worker compromise track. Renew/restart не гарантирует zero-downtime; результаты краткой нагрузки сохраняются отдельно.
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "telemetry.hpp"
|
||||
#include "attachment_queue.hpp"
|
||||
#include "errors.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
void AttachmentQueue::publish(const std::string& payload) {
|
||||
auto lease = pool_.acquire();
|
||||
std::unique_ptr<redisReply, decltype(&freeReplyObject)> reply(
|
||||
static_cast<redisReply*>(redisCommand(
|
||||
lease.ctx(), "XADD jobs:attachments * payload %b",
|
||||
payload.data(), payload.size())), &freeReplyObject);
|
||||
if (!reply || reply->type != REDIS_REPLY_STRING || reply->len == 0) {
|
||||
throw DependencyUnavailable("attachment queue publish failed");
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
using Reply = std::unique_ptr<redisReply, decltype(&freeReplyObject)>;
|
||||
Reply checked(redisReply* reply) {
|
||||
Reply owned(reply, &freeReplyObject);
|
||||
if (!owned || owned->type == REDIS_REPLY_ERROR) {
|
||||
throw DependencyUnavailable("attachment stream command failed");
|
||||
}
|
||||
return owned;
|
||||
}
|
||||
JobDelivery delivery(const redisReply* entry) {
|
||||
if (entry->type != REDIS_REPLY_ARRAY || entry->elements != 2 ||
|
||||
entry->element[0]->type != REDIS_REPLY_STRING ||
|
||||
entry->element[1]->type != REDIS_REPLY_ARRAY) {
|
||||
throw DependencyUnavailable("invalid stream response");
|
||||
}
|
||||
JobDelivery result{std::string(entry->element[0]->str, entry->element[0]->len), {}};
|
||||
const auto* fields = entry->element[1];
|
||||
for (std::size_t i = 0; i + 1 < fields->elements; i += 2) {
|
||||
if (fields->element[i]->type == REDIS_REPLY_STRING &&
|
||||
std::string(fields->element[i]->str, fields->element[i]->len) == "payload" &&
|
||||
fields->element[i + 1]->type == REDIS_REPLY_STRING && fields->element[i + 1]->len <= 4096) {
|
||||
result.payload.assign(fields->element[i + 1]->str, fields->element[i + 1]->len);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void AttachmentQueue::ensure_group() {
|
||||
auto lease = pool_.acquire();
|
||||
Reply reply(static_cast<redisReply*>(redisCommand(lease.ctx(),
|
||||
"XGROUP CREATE jobs:attachments attachment-workers 0 MKSTREAM")), &freeReplyObject);
|
||||
if (!reply || (reply->type == REDIS_REPLY_ERROR &&
|
||||
std::string(reply->str, reply->len).rfind("BUSYGROUP", 0) != 0)) {
|
||||
throw DependencyUnavailable("attachment consumer group unavailable");
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<JobDelivery> AttachmentQueue::read(const std::string& consumer, int reclaim_idle_ms) {
|
||||
auto lease = pool_.acquire();
|
||||
auto pending = checked(static_cast<redisReply*>(redisCommand(lease.ctx(),
|
||||
"XAUTOCLAIM jobs:attachments attachment-workers %s %d %s COUNT 1",
|
||||
consumer.c_str(), reclaim_idle_ms, claim_cursor_.c_str())));
|
||||
if (pending->type != REDIS_REPLY_ARRAY || pending->elements < 2 ||
|
||||
pending->element[0]->type != REDIS_REPLY_STRING ||
|
||||
pending->element[1]->type != REDIS_REPLY_ARRAY) {
|
||||
throw DependencyUnavailable("invalid pending response");
|
||||
}
|
||||
claim_cursor_.assign(pending->element[0]->str, pending->element[0]->len);
|
||||
if (pending->element[1]->elements) return delivery(pending->element[1]->element[0]);
|
||||
auto fresh = checked(static_cast<redisReply*>(redisCommand(lease.ctx(),
|
||||
"XREADGROUP GROUP attachment-workers %s COUNT 1 BLOCK 1000 STREAMS jobs:attachments >",
|
||||
consumer.c_str())));
|
||||
if (fresh->type == REDIS_REPLY_NIL) return std::nullopt;
|
||||
if (fresh->type != REDIS_REPLY_ARRAY || fresh->elements != 1 ||
|
||||
fresh->element[0]->type != REDIS_REPLY_ARRAY || fresh->element[0]->elements != 2 ||
|
||||
fresh->element[0]->element[1]->type != REDIS_REPLY_ARRAY ||
|
||||
fresh->element[0]->element[1]->elements != 1) {
|
||||
throw DependencyUnavailable("invalid stream read response");
|
||||
}
|
||||
return delivery(fresh->element[0]->element[1]->element[0]);
|
||||
}
|
||||
|
||||
void AttachmentQueue::ack(const std::string& stream_id) {
|
||||
auto lease = pool_.acquire();
|
||||
checked(static_cast<redisReply*>(redisCommand(lease.ctx(),
|
||||
"XACK jobs:attachments attachment-workers %s", stream_id.c_str())));
|
||||
}
|
||||
|
||||
void AttachmentQueue::reject(const std::string& stream_id) {
|
||||
{
|
||||
auto lease = pool_.acquire();
|
||||
checked(static_cast<redisReply*>(redisCommand(lease.ctx(),
|
||||
"XADD jobs:attachments:invalid * stream_id %s error_code invalid_job", stream_id.c_str())));
|
||||
}
|
||||
ack(stream_id);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user