[Secrets][Auth] Bring the ignitionoee router up to family pins (Secrets 0.2.3, Auth 0.1.5) #7

Closed
opened 2026-11-06 15:24:40 -05:00 by dohertj2 · 1 comment
Owner

What: The ignitionoee router (the uncounted fifth family consumer) lags the family on two security-relevant shared libraries. Bump it, or record an explicit decision.

Current state (verified 2026-11-06, ignitionoee origin/main @ 1a3e6d12):

  • ZB.MOM.WW.Secrets + .Ui 0.2.3 — the family minimum is 0.6.1+ (never 0.6.0), with the 4-arg AddZbSecrets(..., contentRootPath) overload at every pre-host ${secret:} expander call site. 0.2.3 predates the fail-closed store-path validation (absolute AND outside the content root) whose absence caused the 2026-08-09 mxgw outage (store recreated inside the content root and wiped by an upgrade). The pin bump alone does not close the hole; the 4-arg call does.
  • ZB.MOM.WW.Auth.* 0.1.5 — cannot log in against an AD domain root (continuation referrals; fixed in 0.2.1). LDAP for the router is ON HOLD (2026-08-13 decision), so this is lower urgency than Secrets.
  • Other pins: Theme 0.5.0, Health 0.3.0, Audit 0.1.0, Telemetry.Serilog 0.1.0.

Why here: cross-repo family-rollout tracking. The work itself lands in the ignitionoee repo.

Source: CLAUDE.md (Component normalization → Secrets row); auto-memory notes on Secrets rollout (2026-08-12: router on 0.2.3 "with the exact outage shape and no guard")

**What:** The ignitionoee router (the uncounted fifth family consumer) lags the family on two security-relevant shared libraries. Bump it, or record an explicit decision. **Current state (verified 2026-11-06, ignitionoee `origin/main` @ `1a3e6d12`):** - `ZB.MOM.WW.Secrets` + `.Ui` **`0.2.3`** — the family minimum is `0.6.1`+ (never `0.6.0`), with the 4-arg `AddZbSecrets(..., contentRootPath)` overload at every pre-host `${secret:}` expander call site. `0.2.3` predates the fail-closed store-path validation (absolute AND outside the content root) whose absence caused the 2026-08-09 mxgw outage (store recreated inside the content root and wiped by an upgrade). The pin bump alone does not close the hole; the 4-arg call does. - `ZB.MOM.WW.Auth.*` **`0.1.5`** — cannot log in against an AD domain root (continuation referrals; fixed in `0.2.1`). LDAP for the router is ON HOLD (2026-08-13 decision), so this is lower urgency than Secrets. - Other pins: Theme `0.5.0`, Health `0.3.0`, Audit `0.1.0`, Telemetry.Serilog `0.1.0`. **Why here:** cross-repo family-rollout tracking. The work itself lands in the ignitionoee repo. Source: `CLAUDE.md` (Component normalization → Secrets row); auto-memory notes on Secrets rollout (2026-08-12: router on 0.2.3 "with the exact outage shape and no guard")
dohertj2 added the type:followuppriority:p1cross-repomigrated labels 2026-11-06 15:24:40 -05:00
Author
Owner

Done — ignitionoee main @ 2b8ff324 (fast-forward from 1a3e6d12).

Pins (verified on the Gitea feed): ZB.MOM.WW.Secrets + .Ui 0.2.3 → 0.6.2; ZB.MOM.WW.Auth.{Abstractions,ApiKeys,AspNetCore,Ldap} 0.1.5 → 0.3.0. These match the four family apps. Auth needed no code change. Others are unchanged (Theme 0.5.0, Health 0.3.0, Audit 0.1.0, Telemetry.Serilog 0.1.0).

Call sites. Both pre-host ${secret:} expander sites now use the 4-arg AddZbSecrets(config, "Secrets", contentRoot):

  • Program.cs, with builder.Environment.ContentRootPath
  • ApiKeyCli.cs, with the CLI's content root

The host-container call passes the content root too.

Config. appsettings.json no longer sets Secrets:SqlitePath. The old value was data/oee-secrets.db, which is relative and inside the content root: the outage shape. When the key is unset, the router uses its own absolute default outside the install:

  • Windows: %ProgramData%\ZB.MOM.Oee\oee-secrets.db
  • macOS: ~/Library/Application Support/ZB.MOM.Oee/oee-secrets.db
  • Linux: ~/.local/share/ZB.MOM.Oee/oee-secrets.db

The default sits at the lowest precedence in Program.AddJsonSources. I didn't use the library's own default (ZB.MOM.WW/secrets.db) because every family app on the same account shares that file, each with a different master key.

Docker rig. The oee-router-data volume is now also mounted at /data, and the compose file sets Secrets__SqlitePath=/data/oee-secrets.db. The existing store carries over (this is the documented 0.6.1 container workaround).

Evidence

  • Build: 0 warnings, 0 errors. Full suite: 4631 passed, 0 failed (baseline before the change was 4626; the 5 new tests are the difference).
  • New SecretsStorePathGuardTests (5 tests):
    • control: the host boots with a temp-dir path
    • a path inside the content root is refused, and no file is created, for both the host and the CLI
    • a relative path is refused
    • the shipped default is absolute and outside the content root
  • Mutation check: I reverted both call sites to the 3-arg overload and the two "no file" tests went red:
    • host: a store was created at the rejected path: …/ZB.MOM.Oee.Host/secrets-guard-probe-…/oee-secrets.db
    • CLI: no exception at all, so the CLI would have quietly used a store inside the content root

