Fail safely when the configured TLS bind path is missing #3

Closed
opened 2026-10-31 21:51:24 +00:00 by kilo · 2 comments
Member

M0 inspection found that Compose renders successfully when FOUNDRY_TLS_DIR names a nonexistent path (including a relative path), although the documented prerequisite is an existing absolute TLS directory. Docker Compose bind mounts default to creating missing host directories, potentially leaving confusing host state before SR fails to load certificates.

Reproduce with isolated placeholder values using docker compose --env-file /dev/null -p foundry-m0-inspection -f compose.yaml config and a nonexistent relative FOUNDRY_TLS_DIR. Implement the smallest safe Foundry-owned validation or bind configuration so a missing TLS source is not silently created, with reproducible tests. Do not claim that configuration rendering validates certificate trust, authenticated startup or M1 integration.

M0 inspection found that Compose renders successfully when `FOUNDRY_TLS_DIR` names a nonexistent path (including a relative path), although the documented prerequisite is an existing absolute TLS directory. Docker Compose bind mounts default to creating missing host directories, potentially leaving confusing host state before SR fails to load certificates. Reproduce with isolated placeholder values using `docker compose --env-file /dev/null -p foundry-m0-inspection -f compose.yaml config` and a nonexistent relative `FOUNDRY_TLS_DIR`. Implement the smallest safe Foundry-owned validation or bind configuration so a missing TLS source is not silently created, with reproducible tests. Do not claim that configuration rendering validates certificate trust, authenticated startup or M1 integration.
Author
Member

Actual Docker Desktop/WSL2 finding: adding Compose bind.create_host_path: false alone did not prevent host-path creation in an isolated one-off test. With FOUNDRY_ROUTER_IMAGE=alpine:latest, host router.example.com, a unique initially nonexistent /tmp/kilo/... TLS directory, and docker compose --env-file /dev/null -p <unique-project> -f compose.yaml run --no-deps --rm -T --entrypoint /bin/true router, the container returned 0 and the missing host directory existed afterward. Test project network/volume and the empty test directory were removed. The proposed Compose-only change was discarded; do not assume its documented semantics work on this target host.

An exact SR source image built from 209f7d39f3ecebbd1b98b11d7c44c63192fe50a4 rejected a non-loopback bind without TLS and the Foundry service with an empty TLS directory exited 2 with certificate/key/trust verification failure; no listener or authenticated access was established. Image build resolved a mutable base and dependencies, so it is not a fully pinned release build. A safe preflight must account for Compose's interpolation semantics and avoid exposing environment secrets, then be tested on the actual host; do not report the failed guard as a fix.

Actual Docker Desktop/WSL2 finding: adding Compose `bind.create_host_path: false` alone did **not** prevent host-path creation in an isolated one-off test. With `FOUNDRY_ROUTER_IMAGE=alpine:latest`, host `router.example.com`, a unique initially nonexistent `/tmp/kilo/...` TLS directory, and `docker compose --env-file /dev/null -p <unique-project> -f compose.yaml run --no-deps --rm -T --entrypoint /bin/true router`, the container returned 0 and the missing host directory existed afterward. Test project network/volume and the empty test directory were removed. The proposed Compose-only change was discarded; do not assume its documented semantics work on this target host. An exact SR source image built from `209f7d39f3ecebbd1b98b11d7c44c63192fe50a4` rejected a non-loopback bind without TLS and the Foundry service with an empty TLS directory exited 2 with certificate/key/trust verification failure; no listener or authenticated access was established. Image build resolved a mutable base and dependencies, so it is not a fully pinned release build. A safe preflight must account for Compose's interpolation semantics and avoid exposing environment secrets, then be tested on the actual host; do not report the failed guard as a fix.
Author
Member

Resolved for Foundry's supported make up startup path by merged PR #4, merge commit c8fd679e02e870e0545a082edd10c864d6a1d4ba; reviewed head 780b71330a9540aadf0e72f80dffd7da18438837. Nine isolated tests passed on Docker Desktop 4.97.0 / Compose v5.6.1 / WSL2, including no created project resources on rejected starts. Direct docker compose up bypasses the Makefile preflight and remains capable of creating a missing source; the previously tested create_host_path: false did not prevent that on this host. Host file checks do not establish TLS trust, container read access or authenticated startup. The independent GLM-5.3 review is a COMMENT, not human approval.

Resolved for Foundry's supported `make up` startup path by merged PR #4, merge commit `c8fd679e02e870e0545a082edd10c864d6a1d4ba`; reviewed head `780b71330a9540aadf0e72f80dffd7da18438837`. Nine isolated tests passed on Docker Desktop 4.97.0 / Compose v5.6.1 / WSL2, including no created project resources on rejected starts. Direct `docker compose up` bypasses the Makefile preflight and remains capable of creating a missing source; the previously tested `create_host_path: false` did not prevent that on this host. Host file checks do not establish TLS trust, container read access or authenticated startup. The independent GLM-5.3 review is a COMMENT, not human approval.
kilo closed this issue 2026-10-31 22:10:43 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Creatidy/foundry#3
No description provided.