feat: complete lab 7 grade 3 security controls
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
# Сохранность после перезапуска хранилищ и отказ API
|
||||
|
||||
Предпосылки: подготовленный, разблокированный учебный стенд; Docker Compose, Python и локальный CA.
|
||||
|
||||
`sleep 60`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
|
||||
```
|
||||
|
||||
`make test-persistence ACTION_SCRIPT=scripts/restart.sh CA_FILE=secrets/tls/lab7-ca.crt`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "https://localhost:8443" --ca-file "secrets/tls/lab7-ca.crt"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
```
|
||||
|
||||
`make test-failover ACTION_SCRIPT=scripts/stop-one.sh CA_FILE=secrets/tls/lab7-ca.crt`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "secrets/tls/lab7-ca.crt"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 125, "failed_attempts": 2, "first_recovery_seconds": 1.538}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
```
|
||||
|
||||
`docker compose start api`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
Container highload-lab7-s3-1 Waiting
|
||||
Container highload-lab7-db-1 Waiting
|
||||
Container highload-lab7-redis-1 Waiting
|
||||
Container highload-lab7-s3-1 Healthy
|
||||
Container highload-lab7-s3-bootstrap-1 Starting
|
||||
Container highload-lab7-db-1 Healthy
|
||||
Container highload-lab7-migrate-1 Starting
|
||||
Container highload-lab7-redis-1 Healthy
|
||||
Container highload-lab7-s3-bootstrap-1 Started
|
||||
Container highload-lab7-s3-bootstrap-1 Waiting
|
||||
Container highload-lab7-migrate-1 Started
|
||||
Container highload-lab7-migrate-1 Waiting
|
||||
Container highload-lab7-migrate-1 Exited
|
||||
Container highload-lab7-s3-bootstrap-1 Exited
|
||||
Container highload-lab7-api-1 Starting
|
||||
Container highload-lab7-api-1 Started
|
||||
```
|
||||
|
||||
`./scripts/wait_ingress.sh`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
|
||||
```
|
||||
|
||||
`sleep 60`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
|
||||
```
|
||||
|
||||
`make test-failover ACTION_SCRIPT=scripts/stop-one.sh CA_FILE=secrets/tls/lab7-ca.crt`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "secrets/tls/lab7-ca.crt"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 125, "failed_attempts": 2, "first_recovery_seconds": 1.658}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
```
|
||||
|
||||
`docker compose start api`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
Container highload-lab7-db-1 Waiting
|
||||
Container highload-lab7-s3-1 Waiting
|
||||
Container highload-lab7-redis-1 Waiting
|
||||
Container highload-lab7-redis-1 Healthy
|
||||
Container highload-lab7-s3-1 Healthy
|
||||
Container highload-lab7-s3-bootstrap-1 Starting
|
||||
Container highload-lab7-db-1 Healthy
|
||||
Container highload-lab7-migrate-1 Starting
|
||||
Container highload-lab7-s3-bootstrap-1 Started
|
||||
Container highload-lab7-s3-bootstrap-1 Waiting
|
||||
Container highload-lab7-migrate-1 Started
|
||||
Container highload-lab7-migrate-1 Waiting
|
||||
Container highload-lab7-migrate-1 Exited
|
||||
Container highload-lab7-s3-bootstrap-1 Exited
|
||||
Container highload-lab7-api-1 Starting
|
||||
Container highload-lab7-api-1 Started
|
||||
```
|
||||
|
||||
`./scripts/wait_ingress.sh`
|
||||
|
||||
Код завершения: 0.
|
||||
|
||||
```text
|
||||
|
||||
```
|
||||
|
||||
Состояния контейнеров (restart):
|
||||
|
||||
```text
|
||||
/highload-lab7-api-1 2026-11-14T16:56:19.970448431Z
|
||||
/highload-lab7-api-2 2026-11-14T16:56:20.135569481Z
|
||||
/highload-lab7-broker-1 2026-11-14T16:50:40.248667479Z
|
||||
/highload-lab7-db-1 2026-11-14T16:50:39.231870058Z
|
||||
/highload-lab7-redis-1 2026-11-14T16:50:39.21876659Z
|
||||
/highload-lab7-s3-1 2026-11-14T16:50:39.377104743Z
|
||||
/highload-lab7-api-1 2026-11-14T16:57:33.129069552Z
|
||||
/highload-lab7-api-2 2026-11-14T16:57:33.110951095Z
|
||||
/highload-lab7-broker-1 2026-11-14T16:57:25.694563006Z
|
||||
/highload-lab7-db-1 2026-11-14T16:57:26.301816228Z
|
||||
/highload-lab7-redis-1 2026-11-14T16:57:24.787203563Z
|
||||
/highload-lab7-s3-1 2026-11-14T16:57:24.914493761Z
|
||||
```
|
||||
|
||||
Состояния контейнеров (failover):
|
||||
|
||||
```text
|
||||
/highload-lab7-api-1 exited
|
||||
/highload-lab7-api-1 exited
|
||||
```
|
||||
|
||||
Итог: все команды завершились успешно.
|
||||
Reference in New Issue
Block a user