This commit is contained in:
@@ -51,6 +51,7 @@ help:
|
|||||||
@echo "Отказы API (по запросу): test-persistence | test-failover"
|
@echo "Отказы API (по запросу): test-persistence | test-failover"
|
||||||
@echo "Автономный прогон с удалением тестового стенда: test-suite"
|
@echo "Автономный прогон с удалением тестового стенда: test-suite"
|
||||||
@echo "Наблюдаемость: test-observability; полный прогон с очисткой: verify"
|
@echo "Наблюдаемость: test-observability; полный прогон с очисткой: verify"
|
||||||
|
@echo "Трек 1: test-worker-compromise"
|
||||||
|
|
||||||
init:
|
init:
|
||||||
$(PYTHON) -m scripts.init_local
|
$(PYTHON) -m scripts.init_local
|
||||||
@@ -176,3 +177,7 @@ test-suite:
|
|||||||
.PHONY: scan-security
|
.PHONY: scan-security
|
||||||
scan-security:
|
scan-security:
|
||||||
$(PYTHON) -m scripts.scan_security
|
$(PYTHON) -m scripts.scan_security
|
||||||
|
|
||||||
|
.PHONY: test-worker-compromise
|
||||||
|
test-worker-compromise:
|
||||||
|
$(PYTHON) -m scripts.worker_experiment
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Защитить работающий мессенджер на границах доверия и показать защиту отрицательными проверками: чужой доступ, неверный сертификат, недостаточные права и отзыв credentials.
|
Защитить работающий мессенджер на границах доверия и показать защиту отрицательными проверками: чужой доступ, неверный сертификат, недостаточные права и отзыв credentials.
|
||||||
|
|
||||||
В репозитории реализован уровень «4». Перенесённый мессенджер работает через HTTPS, внутренняя связь nginx с API требует mTLS, а сервисы получают пароли PostgreSQL по ограниченным политикам OpenBao. RabbitMQ и Collector проверяют отдельные сертификаты сервисов.
|
В репозитории реализован уровень «5» по треку «Компрометация worker». Перенесённый мессенджер работает через HTTPS, внутренняя связь nginx с API требует mTLS, а сервисы получают пароли PostgreSQL по ограниченным политикам OpenBao. RabbitMQ и Collector проверяют отдельные сертификаты сервисов.
|
||||||
|
|
||||||
[Карта курса](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)
|
[Карта курса](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)
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
Весь уровень 4 **и один законченный трек на выбор**. Приведите гипотезу, повторяемую методику, результаты и ограничения.
|
Весь уровень 4 **и один законченный трек на выбор**. Приведите гипотезу, повторяемую методику, результаты и ограничения.
|
||||||
|
|
||||||
**Трек 1. Компрометация worker.** На изолированном стенде смоделируйте получение прав worker: покажите, какие bucket-prefix, queue и DB-операции доступны, а какие запрещены. Отзовите identity, ротируйте связанный secret, восстановите обработку и докажите сохранность задач. Сопоставьте последствия до/после least privilege.
|
**Трек 1. Компрометация worker.** На изолированном стенде смоделируйте получение прав worker: покажите, какие bucket-prefix, queue и DB-операции доступны, а какие запрещены. Отзовите identity, ротируйте связанный secret, восстановите обработку и докажите сохранность задач. Сопоставьте последствия до/после least privilege. Эксперимент запускается через `make test-worker-compromise`. [Результаты](security/WORKER_COMPROMISE.md)
|
||||||
|
|
||||||
**Трек 2. Жизненный цикл PKI/secrets.** Автоматизируйте выдачу короткоживущих cert/credentials, renewal и безопасный rollover CA/leaf. Проведите тест истечения/отзыва под нагрузкой, измерьте ошибки и восстановление; покажите отсутствие fallback на plaintext/проверку сертификата off. Обоснуйте хранение CA, bootstrap и аудит.
|
**Трек 2. Жизненный цикл PKI/secrets.** Автоматизируйте выдачу короткоживущих cert/credentials, renewal и безопасный rollover CA/leaf. Проведите тест истечения/отзыва под нагрузкой, измерьте ошибки и восстановление; покажите отсутствие fallback на plaintext/проверку сертификата off. Обоснуйте хранение CA, bootstrap и аудит.
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Отчёт по лабораторной 7
|
# Отчёт по лабораторной 7
|
||||||
|
|
||||||
- Автор: Григорян Илья Мурадович, БПИ2303.
|
- Автор: Григорян Илья Мурадович, БПИ2303.
|
||||||
- Цель: оценка «4».
|
- Цель: оценка «5», трек 1 «Компрометация worker».
|
||||||
- Реализация и проверки подготовлены с помощью Codex.
|
- Реализация и проверки подготовлены с помощью Codex.
|
||||||
|
|
||||||
## Запуск
|
## Запуск
|
||||||
@@ -60,3 +60,11 @@ OpenBao и хранилища работают в одном экземпляр
|
|||||||
[Итоговый прогон](evidence/verification.json) · [Наблюдаемость и нагрузка](evidence/observability.json) · [Сканирование](evidence/security-scan.json) · [Очистка стенда](evidence/cleanup.json)
|
[Итоговый прогон](evidence/verification.json) · [Наблюдаемость и нагрузка](evidence/observability.json) · [Сканирование](evidence/security-scan.json) · [Очистка стенда](evidence/cleanup.json)
|
||||||
|
|
||||||
После проверок удалены 19 контейнеров, 9 томов, 2 сети и 3 образа приложения. Базовые образы сервисов сохранены.
|
После проверок удалены 19 контейнеров, 9 томов, 2 сети и 3 образа приложения. Базовые образы сервисов сохранены.
|
||||||
|
|
||||||
|
## Трек 1. Компрометация worker
|
||||||
|
|
||||||
|
Гипотеза: штатные права worker сокращают последствия утечки учётных данных, а отзыв и ротация сохраняют уже принятое задание. Временный профиль с широкими правами разрешил 18 из 18 операций, штатный — 9 из 18. Ограничения закрыли доступ к таблицам пользователей и сообщений, чужой очереди и содержимому чужих объектов S3. Имена объектов оставались видимы через `ListBucket`.
|
||||||
|
|
||||||
|
После отзыва прежних учётных данных в RabbitMQ осталось одно задание. После ротации сертификатов и секретов оно перешло из `queued` в `ready` с тем же ID за одну попытку. С начала отзыва до наблюдения `ready` прошло 21,35 с. Подтверждены совпадение оригинала, три варианта вложения, отсутствие дубликата сообщения и пустая очередь после подтверждения. Worker запустился из прежнего образа.
|
||||||
|
|
||||||
|
`make test-worker-compromise` воспроизводит эксперимент на отдельном стенде и удаляет его ресурсы. [Методика и результат](security/WORKER_COMPROMISE.md) · [Данные прогона](evidence/worker-compromise.json)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
- `verification.json` содержит этапы итогового прогона на отдельном тестовом проекте.
|
- `verification.json` содержит этапы итогового прогона на отдельном тестовом проекте.
|
||||||
- `observability.json` содержит агрегаты нагрузочного прогона, результаты проверок телеметрии и сценарии восстановления.
|
- `observability.json` содержит агрегаты нагрузочного прогона, результаты проверок телеметрии и сценарии восстановления.
|
||||||
- `security-scan.json` содержит результаты повторного скана зависимостей и трёх образов. Разбор находится в [security/SCAN.md](../security/SCAN.md).
|
- `security-scan.json` содержит результаты повторного скана зависимостей и трёх образов. Разбор находится в [security/SCAN.md](../security/SCAN.md).
|
||||||
|
- `worker-compromise.json` содержит сравнение прав, результаты отзыва и состояние задания до и после восстановления.
|
||||||
- `cleanup.json` подтверждает удаление ресурсов тестового стенда и тегов образов приложения после записи отчёта.
|
- `cleanup.json` подтверждает удаление ресурсов тестового стенда и тегов образов приложения после записи отчёта.
|
||||||
|
|
||||||
Полные логи, файлы ключей, пароли, токены и материалы распечатывания хранятся локально вне Git.
|
Полные логи, файлы ключей, пароли, токены и материалы распечатывания хранятся локально вне Git.
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
{
|
||||||
|
"result": "PASS",
|
||||||
|
"broad": {
|
||||||
|
"postgresql": {
|
||||||
|
"read_jobs": true,
|
||||||
|
"update_jobs": true,
|
||||||
|
"read_users": true,
|
||||||
|
"update_users": true,
|
||||||
|
"read_messages": true
|
||||||
|
},
|
||||||
|
"rabbitmq": {
|
||||||
|
"configure_jobs": true,
|
||||||
|
"read_jobs": true,
|
||||||
|
"configure_private": true,
|
||||||
|
"read_private": true,
|
||||||
|
"publish_private": true
|
||||||
|
},
|
||||||
|
"s3": {
|
||||||
|
"list_private_names": true,
|
||||||
|
"read_staging": true,
|
||||||
|
"write_staging": true,
|
||||||
|
"write_originals": true,
|
||||||
|
"write_variants": true,
|
||||||
|
"read_private": true,
|
||||||
|
"write_private": true,
|
||||||
|
"delete_staging": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"least_privilege": {
|
||||||
|
"postgresql": {
|
||||||
|
"read_jobs": true,
|
||||||
|
"update_jobs": true,
|
||||||
|
"read_users": false,
|
||||||
|
"update_users": false,
|
||||||
|
"read_messages": false
|
||||||
|
},
|
||||||
|
"rabbitmq": {
|
||||||
|
"configure_jobs": true,
|
||||||
|
"read_jobs": true,
|
||||||
|
"configure_private": false,
|
||||||
|
"read_private": false,
|
||||||
|
"publish_private": false
|
||||||
|
},
|
||||||
|
"s3": {
|
||||||
|
"list_private_names": true,
|
||||||
|
"read_staging": true,
|
||||||
|
"write_staging": false,
|
||||||
|
"write_originals": true,
|
||||||
|
"write_variants": true,
|
||||||
|
"read_private": false,
|
||||||
|
"write_private": false,
|
||||||
|
"delete_staging": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"revoked_access": {
|
||||||
|
"rabbitmq": {
|
||||||
|
"connect": false
|
||||||
|
},
|
||||||
|
"collector": false,
|
||||||
|
"s3": {
|
||||||
|
"read_staging": false
|
||||||
|
},
|
||||||
|
"postgresql": false,
|
||||||
|
"openbao": false
|
||||||
|
},
|
||||||
|
"job": {
|
||||||
|
"before": {
|
||||||
|
"id": "722c988b-9532-4a9c-a17d-b39422c9f9c5",
|
||||||
|
"attempt": 0,
|
||||||
|
"published_attempt": 1,
|
||||||
|
"status": "queued"
|
||||||
|
},
|
||||||
|
"after": {
|
||||||
|
"id": "722c988b-9532-4a9c-a17d-b39422c9f9c5",
|
||||||
|
"attempt": 1,
|
||||||
|
"published_attempt": 1,
|
||||||
|
"status": "ready"
|
||||||
|
},
|
||||||
|
"queued_during_revocation": 1,
|
||||||
|
"queue_after_ack": 0,
|
||||||
|
"recovery_seconds": 21.35,
|
||||||
|
"original_sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
|
||||||
|
"variants": [
|
||||||
|
"crop",
|
||||||
|
"optimized",
|
||||||
|
"thumbnail"
|
||||||
|
],
|
||||||
|
"message_occurrences": 1,
|
||||||
|
"worker_image_preserved": true
|
||||||
|
},
|
||||||
|
"stand_removed": true
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
"""Идемпотентный private bucket и отдельная ограниченная учётная запись API."""
|
"""Идемпотентный private bucket и отдельная ограниченная учётная запись API."""
|
||||||
|
|
||||||
|
from contextlib import contextmanager
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -18,13 +19,10 @@ def secret(name):
|
|||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
def main():
|
@contextmanager
|
||||||
|
def operator():
|
||||||
endpoint = os.environ["S3_ENDPOINT"]
|
endpoint = os.environ["S3_ENDPOINT"]
|
||||||
bucket = os.environ["S3_BUCKET"]
|
|
||||||
root_user, root_password = secret("minio_root_user"), secret("minio_root_password")
|
root_user, root_password = secret("minio_root_user"), secret("minio_root_password")
|
||||||
access, password = secret("s3_access_key_id"), secret("s3_secret_access_key")
|
|
||||||
if access == root_user:
|
|
||||||
raise ValueError("API не должен использовать root credentials")
|
|
||||||
ca = Path("/run/tls/ca.crt")
|
ca = Path("/run/tls/ca.crt")
|
||||||
context = ssl.create_default_context(cafile=str(ca))
|
context = ssl.create_default_context(cafile=str(ca))
|
||||||
deadline = time.monotonic() + 60
|
deadline = time.monotonic() + 60
|
||||||
@@ -71,9 +69,18 @@ def main():
|
|||||||
)
|
)
|
||||||
if result.returncode:
|
if result.returncode:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
"Ошибка bootstrap MinIO; значения credentials скрыты"
|
f"Ошибка операции MinIO {args[0]}; значения credentials скрыты"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
yield mc, config
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
bucket = os.environ["S3_BUCKET"]
|
||||||
|
access, password = secret("s3_access_key_id"), secret("s3_secret_access_key")
|
||||||
|
if access == secret("minio_root_user"):
|
||||||
|
raise ValueError("API не должен использовать root credentials")
|
||||||
|
with operator() as (mc, config):
|
||||||
mc("mb", "--ignore-existing", "storage/" + bucket)
|
mc("mb", "--ignore-existing", "storage/" + bucket)
|
||||||
mc("anonymous", "set", "none", "storage/" + bucket)
|
mc("anonymous", "set", "none", "storage/" + bucket)
|
||||||
policy = {
|
policy = {
|
||||||
|
|||||||
@@ -0,0 +1,315 @@
|
|||||||
|
"""Сравнивает права worker и проверяет сохранность задания при отзыве доступа."""
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
import secrets
|
||||||
|
import shutil
|
||||||
|
import socket
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from tempfile import TemporaryDirectory
|
||||||
|
import time
|
||||||
|
from uuid import UUID, uuid4
|
||||||
|
|
||||||
|
from scripts.bootstrap_bao import Bao, TLS, bootstrap, operator_token
|
||||||
|
from scripts.check_lifecycle import deny
|
||||||
|
from scripts.deployment import ROOT, ComposeProject, inventory
|
||||||
|
from scripts.init_local import main as initialize
|
||||||
|
from scripts.init_tls import issue
|
||||||
|
from scripts.rotate_worker import change_db_password, rotate
|
||||||
|
from tests.client import Client
|
||||||
|
|
||||||
|
PREFIX = "messenger-worker-lab-"
|
||||||
|
PROBE = "scripts/worker_probe.py"
|
||||||
|
RESULT = Path("evidence/worker-compromise.json")
|
||||||
|
S3_OPERATOR = """
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import sys
|
||||||
|
from bootstrap import operator
|
||||||
|
|
||||||
|
access = Path("/run/credentials/worker_access_key_id").read_text().strip()
|
||||||
|
bucket = os.environ["S3_BUCKET"]
|
||||||
|
with operator() as (mc, config):
|
||||||
|
phase = sys.argv[1]
|
||||||
|
if phase == "broad":
|
||||||
|
fixture = config / "fixture"
|
||||||
|
fixture.write_bytes(b"synthetic worker experiment")
|
||||||
|
for key in ("staging/experiment/fixture", "private/experiment/fixture",
|
||||||
|
"staging/experiment/delete-broad", "staging/experiment/delete-limited"):
|
||||||
|
mc("cp", str(fixture), f"storage/{bucket}/{key}")
|
||||||
|
mc("admin", "policy", "attach", "storage", "readwrite", "--user", access)
|
||||||
|
elif phase == "limited":
|
||||||
|
mc("admin", "policy", "detach", "storage", "readwrite", "--user", access)
|
||||||
|
elif phase == "revoke":
|
||||||
|
mc("admin", "user", "disable", "storage", access)
|
||||||
|
else:
|
||||||
|
raise ValueError("Неизвестная фаза проверки")
|
||||||
|
"""
|
||||||
|
LIMITED_DENIALS = {
|
||||||
|
"postgresql": {"read_users", "update_users", "read_messages"},
|
||||||
|
"rabbitmq": {"configure_private", "read_private", "publish_private"},
|
||||||
|
"s3": {"write_staging", "read_private", "write_private"},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def wait_for(operation, description, timeout=60):
|
||||||
|
deadline = time.monotonic() + timeout
|
||||||
|
while time.monotonic() < deadline:
|
||||||
|
value = operation()
|
||||||
|
if value:
|
||||||
|
return value
|
||||||
|
time.sleep(0.5)
|
||||||
|
raise RuntimeError(description)
|
||||||
|
|
||||||
|
|
||||||
|
def database(project, sql):
|
||||||
|
return project.run(
|
||||||
|
"exec", "-T", "postgres", "sh", "-ec",
|
||||||
|
'psql -XAt -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -d "$POSTGRES_DB"',
|
||||||
|
input_text=sql,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def broker(project, *args):
|
||||||
|
return project.run("exec", "-T", "broker", "rabbitmqctl", *args, timeout=30)
|
||||||
|
|
||||||
|
|
||||||
|
def minio(project, phase):
|
||||||
|
project.run("run", "--rm", "--no-deps", "-T", "--entrypoint", "python",
|
||||||
|
"minio-bootstrap", "-c", S3_OPERATOR, phase)
|
||||||
|
|
||||||
|
|
||||||
|
def probe(project, phase, payload=None):
|
||||||
|
output = project.run(
|
||||||
|
"run", "--rm", "--no-deps", "-T", "--volume", f"{ROOT / PROBE}:/app/worker_probe.py:ro",
|
||||||
|
"--entrypoint", "python", "worker", "-m", "worker_probe", phase,
|
||||||
|
input_text=json.dumps(payload) if payload else None,
|
||||||
|
)
|
||||||
|
return json.loads(output)
|
||||||
|
|
||||||
|
|
||||||
|
def job_state(project, attachment_id):
|
||||||
|
attachment_id = UUID(attachment_id)
|
||||||
|
output = database(project, f"""
|
||||||
|
SELECT json_build_object('id', j.id, 'attempt', j.attempt,
|
||||||
|
'published_attempt', j.published_attempt, 'status', a.status)
|
||||||
|
FROM attachment_jobs j JOIN attachments a ON a.id = j.attachment_id
|
||||||
|
WHERE j.attachment_id = '{attachment_id}'::uuid;
|
||||||
|
""")
|
||||||
|
rows = output.splitlines()
|
||||||
|
assert len(rows) == 1, "У вложения должно быть ровно одно задание"
|
||||||
|
return json.loads(rows[0])
|
||||||
|
|
||||||
|
|
||||||
|
def queue_ready(project, queue):
|
||||||
|
rows = json.loads(broker(project, "list_queues", "--formatter=json", "name", "messages_ready",
|
||||||
|
"messages_unacknowledged", "durable"))
|
||||||
|
state = next(row for row in rows if row["name"] == queue)
|
||||||
|
assert state["durable"]
|
||||||
|
return state["messages_ready"] if state["messages_unacknowledged"] == 0 else None
|
||||||
|
|
||||||
|
|
||||||
|
def assert_profiles(broad, limited):
|
||||||
|
assert set(broad) == set(limited) == set(LIMITED_DENIALS)
|
||||||
|
for service, denials in LIMITED_DENIALS.items():
|
||||||
|
assert broad[service].keys() == limited[service].keys()
|
||||||
|
assert all(broad[service].values()), service
|
||||||
|
assert {key for key, value in limited[service].items() if not value} == denials, service
|
||||||
|
|
||||||
|
|
||||||
|
def recover_service_identities(project, definitions, permission):
|
||||||
|
# Новые CN оставляют старые сертификаты пригодными только для проверки отказа.
|
||||||
|
issue(TLS, "attachment-worker-recovered", "DNS:attachment-worker-recovered",
|
||||||
|
"clientAuth", "broker-client-ca")
|
||||||
|
issue(TLS, "otel-worker-recovered", "DNS:otel-worker-recovered",
|
||||||
|
"clientAuth", "otel-ingest-ca")
|
||||||
|
original = next(user for user in definitions["users"] if user["name"] == "attachment-worker")
|
||||||
|
identity = "attachment-worker-recovered"
|
||||||
|
replacement = {
|
||||||
|
"users": [{**original, "name": identity}],
|
||||||
|
"permissions": [{**permission, "user": identity}],
|
||||||
|
}
|
||||||
|
project.run(
|
||||||
|
"exec", "-T", "broker", "sh", "-ec",
|
||||||
|
'file=$(mktemp); trap \'rm -f "$file"\' EXIT; cat >"$file"; rabbitmqctl import_definitions "$file"',
|
||||||
|
input_text=json.dumps(replacement),
|
||||||
|
)
|
||||||
|
collector = ROOT / "infra/otel/collector-scrape.conf"
|
||||||
|
collector.write_text(collector.read_text().replace(
|
||||||
|
"CN=otel-worker 0;", "CN=otel-worker-recovered 1;"
|
||||||
|
))
|
||||||
|
project.run("exec", "-T", "collector-scrape", "nginx", "-s", "reload")
|
||||||
|
|
||||||
|
for file in ("worker_s3_access_key_id", "worker_s3_secret_access_key"):
|
||||||
|
target = ROOT / "secrets" / file
|
||||||
|
temporary = target.with_suffix(".new")
|
||||||
|
temporary.write_text(secrets.token_urlsafe(24))
|
||||||
|
temporary.chmod(0o444)
|
||||||
|
temporary.replace(target)
|
||||||
|
project.run("run", "--rm", "--no-deps", "-T", "minio-bootstrap")
|
||||||
|
|
||||||
|
compose = ROOT / "compose.yaml"
|
||||||
|
config = compose.read_text()
|
||||||
|
for name in ("attachment-worker", "otel-worker"):
|
||||||
|
config = config.replace(f"./secrets/tls/{name}.", f"./secrets/tls/{name}-recovered.")
|
||||||
|
compose.write_text(config)
|
||||||
|
|
||||||
|
|
||||||
|
def experiment(port, ingress):
|
||||||
|
project_name = os.environ.get("COMPOSE_PROJECT_NAME", "")
|
||||||
|
if (Path.cwd() != ROOT or ROOT.parent != Path("/tmp") or not ROOT.name.startswith(PREFIX)
|
||||||
|
or not re.fullmatch(r"messenger-worker-lab-[0-9a-f]{12}", project_name)):
|
||||||
|
raise RuntimeError("Эксперимент выполняется только во временной копии")
|
||||||
|
if (ROOT / ".env").exists() or any(inventory([project_name]).values()):
|
||||||
|
raise RuntimeError("Для эксперимента нужны новые локальные настройки и тома")
|
||||||
|
|
||||||
|
initialize()
|
||||||
|
lifecycle = ComposeProject()
|
||||||
|
try:
|
||||||
|
lifecycle.run("up", "-d", "openbao", timeout=90)
|
||||||
|
bootstrap(port)
|
||||||
|
lifecycle.run("up", "-d", "--build", "--wait", "--wait-timeout", "180", timeout=600)
|
||||||
|
lifecycle.run("stop", "worker")
|
||||||
|
definitions = json.loads((ROOT / "secrets/broker_definitions.json").read_text())
|
||||||
|
permission = next(item for item in definitions["permissions"]
|
||||||
|
if item["user"] == "attachment-worker")
|
||||||
|
queue = lifecycle.config["services"]["worker"]["environment"]["BROKER_QUEUE"]
|
||||||
|
|
||||||
|
def set_permissions(configure, read, write):
|
||||||
|
broker(lifecycle, "set_permissions", "-p", permission["vhost"],
|
||||||
|
"attachment-worker", configure, write, read)
|
||||||
|
|
||||||
|
database(lifecycle, "GRANT SELECT, UPDATE ON users TO worker; GRANT SELECT ON messages TO worker;")
|
||||||
|
set_permissions(".*", ".*", ".*")
|
||||||
|
minio(lifecycle, "broad")
|
||||||
|
broad = probe(lifecycle, "broad")
|
||||||
|
database(lifecycle, "REVOKE SELECT, UPDATE ON users FROM worker; REVOKE SELECT ON messages FROM worker;")
|
||||||
|
set_permissions(permission["configure"], permission["read"], permission["write"])
|
||||||
|
minio(lifecycle, "limited")
|
||||||
|
limited = probe(lifecycle, "limited")
|
||||||
|
assert_profiles(broad, limited)
|
||||||
|
print("PASS: проверены широкая и ограниченная роли", flush=True)
|
||||||
|
|
||||||
|
client = Client(f"https://localhost:{ingress}", str(TLS / "ca.crt"))
|
||||||
|
actor, _, _, chat = client.bootstrap()
|
||||||
|
attachment, content = client.attachment(actor, chat)
|
||||||
|
message = client.message(actor, chat, "", attachments=[attachment["id"]])["json"]
|
||||||
|
before = wait_for(
|
||||||
|
lambda: job_state(lifecycle, attachment["id"]) if queue_ready(lifecycle, queue) == 1 else None,
|
||||||
|
"Задание не попало в RabbitMQ",
|
||||||
|
)
|
||||||
|
assert before["status"] == "queued" and before["published_attempt"] == 1
|
||||||
|
assert before["attempt"] == 0
|
||||||
|
|
||||||
|
operator, root_token = Bao(port), operator_token(port)
|
||||||
|
old_identity = Bao(port, TLS / "worker-bao.crt", TLS / "worker-bao.key")
|
||||||
|
old_token = old_identity.call("auth/cert/login", {"name": "worker"})["auth"]
|
||||||
|
secret_path = "messenger/data/worker"
|
||||||
|
password = old_identity.call(secret_path, token=old_token["client_token"])["data"]["data"]["db_password"]
|
||||||
|
started = time.monotonic()
|
||||||
|
operator.call("auth/cert/certs/worker", token=root_token, method="DELETE")
|
||||||
|
operator.call("auth/token/revoke-accessor", {"accessor": old_token["accessor"]}, token=root_token)
|
||||||
|
broker(lifecycle, "delete_user", "attachment-worker")
|
||||||
|
minio(lifecycle, "revoke")
|
||||||
|
change_db_password(lifecycle, secrets.token_urlsafe(24))
|
||||||
|
revoked_db = probe(lifecycle, "old-db", {"old_db_password": password})["old_db"]
|
||||||
|
assert not revoked_db
|
||||||
|
collector = ROOT / "infra/otel/collector-scrape.conf"
|
||||||
|
collector.write_text(collector.read_text().replace("CN=otel-worker 1;", "CN=otel-worker 0;"))
|
||||||
|
lifecycle.run("exec", "-T", "collector-scrape", "nginx", "-s", "reload")
|
||||||
|
deny(lambda: old_identity.call("auth/cert/login", {"name": "worker"}))
|
||||||
|
deny(lambda: old_identity.call(secret_path, token=old_token["client_token"]))
|
||||||
|
revoked = probe(lifecycle, "revoked")
|
||||||
|
assert revoked == {"rabbitmq": {"connect": False}, "collector": False,
|
||||||
|
"s3": {"read_staging": False}}, revoked
|
||||||
|
assert queue_ready(lifecycle, queue) == 1
|
||||||
|
assert job_state(lifecycle, attachment["id"]) == before
|
||||||
|
print("PASS: прежние учётные данные недействительны, задание сохранено", flush=True)
|
||||||
|
|
||||||
|
image = lifecycle.run("images", "-q", "worker")
|
||||||
|
recover_service_identities(lifecycle, definitions, permission)
|
||||||
|
rotate(ComposeProject(), port)
|
||||||
|
assert lifecycle.run("images", "-q", "worker") == image
|
||||||
|
deny(lambda: old_identity.call("auth/cert/login", {"name": "worker"}))
|
||||||
|
recovered = probe(ComposeProject(), "recovered", {"old_db_password": password})
|
||||||
|
assert recovered == {"rabbitmq": {"connect": True}, "collector": True, "old_db": False}
|
||||||
|
ready = client.wait_ready(actor, attachment, wait_seconds=60)
|
||||||
|
elapsed = round(time.monotonic() - started, 2)
|
||||||
|
after = job_state(lifecycle, attachment["id"])
|
||||||
|
assert before["id"] == after["id"] and after["status"] == "ready" and after["attempt"] == 1
|
||||||
|
assert {variant["name"] for variant in ready["variants"]} == {"thumbnail", "crop", "optimized"}
|
||||||
|
downloaded = client.call("GET", f"/api/v1/attachments/{ready['id']}/content", actor=actor)["bytes"]
|
||||||
|
assert downloaded == content
|
||||||
|
history = client.call("GET", f"/api/v1/chats/{chat['id']}/messages", actor=actor,
|
||||||
|
schema="MessagePage")["json"]["items"]
|
||||||
|
assert sum(item == message for item in history) == 1
|
||||||
|
wait_for(lambda: queue_ready(lifecycle, queue) == 0, "Задание не подтверждено брокеру")
|
||||||
|
result = {
|
||||||
|
"result": "PASS", "broad": broad, "least_privilege": limited,
|
||||||
|
"revoked_access": {**revoked, "postgresql": revoked_db, "openbao": False},
|
||||||
|
"job": {"before": before, "after": after, "queued_during_revocation": 1,
|
||||||
|
"queue_after_ack": 0, "recovery_seconds": elapsed,
|
||||||
|
"original_sha256": hashlib.sha256(downloaded).hexdigest(),
|
||||||
|
"variants": sorted(variant["name"] for variant in ready["variants"]),
|
||||||
|
"message_occurrences": 1, "worker_image_preserved": True},
|
||||||
|
}
|
||||||
|
print("PASS: то же задание обработано за одну попытку без повторной загрузки", flush=True)
|
||||||
|
finally:
|
||||||
|
lifecycle.run("down", "--volumes", "--remove-orphans", timeout=120)
|
||||||
|
if any(inventory([project_name]).values()):
|
||||||
|
raise RuntimeError("Не все ресурсы экспериментального проекта удалены")
|
||||||
|
images = [f"{project_name}-{component}:local" for component in ("app", "minio", "bootstrap")]
|
||||||
|
for image_tag in images:
|
||||||
|
if lifecycle.docker("image", "ls", "-q", image_tag):
|
||||||
|
lifecycle.docker("image", "rm", image_tag)
|
||||||
|
result["stand_removed"] = True
|
||||||
|
(ROOT / RESULT).write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n")
|
||||||
|
|
||||||
|
|
||||||
|
def free_ports():
|
||||||
|
with socket.socket() as first, socket.socket() as second, socket.socket() as third:
|
||||||
|
for listener in (first, second, third):
|
||||||
|
listener.bind(("127.0.0.1", 0))
|
||||||
|
return [listener.getsockname()[1] for listener in (first, second, third)]
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if len(sys.argv) == 4 and sys.argv[1] == "--isolated":
|
||||||
|
experiment(int(sys.argv[2]), int(sys.argv[3]))
|
||||||
|
return
|
||||||
|
|
||||||
|
with TemporaryDirectory(prefix=PREFIX, dir="/tmp") as directory:
|
||||||
|
target = Path(directory)
|
||||||
|
for name in ("app", "infra", "migrations", "scripts", "tests", "contracts"):
|
||||||
|
shutil.copytree(ROOT / name, target / name,
|
||||||
|
ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))
|
||||||
|
for name in (".env.example", ".dockerignore", "Dockerfile", "alembic.ini",
|
||||||
|
"requirements.txt", "compose.yaml", "lab.json"):
|
||||||
|
shutil.copy2(ROOT / name, target / name)
|
||||||
|
(target / "evidence").mkdir()
|
||||||
|
project = PREFIX + uuid4().hex[:12]
|
||||||
|
compose = target / "compose.yaml"
|
||||||
|
compose.write_text(compose.read_text()
|
||||||
|
.replace("messenger-lab7-minio:local", f"{project}-minio:local")
|
||||||
|
.replace("messenger-lab7-minio-bootstrap:local", f"{project}-bootstrap:local"))
|
||||||
|
ingress, bao, grafana = free_ports()
|
||||||
|
settings = {
|
||||||
|
line.partition("=")[0].strip()
|
||||||
|
for line in (target / ".env.example").read_text().splitlines()
|
||||||
|
if "=" in line and not line.lstrip().startswith("#")
|
||||||
|
}
|
||||||
|
env = {key: value for key, value in os.environ.items()
|
||||||
|
if key not in settings and not key.startswith("COMPOSE_")}
|
||||||
|
env.update(COMPOSE_PROJECT_NAME=project, API_IMAGE=f"{project}-app:local",
|
||||||
|
LB_HOST_PORT=str(ingress), BAO_HOST_PORT=str(bao), GRAFANA_HOST_PORT=str(grafana))
|
||||||
|
subprocess.run([sys.executable, "-m", "scripts.worker_experiment", "--isolated",
|
||||||
|
str(bao), str(ingress)], cwd=target, env=env, check=True)
|
||||||
|
shutil.copy2(target / RESULT, ROOT / RESULT)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -0,0 +1,200 @@
|
|||||||
|
"""Матрица операций worker на синтетических объектах отдельного стенда."""
|
||||||
|
|
||||||
|
import asyncio
|
||||||
|
from collections.abc import Callable
|
||||||
|
from contextlib import closing
|
||||||
|
from io import BytesIO
|
||||||
|
import json
|
||||||
|
import ssl
|
||||||
|
import sys
|
||||||
|
from urllib.error import HTTPError
|
||||||
|
from urllib.request import Request, urlopen
|
||||||
|
|
||||||
|
from asyncpg.exceptions import InvalidPasswordError
|
||||||
|
from aiormq.exceptions import AMQPConnectionError, ChannelAccessRefused
|
||||||
|
from minio.error import S3Error
|
||||||
|
from sqlalchemy import text
|
||||||
|
from sqlalchemy.exc import DBAPIError
|
||||||
|
|
||||||
|
from app.core.bao import database_secret
|
||||||
|
from app.core.config import Settings
|
||||||
|
from app.core.database import create_db_engine
|
||||||
|
from app.core.jobs import JobSettings
|
||||||
|
from app.storage.broker import connect_broker
|
||||||
|
from app.storage.s3 import create_s3_storage
|
||||||
|
|
||||||
|
OTHER_QUEUE = "experiment-private"
|
||||||
|
PAYLOAD = b"synthetic worker experiment"
|
||||||
|
FORBIDDEN_S3 = {"AccessDenied", "InvalidAccessKeyId", "SignatureDoesNotMatch"}
|
||||||
|
|
||||||
|
|
||||||
|
def s3_access(operation: Callable[[], None]) -> bool:
|
||||||
|
try:
|
||||||
|
operation()
|
||||||
|
except S3Error as error:
|
||||||
|
if error.code not in FORBIDDEN_S3:
|
||||||
|
raise
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
async def probe_s3(settings: Settings, phase: str) -> dict[str, bool]:
|
||||||
|
storage = create_s3_storage(settings.s3)
|
||||||
|
client = storage._client
|
||||||
|
bucket = settings.s3.bucket
|
||||||
|
try:
|
||||||
|
def read(key):
|
||||||
|
with closing(client.get_object(bucket, key)) as response:
|
||||||
|
assert response.read() == PAYLOAD
|
||||||
|
|
||||||
|
def write(key):
|
||||||
|
client.put_object(bucket, key, BytesIO(PAYLOAD), len(PAYLOAD))
|
||||||
|
|
||||||
|
if phase == "revoked":
|
||||||
|
return {"read_staging": s3_access(lambda: read("staging/experiment/fixture"))}
|
||||||
|
|
||||||
|
def list_private_names():
|
||||||
|
objects = client.list_objects(bucket, prefix="private/experiment/", recursive=True)
|
||||||
|
assert any(item.object_name == "private/experiment/fixture" for item in objects)
|
||||||
|
|
||||||
|
return {
|
||||||
|
"list_private_names": s3_access(list_private_names),
|
||||||
|
"read_staging": s3_access(lambda: read("staging/experiment/fixture")),
|
||||||
|
"write_staging": s3_access(lambda: write(f"staging/experiment/{phase}")),
|
||||||
|
"write_originals": s3_access(lambda: write(f"originals/experiment/{phase}")),
|
||||||
|
"write_variants": s3_access(lambda: write(f"variants/experiment/{phase}")),
|
||||||
|
"read_private": s3_access(lambda: read("private/experiment/fixture")),
|
||||||
|
"write_private": s3_access(lambda: write(f"private/experiment/{phase}")),
|
||||||
|
"delete_staging": s3_access(
|
||||||
|
lambda: client.remove_object(bucket, f"staging/experiment/delete-{phase}")
|
||||||
|
),
|
||||||
|
}
|
||||||
|
finally:
|
||||||
|
await storage.aclose()
|
||||||
|
|
||||||
|
|
||||||
|
async def probe_db(settings: Settings, statements: dict[str, str]) -> dict[str, bool]:
|
||||||
|
engine = create_db_engine(settings)
|
||||||
|
results = {}
|
||||||
|
try:
|
||||||
|
for operation, statement in statements.items():
|
||||||
|
try:
|
||||||
|
async with engine.connect() as connection:
|
||||||
|
await connection.execute(text(statement))
|
||||||
|
await connection.rollback()
|
||||||
|
except InvalidPasswordError:
|
||||||
|
results[operation] = False
|
||||||
|
except DBAPIError as error:
|
||||||
|
if error.orig.sqlstate not in {"42501", "28P01"}:
|
||||||
|
raise
|
||||||
|
results[operation] = False
|
||||||
|
else:
|
||||||
|
results[operation] = True
|
||||||
|
finally:
|
||||||
|
await engine.dispose()
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
async def probe_broker(phase: str) -> dict[str, bool]:
|
||||||
|
settings = JobSettings()
|
||||||
|
try:
|
||||||
|
connection = await connect_broker(settings)
|
||||||
|
except (AMQPConnectionError, OSError):
|
||||||
|
if phase != "revoked":
|
||||||
|
raise
|
||||||
|
return {"connect": False}
|
||||||
|
|
||||||
|
async with connection:
|
||||||
|
if phase == "revoked":
|
||||||
|
return {"connect": True}
|
||||||
|
results = {}
|
||||||
|
for name, label in ((settings.broker_queue, "jobs"), (OTHER_QUEUE, "private")):
|
||||||
|
channel = await connection.channel()
|
||||||
|
try:
|
||||||
|
await channel.declare_queue(name, durable=True)
|
||||||
|
except ChannelAccessRefused:
|
||||||
|
results[f"configure_{label}"] = False
|
||||||
|
else:
|
||||||
|
results[f"configure_{label}"] = True
|
||||||
|
await channel.close()
|
||||||
|
|
||||||
|
channel = await connection.channel()
|
||||||
|
try:
|
||||||
|
queue = await channel.get_queue(name, ensure=False)
|
||||||
|
message = await queue.get(fail=False)
|
||||||
|
assert message is None, "Очередь проверки должна быть пустой"
|
||||||
|
except ChannelAccessRefused:
|
||||||
|
results[f"read_{label}"] = False
|
||||||
|
else:
|
||||||
|
results[f"read_{label}"] = True
|
||||||
|
await channel.close()
|
||||||
|
|
||||||
|
channel = await connection.channel()
|
||||||
|
try:
|
||||||
|
from aio_pika import Message
|
||||||
|
|
||||||
|
await channel.default_exchange.publish(
|
||||||
|
Message(PAYLOAD), routing_key=OTHER_QUEUE, mandatory=True
|
||||||
|
)
|
||||||
|
except ChannelAccessRefused:
|
||||||
|
results["publish_private"] = False
|
||||||
|
else:
|
||||||
|
results["publish_private"] = True
|
||||||
|
marker = await (await channel.get_queue(OTHER_QUEUE, ensure=False)).get()
|
||||||
|
assert marker.body == PAYLOAD
|
||||||
|
await marker.ack()
|
||||||
|
await channel.close()
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def probe_collector() -> bool:
|
||||||
|
context = ssl.create_default_context(cafile="/run/tls/ca.crt")
|
||||||
|
context.load_cert_chain("/run/tls/otel-agent.crt", "/run/tls/otel-agent.key")
|
||||||
|
request = Request("https://otel-collector:4318/v1/traces", data=b"",
|
||||||
|
headers={"Content-Type": "application/x-protobuf"})
|
||||||
|
try:
|
||||||
|
with urlopen(request, context=context, timeout=5) as response:
|
||||||
|
return response.status == 200
|
||||||
|
except HTTPError as error:
|
||||||
|
if error.code != 403:
|
||||||
|
raise
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
async def main(phase: str):
|
||||||
|
if phase == "old-db":
|
||||||
|
password = json.load(sys.stdin)["old_db_password"]
|
||||||
|
result = await probe_db(Settings(db_password=password), {"old_db": "SELECT 1"})
|
||||||
|
return result
|
||||||
|
if phase in {"revoked", "recovered"}:
|
||||||
|
result = {
|
||||||
|
"rabbitmq": await probe_broker(phase) if phase == "revoked" else {"connect": True},
|
||||||
|
"collector": probe_collector(),
|
||||||
|
}
|
||||||
|
if phase == "revoked":
|
||||||
|
result["s3"] = await probe_s3(Settings(db_password="unused-probe"), phase)
|
||||||
|
else:
|
||||||
|
connection = await connect_broker(JobSettings())
|
||||||
|
await connection.close()
|
||||||
|
old_password = json.load(sys.stdin)["old_db_password"]
|
||||||
|
result["old_db"] = (await probe_db(
|
||||||
|
Settings(db_password=old_password), {"connect": "SELECT 1"}
|
||||||
|
))["connect"]
|
||||||
|
return result
|
||||||
|
|
||||||
|
settings = Settings(**database_secret())
|
||||||
|
return {
|
||||||
|
"postgresql": await probe_db(settings, {
|
||||||
|
"read_jobs": "SELECT id FROM attachment_jobs LIMIT 1",
|
||||||
|
"update_jobs": "UPDATE attachment_jobs SET attempt = attempt WHERE false",
|
||||||
|
"read_users": "SELECT id FROM users LIMIT 1",
|
||||||
|
"update_users": "UPDATE users SET display_name = display_name WHERE false",
|
||||||
|
"read_messages": "SELECT id FROM messages LIMIT 1",
|
||||||
|
}),
|
||||||
|
"rabbitmq": await probe_broker(phase),
|
||||||
|
"s3": await probe_s3(settings, phase),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print(json.dumps(asyncio.run(main(sys.argv[1]))))
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Трек 1. Компрометация worker
|
||||||
|
|
||||||
|
## Что было
|
||||||
|
|
||||||
|
В отдельной копии стенда временно выдали worker широкие права для контрольного замера. Он выполнил все 18 проверяемых операций, включая чтение пользователей и сообщений, обновление пользователей, доступ к чужой очереди и чтение содержимого чужих объектов.
|
||||||
|
|
||||||
|
## Что изменили
|
||||||
|
|
||||||
|
Вернули штатные политики и повторили те же проверки. Затем приняли одно вложение при остановленном worker и дождались доставки задания в RabbitMQ. Отозвали доступ прежней роли к OpenBao, RabbitMQ, Collector, PostgreSQL и MinIO. Выпустили новые сертификаты и сменили учётные данные PostgreSQL и MinIO.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make test-worker-compromise
|
||||||
|
```
|
||||||
|
|
||||||
|
Команда создаёт отдельный Compose-проект, новые ключи и тома во временной копии репозитория. После прогона удаляет ресурсы проекта и сохраняет результаты без секретов.
|
||||||
|
|
||||||
|
## Что получили
|
||||||
|
|
||||||
|
| Система | Работает со штатными правами | Отклоняется |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| PostgreSQL | Чтение и обновление заданий | Чтение и обновление пользователей, чтение сообщений |
|
||||||
|
| RabbitMQ | Объявление и чтение очереди вложений | Объявление, чтение и публикация в контрольной чужой очереди |
|
||||||
|
| MinIO | Чтение и удаление в `staging/`, запись в `originals/` и `variants/` | Запись в `staging/`, чтение и запись объектов в `private/` |
|
||||||
|
|
||||||
|
Штатная роль выполнила 9 из 18 проверок. Право `ListBucket` позволяет видеть имена объектов в контрольном префиксе. Чтение их содержимого отклонено.
|
||||||
|
|
||||||
|
После отзыва одно сообщение оставалось в очереди. Через 21,35 с с начала отзыва API вернул `ready` для того же задания. Оно обработалось за одну попытку, оригинал совпал побайтно, три варианта появились, сообщение в чате осталось в одном экземпляре, а очередь опустела. ID образа worker сохранился. Время включает операторские действия и проверки, это измерение одного прогона.
|
||||||
|
|
||||||
|
[Машиночитаемые результаты](../evidence/worker-compromise.json)
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 305 KiB |
@@ -64,3 +64,9 @@ Smoke не доказывает persistence, число реальных кон
|
|||||||
`make test-security-internal` на запущенном тестовом проекте проверяет каждую API-реплику внутри Docker-сети, сертификаты доступа к OpenBao, ACL вложений, завершение сессий, предел размеров запросов и ограничение входа. Проверка expiry сокращает TTL конкретной синтетической сессии через административный аккаунт Redis, активный только в тестовом проекте.
|
`make test-security-internal` на запущенном тестовом проекте проверяет каждую API-реплику внутри Docker-сети, сертификаты доступа к OpenBao, ACL вложений, завершение сессий, предел размеров запросов и ограничение входа. Проверка expiry сокращает TTL конкретной синтетической сессии через административный аккаунт Redis, активный только в тестовом проекте.
|
||||||
|
|
||||||
Для уровня «4» регрессия проверяет обновление старого хеша только после успешного входа и отказ при заполнении лимита параллельных проверок. `make test-security-internal` дополнительно проверяет сертификаты RabbitMQ и Collector, ограничения ролей и измеряет бюджет Argon2id. `make verify` запускает испытание жизненного цикла OpenBao с ротацией worker. `make scan-security` сканирует зависимости и собранные образы.
|
Для уровня «4» регрессия проверяет обновление старого хеша только после успешного входа и отказ при заполнении лимита параллельных проверок. `make test-security-internal` дополнительно проверяет сертификаты RabbitMQ и Collector, ограничения ролей и измеряет бюджет Argon2id. `make verify` запускает испытание жизненного цикла OpenBao с ротацией worker. `make scan-security` сканирует зависимости и собранные образы.
|
||||||
|
|
||||||
|
|
||||||
|
Трек «Компрометация worker» запускается отдельной командой `make test-worker-compromise`.
|
||||||
|
Она создаёт временную копию проекта, проводит проверку под широкими и минимальными
|
||||||
|
правами и удаляет контейнеры, тома и образы эксперимента. Матрица и состояние
|
||||||
|
задания сохраняются в `evidence/worker-compromise.json`.
|
||||||
|
|||||||
Reference in New Issue
Block a user