lab7: mTLS-границы, OpenBao raft, TLS-телеметрия, evidence уровней 3-4
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-27 23:05:20 +03:00
parent 6b44b067c4
commit cf6b78f899
31 changed files with 572 additions and 116 deletions
+41
View File
@@ -0,0 +1,41 @@
# Результаты скана
Команда: `sh scripts/scan.sh`. Отчёты пишутся атомарно: неудачный прогон
уходит в `*.failed-network.txt` и не затирает предыдущий успешный отчёт.
## Успешный прогон (финальный образ)
Образ `messenger-lab7-app:1.7.0`: Debian 13.8, Python 3.11, Pillow 13.0.0,
starlette 0.38.6.
- `trivy-image.txt` — Trivy 0.57.1, HIGH/CRITICAL, `--ignore-unfixed`:
- базовый слой Debian: **Total 1** (HIGH 1, CRITICAL 0) — `libzstd1`;
- Python-слой: **Total 6** (HIGH 6, CRITICAL 0) — `jaraco.context`,
`protobuf`, `starlette` (3), `wheel`.
- `pip-audit.txt` — аудит установленного в образе окружения (`--local`):
**33 advisories в 5 пакетах** — `opentelemetry-api`, `pip`, `protobuf`,
`setuptools`, `starlette`.
До обновления зависимостей тот же скан давал **69** HIGH/CRITICAL в базовом
слое и **65** в Python-слое, из них 28 — Pillow 12.3.0 (включая CRITICAL
`CVE-2026-112393`, heap overflow в `_tiffWriteProc`).
## Неудачные прогоны
`pip-audit.failed-network.txt` — пример неудачного прогона: сеть стенда рвала
загрузку managed CPython (`unexpected EOF`, 0–100 Б/с), плюс на macOS
`pip-audit` падал на `ensurepip` в своём venv. Поэтому аудит теперь идёт
внутри Linux-образа. Аналогичные обрывы загрузки базы Trivy (138 МБ) в Git не
сохранялись — это были только progress-бары без findings.
## Разбор
Применимость каждой оставшейся находки и решение (fix / residual + причина) —
в `REPORT.md`, раздел «Scan triage». Кратко: Pillow закрыт обновлением;
`starlette` требует парного bump с `fastapi`; `protobuf`/`opentelemetry-api`
ограничены версией OTel-стека; `pip`/`setuptools`/`wheel`/`jaraco.context` —
build-time и план по multi-stage; `libzstd1` уйдёт со следующим обновлением
базового образа.
Повторить скан: `sh scripts/scan.sh` (база Trivy кэшируется в volume
`trivy-cache`, поэтому повторный прогон занимает секунды).
@@ -0,0 +1,13 @@
Downloading cpython-3.11.15-macos-aarch64-none (download) (19.1MiB)
Downloading cpython-3.11.15-macos-aarch64-none (download) (19.1MiB)
Downloading cpython-3.11.15-macos-aarch64-none (download) (19.1MiB)
Downloading cpython-3.11.15-macos-aarch64-none (download) (19.1MiB)
error: Request failed after 3 retries in 253.2s
Caused by: Failed to extract archive: cpython-3.11.15-20260325-aarch64-apple-darwin-install_only_stripped.tar.gz
Caused by: Invalid tar file
Caused by: failed to unpack `/Users/enikiforovavya/.local/share/uv/python/.temp/.tmpZRUIw8/python/include/python3.11/internal/pycore_fileutils.h`
Caused by: failed to unpack `python/include/python3.11/internal/pycore_fileutils.h` into `/Users/enikiforovavya/.local/share/uv/python/.temp/.tmpZRUIw8/python/include/python3.11/internal/pycore_fileutils.h`
Caused by: error decoding response body
Caused by: request or response body error
Caused by: error reading a body from connection
Caused by: peer closed connection without sending TLS close_notify: https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof
+37
View File
@@ -0,0 +1,37 @@
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Found 33 known vulnerabilities in 5 packages
Name Version ID Fix Versions
----------------- ------- ------------------- -------------
opentelemetry-api 1.27.0 CVE-2026-114603 1.45.1
opentelemetry-api 1.27.0 CVE-2026-126360 1.45.2
pip 24.0 PYSEC-2026-1795 25.3
pip 24.0 PYSEC-2026-1796 26.0
pip 24.0 PYSEC-2026-2875 26.1
pip 24.0 PYSEC-2026-2876 26.1
pip 24.0 PYSEC-2026-196 26.1.2
pip 24.0 PYSEC-2026-1795 25.3
pip 24.0 PYSEC-2026-1796 26.0
pip 24.0 PYSEC-2026-196 26.1.2
pip 24.0 PYSEC-2026-2875 26.1
pip 24.0 PYSEC-2026-2876 26.1
pip 24.0 PYSEC-2026-3721 26.2
pip 24.0 PYSEC-2026-3721 26.2.0
protobuf 4.25.9 PYSEC-2026-1805 5.29.6,6.33.5
protobuf 4.25.9 PYSEC-2026-1805 5.29.6,6.33.5
setuptools 79.0.1 PYSEC-2026-3447 83.0.0
setuptools 79.0.1 PYSEC-2026-3447 83.0.0
setuptools 79.0.1 GHSA-xmj3-9gf7-h52w 84.1.0
starlette 0.38.6 PYSEC-2026-1943 0.40.0
starlette 0.38.6 PYSEC-2026-1941 0.47.2
starlette 0.38.6 PYSEC-2026-161 1.0.1
starlette 0.38.6 PYSEC-2026-161 1.0.1
starlette 0.38.6 PYSEC-2026-2281 1.1.0
starlette 0.38.6 PYSEC-2026-2280 1.1.0
starlette 0.38.6 PYSEC-2026-249 1.3.1
starlette 0.38.6 PYSEC-2026-248 1.3.0
starlette 0.38.6 PYSEC-2026-249 1.3.1
starlette 0.38.6 PYSEC-2026-248 1.3.0
starlette 0.38.6 PYSEC-2026-1943 0.40.0
starlette 0.38.6 PYSEC-2026-1941 0.47.2
starlette 0.38.6 PYSEC-2026-2281 1.1.0
starlette 0.38.6 PYSEC-2026-2280 1.1.0
+51
View File
@@ -0,0 +1,51 @@
2026-11-27T20:03:05Z INFO [vuln] Vulnerability scanning is enabled
2026-11-27T20:03:05Z INFO Detected OS family="debian" version="13.8"
2026-11-27T20:03:05Z INFO [debian] Detecting vulnerabilities... os_version="13" pkg_num=87
2026-11-27T20:03:05Z INFO Number of language-specific files num=1
2026-11-27T20:03:05Z INFO [python-pkg] Detecting vulnerabilities...
2026-11-27T20:03:05Z WARN Using severities from other vendors for some vulnerabilities. Read https://aquasecurity.github.io/trivy/v0.57/docs/scanner/vulnerability#severity-selection for details.
messenger-lab7-app:1.7.0 (debian 13.8)
======================================
Total: 1 (HIGH: 1, CRITICAL: 0)
┌──────────┬─────────────────┬──────────┬────────┬───────────────────┬──────────────────────┬──────────────────────────────────────────────────────────┐
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │
├──────────┼─────────────────┼──────────┼────────┼───────────────────┼──────────────────────┼──────────────────────────────────────────────────────────┤
│ libzstd1 │ CVE-2026-124851 │ HIGH │ fixed │ 1.5.7+dfsg-1 │ 1.5.7+dfsg-1+deb13u1 │ zstd: Zstandard Information Disclosure via Uninitialized │
│ │ │ │ │ │ │ Buffer │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-124851 │
└──────────┴─────────────────┴──────────┴────────┴───────────────────┴──────────────────────┴──────────────────────────────────────────────────────────┘
2026-11-27T20:03:05Z INFO Table result includes only package filenames. Use '--format json' option to get the full path to the package file.
Python (python-pkg)
===================
Total: 6 (HIGH: 6, CRITICAL: 0)
┌───────────────────────────┬────────────────┬──────────┬────────┬───────────────────┬────────────────┬──────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │
├───────────────────────────┼────────────────┼──────────┼────────┼───────────────────┼────────────────┼──────────────────────────────────────────────────────────────┤
│ jaraco.context (METADATA) │ CVE-2026-23949 │ HIGH │ fixed │ 5.3.0 │ 6.1.0 │ jaraco.context: jaraco.context: Path traversal via malicious │
│ │ │ │ │ │ │ tar archives │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-23949 │
├───────────────────────────┼────────────────┤ │ ├───────────────────┼────────────────┼──────────────────────────────────────────────────────────────┤
│ protobuf (METADATA) │ CVE-2026-0994 │ │ │ 4.25.9 │ 6.33.5, 5.29.6 │ python: protobuf: Protobuf: Denial of Service due to │
│ │ │ │ │ │ │ recursion depth bypass │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-0994 │
├───────────────────────────┼────────────────┤ │ ├───────────────────┼────────────────┼──────────────────────────────────────────────────────────────┤
│ starlette (METADATA) │ CVE-2024-47874 │ │ │ 0.38.6 │ 0.40.0 │ starlette: Starlette Denial of service (DoS) via │
│ │ │ │ │ │ │ multipart/form-data │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2024-47874 │
│ ├────────────────┤ │ │ ├────────────────┼──────────────────────────────────────────────────────────────┤
│ │ CVE-2026-48818 │ │ │ │ 1.1.0 │ starlette: Starlette: SSRF and NTLM credential theft via UNC │
│ │ │ │ │ │ │ paths in StaticFiles... │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-48818 │
│ ├────────────────┤ │ │ ├────────────────┼──────────────────────────────────────────────────────────────┤
│ │ CVE-2026-54283 │ │ │ │ 1.3.1 │ starlette: Starlette: request.form() limits silently ignored │
│ │ │ │ │ │ │ for application/x-www-form-urlencoded enable DoS │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-54283 │
├───────────────────────────┼────────────────┤ │ ├───────────────────┼────────────────┼──────────────────────────────────────────────────────────────┤
│ wheel (METADATA) │ CVE-2026-24049 │ │ │ 0.45.1 │ 0.46.2 │ wheel: wheel: Privilege Escalation or Arbitrary Code │
│ │ │ │ │ │ │ Execution via malicious wheel file... │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2026-24049 │
└───────────────────────────┴────────────────┴──────────┴────────┴───────────────────┴────────────────┴──────────────────────────────────────────────────────────────┘