TLS stage 1: https URL silently serves plain HTTP; AuditLog pull clients PSK on https; owner decisions D1–D13 (#64) #108

Open
opened 2026-11-09 17:12:01 -05:00 by dohertj2 · 4 comments
Owner

TLS rollout follow-ups from #64 (design: docs/plans/2026-11-09-tls-production-profile-design.md):

  • Bug (stage 1): central re-binds Kestrel ports from ASPNETCORE_URLS keeping only the port number and never enables TLS, so https://+:443 silently serves plain HTTP on 443. Make an https URL without a configured certificate refuse to boot; add the per-node certificate setting.
  • The three AuditLog pull clients still attach the site PSK as plaintext-only credentials, so they fail on https:// site endpoints — apply the same one-line change as 9138f3ed.
  • Owner decisions D1–D13 before any non-rig rollout: corporate CA (AD CS) for server+client certs on the wonder boxes; Windows store vs .pfx + Secrets password; service account (private-key ACL); production front door (Kestrel direct vs Traefik/IIS/LB) and 8085 vs 443; whether any wonder network is outside the plant boundary (the issue's trigger); PSK-over-TLS vs site client certs; Akka issuer pinning + hostname checking; site :8084 TLS; cert lifetime/renewal owner + expiry alerts; HSTS timing; rig Traefik re-encrypt vs terminate; OtOpcUa sign-and-encrypt + MxGateway TLS timing; SQL Server/LDAP (out of scope).
TLS rollout follow-ups from #64 (design: docs/plans/2026-11-09-tls-production-profile-design.md): - **Bug (stage 1):** central re-binds Kestrel ports from `ASPNETCORE_URLS` keeping only the port number and never enables TLS, so `https://+:443` silently serves plain HTTP on 443. Make an https URL without a configured certificate refuse to boot; add the per-node certificate setting. - The three AuditLog pull clients still attach the site PSK as plaintext-only credentials, so they fail on `https://` site endpoints — apply the same one-line change as 9138f3ed. - **Owner decisions D1–D13** before any non-rig rollout: corporate CA (AD CS) for server+client certs on the wonder boxes; Windows store vs .pfx + Secrets password; service account (private-key ACL); production front door (Kestrel direct vs Traefik/IIS/LB) and 8085 vs 443; whether any wonder network is outside the plant boundary (the issue's trigger); PSK-over-TLS vs site client certs; Akka issuer pinning + hostname checking; site :8084 TLS; cert lifetime/renewal owner + expiry alerts; HSTS timing; rig Traefik re-encrypt vs terminate; OtOpcUa sign-and-encrypt + MxGateway TLS timing; SQL Server/LDAP (out of scope).
dohertj2 added the type:followuppriority:p2 labels 2026-11-09 17:12:01 -05:00
Author
Owner

Both code items fixed on main 1ae4c7a4:

  • 7912d793 central https:// URLs in ASPNETCORE_URLS now bind with UseHttps from a node certificate (ScadaBridge:Node:Tls: CertificatePath+CertificatePassword (${secret:}) or CertificateThumbprint+StoreName/StoreLocation), still Http1AndHttp2; https without a certificate, a port listed as both http+https, or path+thumbprint both/neither → refuses to boot. http-only binding verified identical to the old loop (listen-options reflection compare); a real Kestrel TLS listener serves h2 + HTTP/1.1 from a generated .pfx.
  • 1ae4c7a4 the three AuditLog pull invokers pass the endpoint to WithSiteCredentials → PSK rides inside TLS on https (same as 9138f3ed). AuditLogPullTlsEndToEndTests (5): correct PSK, wrong PSK → PermissionDenied, untrusted cert fails.

Evidence: slnx 0 warnings/0 errors; Host 666/666, AuditLog 446/446, Communication 827/827. Reverting either fix turns its new tests red.

Scope note: only central's HTTP surface gets TLS; the gRPC + metrics listeners stay plaintext. Keeping this open for the D1–D13 decisions.

Both code items fixed on main `1ae4c7a4`: - `7912d793` central `https://` URLs in ASPNETCORE_URLS now bind with `UseHttps` from a node certificate (`ScadaBridge:Node:Tls`: `CertificatePath`+`CertificatePassword` (`${secret:}`) or `CertificateThumbprint`+`StoreName`/`StoreLocation`), still Http1AndHttp2; https without a certificate, a port listed as both http+https, or path+thumbprint both/neither → refuses to boot. http-only binding verified identical to the old loop (listen-options reflection compare); a real Kestrel TLS listener serves h2 + HTTP/1.1 from a generated .pfx. - `1ae4c7a4` the three AuditLog pull invokers pass the endpoint to `WithSiteCredentials` → PSK rides inside TLS on https (same as `9138f3ed`). `AuditLogPullTlsEndToEndTests` (5): correct PSK, wrong PSK → PermissionDenied, untrusted cert fails. Evidence: slnx 0 warnings/0 errors; Host 666/666, AuditLog 446/446, Communication 827/827. Reverting either fix turns its new tests red. Scope note: only central's HTTP surface gets TLS; the gRPC + metrics listeners stay plaintext. Keeping this open for the D1–D13 decisions.
Author
Owner

Owner decision 2026-11-09: park all TLS work. Stage-1 code stays on main, default-off. No rig stages 2–4 and no wonder stages for now; D1–D13 left undecided until a trigger (a network outside the plant boundary) appears.

**Owner decision 2026-11-09:** **park all TLS work.** Stage-1 code stays on main, default-off. No rig stages 2–4 and no wonder stages for now; D1–D13 left undecided until a trigger (a network outside the plant boundary) appears.
dohertj2 added the blocked label 2026-11-10 08:59:04 -05:00
Author
Owner

Labelled blocked. The owner decided to park all TLS work (2026-11-09).

Labelled `blocked`. The owner decided to park all TLS work (2026-11-09).
Author
Owner

Owner decisions 2026-11-13 on D1–D13 (design docs/plans/2026-11-09-tls-production-profile-design.md §11). TLS stays parked: the trigger (D5) has not been met, so there are no rig stages 2–4 and no wonder rollout. These are recorded so the plan is ready when a trigger appears.

  • D1/D2: use the corporate CA (AD CS) if it issues wonder-app-* certs with serverAuth+clientAuth, otherwise a ScadaBridge-dedicated offline private CA with its root in LocalMachine\Root. Keys go in LocalMachine\My by thumbprint, with private-key read for the service account.
  • D3: the account the ScadaBridge services already run as (read at rollout).
  • D4: Kestrel terminates TLS directly; keep :8085.
  • D5: not met; stay parked.
  • D6: PSK over TLS for gRPC (no client-cert mTLS).
  • D7: chain trust if the CA is ScadaBridge-dedicated; add issuer/subject pinning via DotNettySslSetup.CustomValidator if it is the corporate CA. ValidateCertificateHostname on from the first rollout.
  • D8: site :8084 stays HTTP for the first rollout.
  • D9: 1-year certs, renewal owned by the owner (AD CS auto-enrolment if used); a cert-expiry health check goes Degraded 30 days or less before expiry and shows in Overview.
  • D10: HSTS last, starting with a short max-age (~1 day) and raised later.
  • D11: the rig Traefik re-encrypts to Kestrel.
  • D12/D13: separate tracks that follow their own services (OtOpcUa SignAndEncrypt, mxgw TLS via mxaccessgw#180, SQL cert validation, LDAPS for NAM). Not a gate for ScadaBridge TLS.

Remaining open item before rollout: confirm with IT whether AD CS will issue wonder-app-* certs (D1).

Owner decisions 2026-11-13 on D1–D13 (design `docs/plans/2026-11-09-tls-production-profile-design.md` §11). **TLS stays parked**: the trigger (D5) has not been met, so there are no rig stages 2–4 and no wonder rollout. These are recorded so the plan is ready when a trigger appears. - **D1/D2:** use the corporate CA (AD CS) if it issues `wonder-app-*` certs with serverAuth+clientAuth, otherwise a ScadaBridge-dedicated offline private CA with its root in `LocalMachine\Root`. Keys go in `LocalMachine\My` by thumbprint, with private-key read for the service account. - **D3:** the account the ScadaBridge services already run as (read at rollout). - **D4:** Kestrel terminates TLS directly; keep `:8085`. - **D5:** not met; stay parked. - **D6:** PSK over TLS for gRPC (no client-cert mTLS). - **D7:** chain trust if the CA is ScadaBridge-dedicated; add issuer/subject pinning via `DotNettySslSetup.CustomValidator` if it is the corporate CA. `ValidateCertificateHostname` on from the first rollout. - **D8:** site `:8084` stays HTTP for the first rollout. - **D9:** 1-year certs, renewal owned by the owner (AD CS auto-enrolment if used); a cert-expiry health check goes Degraded 30 days or less before expiry and shows in Overview. - **D10:** HSTS last, starting with a short max-age (~1 day) and raised later. - **D11:** the rig Traefik re-encrypts to Kestrel. - **D12/D13:** separate tracks that follow their own services (OtOpcUa SignAndEncrypt, mxgw TLS via mxaccessgw#180, SQL cert validation, LDAPS for NAM). Not a gate for ScadaBridge TLS. Remaining open item before rollout: confirm with IT whether AD CS will issue `wonder-app-*` certs (D1).
Sign in to join this conversation.