forked from mtusi2026/mtusi2026lab7
ЛР 7 — БВТ2301 — Курлова — на 4
Перенесён минимум lab6 (API без изменений), добавлена защита на границах доверия: - внешний HTTPS; обязательный mTLS LB -> API с allowlist identity и отзывом по serial; - TLS на всех связях: PostgreSQL verify-full, MinIO HTTPS, RabbitMQ AMQPS mTLS (EXTERNAL), Valkey TLS + ACL, Collector и хранилища телеметрии через mTLS с отдельными CA; - OpenBao в server mode: cert auth, токены 15 мин, политики только на свой путь; - роли БД, S3-политики и права брокера по принципу минимальных прав; - Argon2id с замером, rehash, общий лимит входа, бюджет защиты от login DoS; - hardening всех контейнеров, scan образов с разбором, модель угроз, матрица доверия; - отрицательные тесты: TLS-аудит (135 проверок), ACL, ротации, sealed OpenBao.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
name: Application stand (lab7)
|
||||
# Student job: the whole operator bootstrap in a throwaway runner, then the public HTTPS checks and the TLS audit.
|
||||
# The job itself plays the operator: PKI, bootstrap passwords and OpenBao shares are created inside the runner and
|
||||
# destroyed with it. No repository secrets are used; pull_request_target is deliberately not a trigger.
|
||||
on: [push, pull_request]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
stand:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Local PKI and bootstrap credentials (operator step)
|
||||
run: |
|
||||
sh scripts/pki.sh init
|
||||
sh scripts/init-secrets.sh
|
||||
- name: Validate Compose configuration
|
||||
run: docker compose --env-file .env config --quiet
|
||||
- name: OpenBao init, unseal and bootstrap (operator step)
|
||||
run: |
|
||||
docker compose --env-file .env up -d openbao
|
||||
sh scripts/bao.sh init
|
||||
sh scripts/bao.sh bootstrap
|
||||
- name: Build and start the stand, wait for readiness
|
||||
run: docker compose --env-file .env up -d --build --wait --wait-timeout 300
|
||||
- name: Contract structure and public HTTPS checks
|
||||
run: |
|
||||
make check
|
||||
make test CA_FILE=$PWD/secrets/pki/ca.crt
|
||||
make test-security CA_FILE=$PWD/secrets/pki/ca.crt
|
||||
- name: TLS / mTLS / authorization audit of the trust matrix
|
||||
run: >
|
||||
docker compose run --rm --no-deps -v ./secrets/pki:/pki:ro -v ./secrets/bootstrap:/bootstrap:ro
|
||||
-v ./student-tests:/audit:ro --entrypoint python worker /audit/tls_audit.py
|
||||
- name: Container hardening from docker inspect
|
||||
run: python3 student-tests/check_hardening.py
|
||||
- name: Service state and logs on failure (no secrets are logged)
|
||||
if: failure()
|
||||
run: |
|
||||
docker compose ps -a
|
||||
docker compose logs --tail 60 nginx api-1 api-2 worker openbao rabbitmq postgres
|
||||
- name: Remove the stand
|
||||
if: always()
|
||||
run: docker compose down -v
|
||||
Reference in New Issue
Block a user