Merge remote-tracking branch 'origin/main' into feat/complete-missing-features
Heimdall Gitea / Detect CI scope (pull_request) Successful in 6s
Heimdall Gitea / Build and tests (pull_request) Successful in 18m23s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan server image (pull_request) Successful in 6m24s
Heimdall Gitea / Build and scan agent image (pull_request) Successful in 11m40s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (pull_request) Successful in 23m24s
Heimdall Gitea / CI policy (pull_request) Successful in 2s

# Conflicts:
#	docker/Dockerfile
#	docker/Dockerfile.agent
#	todo.md
This commit is contained in:
arnaud.dartois committed 2026-11-06 10:27:28 +01:00
commit 06e98f4d8a
8 files changed
+72 -5

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
{
"mcpServers": {
"sonarqube": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "SONARQUBE_TOKEN", "-e", "SONARQUBE_URL", "sonarsource/sonarqube-mcp"],
"env": {
"SONARQUBE_TOKEN": "sqa_8442a86777f3d24d63f73ad041b4fb69fe85c54e",
"SONARQUBE_URL": "https://sonar.tordais.cc/"
}
},
"penpot": {
"url": "https://penpot.tordais.cc/mcp/stream?userToken=eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2R0NNIn0.kdA95aeTHNljc911GzuOHVkU1oEDBbfENHNibyF6jOs6bYq5YcdnVA.bsxKnJNJMAUUWmnK.Ck2N8xikQG14-cM9nP1u63SiJxtYShtu2_5sKfeBt6-Ii7FGZ25C0M0_sCkaY5xmxL_EUdjGZuWYWjSwcCdkepJk8PjzL4bjxbn2UpCiI3UzHRHEcF245ZSFUFAcePN9U1lvZZbykvoefdraWf0Pm7DF0cBOKu1L3G_SB_-kzC1EnQkaeQRIc9aXdvulcQ6dPzP2hxTmJOHJ-6dAOyYZ-qc.BxwXbtkJUeDX6kbsCwiNSA"
},
"glitchtip": {
"url": "https://glitchtip.tordais.cc/mcp",
"headers": {
"Authorization": "Bearer b96df317626cbf9f3532db41f4cb1cff54f01ff790e31cc2df1ccd6f2a479fa1"
}
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}
+3 -1
View File
@@ -11,7 +11,9 @@ RUN dotnet publish src/Heimdall.Web/Heimdall.Web.csproj -c Release --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble@sha256:de0ee358cdd672f7017a003bed21e9ac9ed48a27c922a59b18175b6e82fa7fee
WORKDIR /app
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --only-upgrade apt libapt-pkg6.0t64 \
&& apt_version="$(dpkg-query -W -f='${Version}' apt)" \
&& dpkg --compare-versions "$apt_version" ge 2.8.4ubuntu0.1 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget tzdata tesseract-ocr tesseract-ocr-eng \
&& rm -rf /var/lib/apt/lists/*
ENV ASPNETCORE_URLS=http://+:8080
+3 -1
View File
@@ -13,7 +13,9 @@ RUN dotnet publish src/Heimdall.Agent/Heimdall.Agent.csproj -c Release --no-rest
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble@sha256:de0ee358cdd672f7017a003bed21e9ac9ed48a27c922a59b18175b6e82fa7fee
WORKDIR /app
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --only-upgrade apt libapt-pkg6.0t64 \
&& apt_version="$(dpkg-query -W -f='${Version}' apt)" \
&& dpkg --compare-versions "$apt_version" ge 2.8.4ubuntu0.1 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ffmpeg wget libgomp1 tzdata \
&& rm -rf /var/lib/apt/lists/*
RUN install -d -m 0700 -o 1654 -g 1654 /var/lib/heimdall
+3
View File
@@ -20,6 +20,9 @@ ENV DOTNET_ROOT=/usr/share/dotnet \
Agent__InferenceExecutionProvider=CUDA
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --only-upgrade apt libapt-pkg6.0t64 \
&& apt_version="$(dpkg-query -W -f='${Version}' apt)" \
&& dpkg --compare-versions "$apt_version" ge 2.8.4ubuntu0.1 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates ffmpeg libgomp1 libicu74 libssl3t64 tzdata wget zlib1g \
&& rm -rf /var/lib/apt/lists/* \
+14
View File
@@ -0,0 +1,14 @@
---
name: heimdall-agent-install-assets
description: Serve and validate native Heimdall Agent installer assets from Central.
---
# Native Agent installer assets
Read `AGENTS.md`, the `AGENT-INSTALL-ASSETS` entry in `todo.md`, and `skills/compose-disposable-recipe/SKILL.md` before changing Central asset delivery.
`Heimdall.Web.csproj` publishes the Linux/Windows installers and supervisors under `wwwroot/install/`; `Program.ConfigureMiddleware` serves them through ASP.NET Core static files. The default MIME table does not recognize `.py`, so explicitly map `.py` with `FileExtensionContentTypeProvider`; otherwise the supervisor returns 404 even when the file exists in the publish output.
For acceptance, build Central from the changed source in a disposable Compose project. Require `/healthz` healthy and GET `/install/install-agent.sh` plus `/install/agent-supervisor.py`; both must return HTTP 200 and byte-for-byte match `install/` sources. Use generated credentials, isolated ports/project volumes/network, a unique local image tag, and an EXIT cleanup trap installed before build. Verify no project containers, volumes, or networks remain and remove/verify absence of the exact built tag. Keep shared base images.
This proves only source-built Central behavior. Verify the deployed Central after its image has been published and restarted before considering a field incident resolved.
+6 -1
View File
@@ -24,7 +24,12 @@ Use this skill when changing the Linux or Windows Central installer, its generat
- Use the maintained `nickfedor/watchtower` image at an explicit version, `--label-enable`, a 24-hour interval, and `--cleanup`. Cleanup removes superseded images after an update; it must never remove Docker volumes or database files.
- Apply `pull_policy: always` to published Docker images in deployment Compose files so a manual `docker compose up` checks the registry. Leave local development-only images alone and keep the updater itself version-pinned.
- The Docker socket mount grants Watchtower broad control of the host. Document this risk and the lack of staged rollout/rollback; do not describe automatic updates as a production-safe rollback system.
- For each published Ubuntu-based Central, CPU Agent, or CUDA Agent runtime image, update the base OS package index, upgrade installed OS packages noninteractively, install runtime packages, and clear apt lists in one layer. Verify the final image with the repository's pinned Trivy scanner at HIGH/CRITICAL severity; a passing application build does not clear OS package advisories.
- For each published Ubuntu-based Central, CPU Agent, or CUDA Agent runtime image, update the package index, apply the package security updates required by current Trivy findings, install runtime packages, and clear apt lists in one layer. Keep a broader OS upgrade only where that image already establishes the policy (the CUDA image); verify every final image with the pinned Trivy scanner at HIGH/CRITICAL severity. A passing application build does not clear OS package advisories.
## Runtime image package security
- The server and CPU Agent runtime images inherit Ubuntu 24.04 from the pinned ASP.NET image. When Trivy identifies a fixed Ubuntu package in the shared base, remediate both Dockerfiles and enforce the minimum patched version at build time. For `CVE-2026-109518`, explicitly upgrade `apt` and `libapt-pkg6.0t64` to at least Ubuntu `2.8.4ubuntu0.1` before runtime packages. The NVIDIA Agent runtime keeps its existing full OS upgrade and asserts the patched APT version too.
- Run Central + PostgreSQL from source in a disposable Compose project, verify health and native Agent asset URLs, then scan Central, CPU Agent, and any changed CUDA image with the same pinned Trivy scanner and HIGH/CRITICAL policy used by CI. Require no findings and perform exact-tag cleanup. See `skills/container-image-security/SKILL.md`.
## Re-running the installer
+14
View File
@@ -0,0 +1,14 @@
---
name: heimdall-container-image-security
description: Diagnose and repair vulnerabilities in Heimdall Central and Agent container images.
---
# Container image security updates
Read `AGENTS.md`, the image-scan result in `todo.md`, `skills/compose-disposable-recipe/SKILL.md`, and `skills/central-auto-updates/SKILL.md` before changing runtime images or their publication path.
Heimdall server, CPU Agent, and NVIDIA Agent images use Ubuntu 24.04 runtime layers. When Trivy reports a fixed Ubuntu package, update the affected packages unless the image already establishes a broader OS-upgrade policy. For `CVE-2026-109518`, all three runtime Dockerfiles explicitly upgrade `apt` and `libapt-pkg6.0t64` after `apt-get update` and assert that `apt` is at least `2.8.4ubuntu0.1` before installing runtime tools. The NVIDIA image retains its existing full OS upgrade as well. Keep Trivy severity and exit thresholds unchanged.
For acceptance, build Central, CPU Agent, and NVIDIA Agent from the changed checkout under unique Compose image tags with synthetic credentials, loopback ports, project-scoped volumes/network, and an EXIT cleanup trap. Verify Central health and the native Agent installer and supervisor URLs; build the NVIDIA image without claiming GPU runtime validation. Scan all three built images with the same pinned Trivy version, vulnerability DB repositories, and HIGH/CRITICAL exit policy used by `scripts/ci/security.sh`. A passing acceptance requires zero HIGH/CRITICAL findings, successful teardown, no project containers/volumes/networks, and removal plus absence checks for every exact local tag. Retain upstream base and scanner images.
The CI image scan is a merge gate. Do not publish or merge around a failed scan; inspect the report and correct the affected package, then rerun the complete workflow. Keep `todo.md` evidence split between disposable local acceptance and the actual CI publication run.
+4 -2
View File
@@ -4,6 +4,8 @@ Ce fichier remplace les rapports de `docs/audits/` et constitue le suivi courant
## P0 — CI et publication
- [x] **CI-IMAGE-APT-CVE** La CI PR #140 (#run 761) a échoué les scans des images Central et Agent. Reproduction Trivy 0.69.3 sur les deux images du commit `850ec985` : HIGH `CVE-2026-109518` sur `apt` et `libapt-pkg6.0t64` 2.8.3, version corrigée `2.8.4ubuntu0.1`. Les Dockerfiles serveur et Agent CPU mettent ces deux paquets à jour et vérifient la version minimale; l’image NVIDIA faisait déjà `apt-get upgrade`. Acceptation locale terminée sous Compose `hmd-pr140-apt-1794000300` : santé Central OK, les deux URLs d’installation HTTP 200 et conformes à la source, scans Trivy 0.69.3 Central et Agent à zéro HIGH/CRITICAL. Conteneurs, volumes, réseau et tags temporaires vérifiés absents après suppression. Le premier `compose down` a laissé le cache Trivy et son réseau par défaut; suppression manuelle limitée aux ressources étiquetées de ce projet, puis vérification complète réussie. Run CI PR #140 #771 (6 novembre 2026) : CI policy, build/tests, scans Central et Agent réussis; publication ignorée car PR. PR #140 est fusionnée dans main (`6e61d38`). Le correctif reste à publier pour réparer le téléchargement public. Skill : `skills/container-image-security/SKILL.md`.
- [x] Rétablir le checkout des jobs : retirer la redirection de l’hôte de forge configuré vers `host-gateway` de la configuration des runners. Le run #442 a franchi le checkout et les tests.
- [x] Séparer les suites .NET en étapes nommées et planifier les suites affectées pour les PR ; conserver la validation complète sur `main` et les tags. PR #67, test isolé : seuls IntegrationTests ont tourné (147 réussis). PR #68, changement Application + Web : toutes les suites affectées ont passé ; Domain a été ignorée. Le run push #227 confirme `Test plan: all` sur `main`. Les chemins qui lancent le workflow sont désormais filtrés pour les PR et les pushes de branche `main`; les tags `v*` conservent les validations complètes.
- [x] Construire et scanner les images serveur et Agent dans deux jobs CI distincts après `verify`. Le run PR #196 a passé `verify` et les deux jobs en parallèle, serveur sur `runner-murin` et Agent sur `runner-hugin`. Le run main #227 a aussi validé la publication des tags Docker Hub après les deux succès (preuve ci-dessous).
@@ -18,11 +20,11 @@ Ce fichier remplace les rapports de `docs/audits/` et constitue le suivi courant
## P1 — parcours caméra, agent et données
- [ ] **AGENT-INSTALL-ASSETS** Central renvoyait HTTP 404 pour `/install/agent-supervisor.py`, car le middleware statique ASP.NET Core n'associait aucun type MIME à `.py` et refusait le fichier pourtant présent dans le publish. `Program.ConfigureMiddleware` mappe maintenant `.py` vers `text/x-python`. Deux recettes source Compose ont confirmé `/healthz` sain et les deux assets HTTP 200 identiques à la source; la recette `hmd-pr138-verified-1793916772-972` vérifie aussi `text/x-python`. Projet final nettoyé 0/0/0 et image `heimdall:hmd-pr138-verified-1793916772-972-central` absente. Le Central public répondait encore 404 au contrôle initial; le déploiement/restart et la vérification publique restent à faire. Skill : `skills/agent-update-acceptance/SKILL.md`.
- [ ] **AGENT-INSTALL-ASSETS** Central renvoyait HTTP 404 pour `/install/agent-supervisor.py`, car le middleware statique ASP.NET Core ne reconnaissait pas l’extension `.py`. Le middleware mappe maintenant `.py` vers `text/x-python`. La recette source Compose `hmd-agent-static-fixed2-1793913400000000000` a confirmé `/healthz` sain, les deux assets HTTP 200 et identiques aux sources; teardown vérifié (0 conteneur/volume/réseau) et tag local supprimé/vérifié absent. Après fusion de #140, le Central public sert le script shell (HTTP 200) mais répond encore 404 pour `agent-supervisor.py`; le déploiement complet et sa vérification restent à faire. La recette locale #138 après merge de main a validé les deux assets (HTTP 200 et identiques aux sources), Central sain et scan Trivy sans HIGH/CRITICAL; teardown et absence des tags exacts vérifiés. Skill : `skills/agent-install-assets/SKILL.md`.
- [x] **Contrats Agent / création de site** L'upload des logs envoie maintenant les noms d'énumération acceptés par Central (`Information`, `Warning`); une réponse 4xx à un résultat d'analyse est définitive et libère la boucle de polling. La création de site propage le sujet ntfy optionnel au handler. La recette source Compose a révélé puis corrigé le 415 de `GET /api/agents/{id}/logs` en liant son filtre depuis la query string. Tests Agent ciblés 25/25; intégration PostgreSQL source Compose 2/2 (création site/topic, ajout de logs, rejet des alias `Info`/`Warn`, lecture des six sévérités) et build Web sans avertissement. Projet `hmd-pr138-verified-1793916772-972` teardown 0/0/0, image exacte absente. Skills : `skills/agent-runtime-acceptance/SKILL.md`, `skills/analysis-job-pipeline/SKILL.md`, `skills/site-ntfy-creation/SKILL.md`.
- [ ] **SECURITY/IMAGE-APT-UPDATE** Le run CI PR #756 a réussi les builds serveur/Agent/CUDA mais les trois scans Trivy et `CI policy` ont échoué. Le scan local du Central source a isolé `CVE-2026-109518` dans `apt` et `libapt-pkg6.0t64` 2.8.3 (correctif Ubuntu 2.8.4ubuntu0.1). Les trois Dockerfiles runtime mettent maintenant à niveau les paquets OS avant l'installation des dépendances. Tentative de recette Central source avec le tag isolé `heimdall:hmd-pr138-apt-1793946707-574639-central`: l'upgrade APT est resté bloqué en état noyau `D` pendant plus d'une minute; interruption de la tentative, projet vérifié sans conteneur/volume/réseau et tag absent. Le scan post-correctif n'est donc pas validé localement. La CI doit valider les builds et scans Trivy HIGH/CRITICAL des trois images; aucune publication ne doit être déclarée tant que ce run n'a pas réussi. Skill : `skills/central-auto-updates/SKILL.md`.
- [ ] **SECURITY/IMAGE-APT-UPDATE** Le run CI PR #756 a réussi les builds serveur/Agent/CUDA mais les trois scans Trivy et `CI policy` ont échoué. `CVE-2026-109518` est corrigée par mise à jour ciblée de `apt` et `libapt-pkg6.0t64` avec vérification de version dans les trois Dockerfiles. Le run #771 de PR #140 a validé Central et Agent CPU, mais pas CUDA. Sur la branche #138, le run #768 a échoué avant les jobs images : 169/170 tests réussis, avec timeout Npgsql au démarrage de `RolePermissionService` pour `SettingsControllerTests.ListAll_WithNonAdminUser_ReturnsForbidden`. La recette Compose locale après merge de main a validé Central sain et son scan Trivy sans HIGH/CRITICAL. La publication locale de l’Agent CPU a terminé, mais l’export image a été interrompu faute d’espace disque (0 libre); une reprise a été arrêtée à 323 MB libres et CUDA n’a pas été construit/scanné. Chaque projet temporaire a été démonté et l’absence de ses conteneurs, volumes, réseaux et tags exacts vérifiée. Attendre que la CI #138 valide les tests d’intégration et les trois scans Trivy avant fusion; aucune publication n’est déclarée. Skill : `skills/central-auto-updates/SKILL.md`.
- [x] Corriger la fixture unitaire `CreateEventHandlerTests` révélée rouge par la CI de la PR #138 : elle ne configurait pas `Recordings`, requis par la requête EF du handler. Le test initialise maintenant un `MockDbSet` vide. Le run #753 a aussi révélé que la bannière PWA du contexte loopback interceptait les dialogues Playwright; la fixture E2E la ferme après navigation. Ces précautions sont documentées dans `skills/analysis-job-pipeline/SKILL.md`; la CI PR reste à relancer pour confirmer l’ensemble des suites.