⚠ Human step needed before deploying this build to OeeRouter (IGNTN-INT-VP01) — I did not do this; I had no access to the box:

  • The box's appsettings.json is never shipped in the zip, so it still has "SqlitePath": "data/oee-secrets.db". The new build will refuse to boot on it. A refused boot creates no file, so nothing is lost, but the service stays down.
  • Before the swap:
    1. Stop OeeRouter.
    2. Move F:\apps\ignitionrouter\data\oee-secrets.db (and any -wal/-shm) to a directory outside the install, e.g. F:\apps\ignitionrouter-data\ or C:\ProgramData\ZB.MOM.Oee\.
    3. Add Secrets__SqlitePath=<absolute path> to the service's registry Environment value. Alternatively, delete the key from the box's appsettings.json and use the ProgramData default.
    4. Swap in the build and start.
  • The service account needs write access to that directory.
  • Dev Mac: the old local store at router/src/ZB.MOM.Oee.Host/data/oee-secrets.db is no longer read. Move it to the default path, or set Secrets__SqlitePath.

Not changed, possible follow-up: the inbound API-key store (Oee:InboundApi:ApiKeyStore:SqlitePath = data/oee-inbound-api-keys.sqlite) has the same inside-the-install shape. Auth has no path guard, so it still boots. That file was the main cause of the 2026-09-23 19-minute 401 incident.

Done — ignitionoee `main` @ **`2b8ff324`** (fast-forward from `1a3e6d12`). **Pins** (verified on the Gitea feed): `ZB.MOM.WW.Secrets` + `.Ui` 0.2.3 → **0.6.2**; `ZB.MOM.WW.Auth.{Abstractions,ApiKeys,AspNetCore,Ldap}` 0.1.5 → **0.3.0**. These match the four family apps. Auth needed no code change. Others are unchanged (Theme 0.5.0, Health 0.3.0, Audit 0.1.0, Telemetry.Serilog 0.1.0). **Call sites.** Both pre-host `${secret:}` expander sites now use the 4-arg `AddZbSecrets(config, "Secrets", contentRoot)`: - `Program.cs`, with `builder.Environment.ContentRootPath` - `ApiKeyCli.cs`, with the CLI's content root The host-container call passes the content root too. **Config.** `appsettings.json` no longer sets `Secrets:SqlitePath`. The old value was `data/oee-secrets.db`, which is relative and inside the content root: the outage shape. When the key is unset, the router uses its own absolute default outside the install: - Windows: `%ProgramData%\ZB.MOM.Oee\oee-secrets.db` - macOS: `~/Library/Application Support/ZB.MOM.Oee/oee-secrets.db` - Linux: `~/.local/share/ZB.MOM.Oee/oee-secrets.db` The default sits at the lowest precedence in `Program.AddJsonSources`. I didn't use the library's own default (`ZB.MOM.WW/secrets.db`) because every family app on the same account shares that file, each with a different master key. **Docker rig.** The `oee-router-data` volume is now also mounted at `/data`, and the compose file sets `Secrets__SqlitePath=/data/oee-secrets.db`. The existing store carries over (this is the documented 0.6.1 container workaround). **Evidence** - Build: 0 warnings, 0 errors. Full suite: **4631 passed, 0 failed** (baseline before the change was 4626; the 5 new tests are the difference). - New `SecretsStorePathGuardTests` (5 tests): - control: the host boots with a temp-dir path - a path inside the content root is refused, and **no file is created**, for both the host and the CLI - a relative path is refused - the shipped default is absolute and outside the content root - Mutation check: I reverted both call sites to the 3-arg overload and the two "no file" tests went red: - host: `a store was created at the rejected path: …/ZB.MOM.Oee.Host/secrets-guard-probe-…/oee-secrets.db` - CLI: no exception at all, so the CLI would have quietly used a store inside the content root **⚠ Human step needed before deploying this build to `OeeRouter` (IGNTN-INT-VP01)** — I did not do this; I had no access to the box: - The box's `appsettings.json` is never shipped in the zip, so it still has `"SqlitePath": "data/oee-secrets.db"`. **The new build will refuse to boot on it.** A refused boot creates no file, so nothing is lost, but the service stays down. - Before the swap: 1. Stop `OeeRouter`. 2. Move `F:\apps\ignitionrouter\data\oee-secrets.db` (and any `-wal`/`-shm`) to a directory outside the install, e.g. `F:\apps\ignitionrouter-data\` or `C:\ProgramData\ZB.MOM.Oee\`. 3. Add `Secrets__SqlitePath=<absolute path>` to the service's registry `Environment` value. Alternatively, delete the key from the box's `appsettings.json` and use the ProgramData default. 4. Swap in the build and start. - The service account needs write access to that directory. - Dev Mac: the old local store at `router/src/ZB.MOM.Oee.Host/data/oee-secrets.db` is no longer read. Move it to the default path, or set `Secrets__SqlitePath`. **Not changed, possible follow-up:** the inbound API-key store (`Oee:InboundApi:ApiKeyStore:SqlitePath = data/oee-inbound-api-keys.sqlite`) has the same inside-the-install shape. Auth has no path guard, so it still boots. That file was the main cause of the 2026-09-23 19-minute 401 incident.
Sign in to join this conversation.