fix(security): finish Bws/Infisical secrets injection — close 3-thread gap #237

Closed
opened 2026-05-12 07:59:20 +02:00 by pdurlej · 6 comments
Owner

Why this matters (and how it helps Iskra)

Iskra's mail loop (#235), Phase 1.0 bundle (#236), and DR restore (#238) all need a clean secrets pipeline. Currently we have:

  • gateway secrets passed via env, not bws (commit 617b59fa, Apr 4)
  • 3 High findings unresolved per 44684022 Apr 5: curl -k, plaintext fallback, service token in plaintext
  • 3 uncommitted bws files on RS2000 sitting orphaned: docs/bws-setup.md, scripts/bws-preflight.sh, scripts/bws-run.sh

Per state/L3/OPEN_LOOPS.md: "each thread independently surfaces same gap" across 3 separate audits. We've been talking about this since April 5. It's a class/security-sensitive root-cause for downstream issues.


Context (from state/L3/OPEN_LOOPS.mdunresolved_active cluster "Bws/Infisical secrets injection")

3 audits, same gap, never closed:

Date Commit Finding
Apr 5 44684022 3 High findings: curl -k (TLS validation bypass), plaintext fallback in fetch path, service token stored as env var
Apr 4 617b59fa gateway secrets passed via env, not bws — i.e., the bws CLI is installed but the pipeline never connects to it
Apr 12 a931c692 same status confirmed — no progress between Apr 4 and Apr 12

On VPS-side: 3 niecommitowane pliki: docs/bws-setup.md, scripts/bws-preflight.sh, scripts/bws-run.sh — sit on RS2000 uncommitted. Either commit them or formally archive.

Adjacent: Infisical bridge on RS2000 — referenced as gate for canary-required.yml automation per DeepSeek 2026-05-11 review.


Acceptance criteria

  • Decision-PR first (operator + Codex joint): bws vs Infisical vs hybrid. Land an ADR if needed. Per OPEN_LOOPS deeper feedback: "mixed-signal architecture must allow cleanup later, not endless agony." Pick ONE primary secrets backend.
  • Recover uncommitted scripts: SSH to RS2000, capture current state of the 3 bws files. Either commit (after review) or formally archive in state/archive/ per ADR-0006.
  • Fix 3 High findings from Apr 5:
    • curl -k → use real TLS validation with pinned CA if needed
    • plaintext fallback → fail-closed, no plaintext path
    • service token in env → bws/Infisical-sourced, never inline
  • Wire gateway to chosen backend: at least one production secret (start with mail-infra dispatch token from #235) flows through bws/Infisical, not plain env.
  • Runbook: runbooks/secrets-pipeline.md covers rotation + emergency disconnect + bootstrap recovery.

Codex Packet

Scope: class/security-sensitive — smallest coherent PRs per AGENTS.md + REVIEW.md class/security-sensitive rules. Full canary 3+3 tier per ADR-0007.

Hard sequence (don't skip):

  1. Decision PR: ADR or operator-decision comment. Pick bws OR Infisical OR explicit hybrid pattern. Until this lands, NO downstream PRs.
  2. Recon + recovery PR: capture the 3 uncommitted RS2000 files. Read-only SSH, then file PR with their content + decision (commit vs archive).
  3. 3-fixes PR: address the Apr 5 High findings. Standalone, doesn't depend on backend choice.
  4. Wire-up PR: connect one production secret through chosen backend. Smallest possible: just the mail dispatch token from #235.
  5. Runbook PR: operational documentation.

Non-goals (DON'T do this)

  • "Migrate all secrets at once" — that's the endless-agony anti-pattern. One secret at a time, smallest PRs.
  • Bootstrap bws + Infisical both — pick ONE primary.
  • Touching policies/sacred-paths.yaml to "unlock" anything. Hard fail.
  • Storing secrets in module.yaml even temporarily for testing. Hard fail.
  • Forgejo repo secrets for production deploys (PR #234 already drew this line — respect it).

References

  • state/L3/OPEN_LOOPS.md — "Bws/Infisical secrets injection — never closed despite 3 threads"
  • Commits: 44684022 (Apr 5), 617b59fa (Apr 4), a931c692 (Apr 12)
  • AGENTS.md §security-sensitive class
  • REVIEW.md — class/security-sensitive triggers Full review tier
  • DeepSeek review 2026-05-11 — flagged Infisical bridge as RS2000 prerequisite

Filed by claude (Prof Kong intermezzo, 2026-05-12 morning).

## Why this matters (and how it helps Iskra) Iskra's mail loop (#235), Phase 1.0 bundle (#236), and DR restore (#238) all need a **clean secrets pipeline**. Currently we have: - gateway secrets passed via **env, not bws** (commit `617b59fa`, Apr 4) - 3 High findings unresolved per `44684022` Apr 5: `curl -k`, plaintext fallback, service token in plaintext - **3 uncommitted bws files on RS2000** sitting orphaned: `docs/bws-setup.md`, `scripts/bws-preflight.sh`, `scripts/bws-run.sh` Per `state/L3/OPEN_LOOPS.md`: *"each thread independently surfaces same gap"* across 3 separate audits. We've been talking about this since April 5. It's a class/security-sensitive root-cause for downstream issues. --- ## Context (from `state/L3/OPEN_LOOPS.md` — `unresolved_active` cluster "Bws/Infisical secrets injection") **3 audits, same gap, never closed:** | Date | Commit | Finding | |---|---|---| | Apr 5 | `44684022` | 3 High findings: `curl -k` (TLS validation bypass), plaintext fallback in fetch path, service token stored as env var | | Apr 4 | `617b59fa` | gateway secrets passed via env, not bws — i.e., the bws CLI is installed but the pipeline never connects to it | | Apr 12 | `a931c692` | same status confirmed — no progress between Apr 4 and Apr 12 | **On VPS-side**: 3 niecommitowane pliki: `docs/bws-setup.md`, `scripts/bws-preflight.sh`, `scripts/bws-run.sh` — sit on RS2000 uncommitted. Either commit them or formally archive. **Adjacent**: Infisical bridge on RS2000 — referenced as gate for `canary-required.yml` automation per DeepSeek 2026-05-11 review. --- ## Acceptance criteria - [ ] **Decision-PR first** (operator + Codex joint): bws vs Infisical vs hybrid. Land an ADR if needed. Per OPEN_LOOPS deeper feedback: *"mixed-signal architecture must allow cleanup later, not endless agony."* Pick ONE primary secrets backend. - [ ] **Recover uncommitted scripts**: SSH to RS2000, capture current state of the 3 bws files. Either commit (after review) or formally archive in `state/archive/` per ADR-0006. - [ ] **Fix 3 High findings from Apr 5**: - `curl -k` → use real TLS validation with pinned CA if needed - plaintext fallback → fail-closed, no plaintext path - service token in env → bws/Infisical-sourced, never inline - [ ] **Wire gateway to chosen backend**: at least one production secret (start with mail-infra dispatch token from #235) flows through bws/Infisical, not plain env. - [ ] **Runbook**: `runbooks/secrets-pipeline.md` covers rotation + emergency disconnect + bootstrap recovery. --- ## Codex Packet **Scope**: class/security-sensitive — smallest coherent PRs per AGENTS.md + REVIEW.md `class/security-sensitive` rules. Full canary 3+3 tier per ADR-0007. **Hard sequence** (don't skip): 1. **Decision PR**: ADR or operator-decision comment. Pick bws OR Infisical OR explicit hybrid pattern. Until this lands, NO downstream PRs. 2. **Recon + recovery PR**: capture the 3 uncommitted RS2000 files. Read-only SSH, then file PR with their content + decision (commit vs archive). 3. **3-fixes PR**: address the Apr 5 High findings. Standalone, doesn't depend on backend choice. 4. **Wire-up PR**: connect one production secret through chosen backend. Smallest possible: just the mail dispatch token from #235. 5. **Runbook PR**: operational documentation. --- ## Non-goals (DON'T do this) - ❌ "Migrate all secrets at once" — that's the endless-agony anti-pattern. One secret at a time, smallest PRs. - ❌ Bootstrap bws + Infisical both — pick ONE primary. - ❌ Touching `policies/sacred-paths.yaml` to "unlock" anything. Hard fail. - ❌ Storing secrets in `module.yaml` even temporarily for testing. Hard fail. - ❌ Forgejo repo secrets for production deploys (PR #234 already drew this line — respect it). --- ## References - `state/L3/OPEN_LOOPS.md` — "Bws/Infisical secrets injection — never closed despite 3 threads" - Commits: `44684022` (Apr 5), `617b59fa` (Apr 4), `a931c692` (Apr 12) - AGENTS.md §security-sensitive class - REVIEW.md — class/security-sensitive triggers Full review tier - DeepSeek review 2026-05-11 — flagged Infisical bridge as RS2000 prerequisite --- *Filed by claude (Prof Kong intermezzo, 2026-05-12 morning).*
Author
Owner

Codex live audit: this is still the hard blocker — 2026-05-18 16:56 CEST

Verified on rs2000:

  • /data/platformctl/infisical-client-secret exists and is root:root 0600.
  • /data/platformctl/canary.env does not exist.
  • /data/platformctl/reports/canary-readiness-current.json is stale from 2026-05-10 and says ready=false, status=not_configured.
  • Missing canary env keys include PLATFORMCTL_CANARY_ENV_SCHEMA, PLATFORMCTL_CANARY_ENV_SOURCE, PLATFORMCTL_CANARY_ENV_SECRET_MAP_SHA256, PLATFORMCTL_ZAI_API_KEY.
  • direct Universal Auth smoke currently fails with 401 Invalid credentials.

So the secrets bridge is not operational for the canary path yet. This issue should remain open until the machine identity can generate the canary env file and the readiness report is green.

Non-negotiable constraint preserved: do not replace this with direct Forgejo repo secrets for ZAI/OpenAI/Anthropic/Claude/etc. The right fix is machine identity ↔ Infisical ↔ machine-local env file, plus non-secret metadata proving provenance.

<!-- codex-actions-audit-2026-05-18 --> ## Codex live audit: this is still the hard blocker — 2026-05-18 16:56 CEST Verified on rs2000: - `/data/platformctl/infisical-client-secret` exists and is `root:root 0600`. - `/data/platformctl/canary.env` does **not** exist. - `/data/platformctl/reports/canary-readiness-current.json` is stale from 2026-05-10 and says `ready=false`, `status=not_configured`. - Missing canary env keys include `PLATFORMCTL_CANARY_ENV_SCHEMA`, `PLATFORMCTL_CANARY_ENV_SOURCE`, `PLATFORMCTL_CANARY_ENV_SECRET_MAP_SHA256`, `PLATFORMCTL_ZAI_API_KEY`. - direct Universal Auth smoke currently fails with `401 Invalid credentials`. So the secrets bridge is not operational for the canary path yet. This issue should remain open until the machine identity can generate the canary env file and the readiness report is green. Non-negotiable constraint preserved: do not replace this with direct Forgejo repo secrets for ZAI/OpenAI/Anthropic/Claude/etc. The right fix is machine identity ↔ Infisical ↔ machine-local env file, plus non-secret metadata proving provenance.
Collaborator

W4c Slice 1 — Infisical primary decision PR opened — 2026-05-24

Role: executor
Intent: checkpoint
Needs owner: yes, via PR merge decision

Opened #438 as the #237 Decision PR slice.

What it decides

  • Infisical is the primary platform secrets backend.
  • BWS is legacy/recovery material unless a future ADR grants a narrow exception.
  • Generated runtime env files are allowed only as protected Infisical-rendered runtime artifacts.
  • No bulk migration; one consumer/secret class at a time.

What it does not do

  • No runtime mutation.
  • No secret migration.
  • No Vault sunset.
  • No BWS file recovery/archive yet.
  • No #124 Honcho Redis leak fix yet.

Next after merge

Proceed with W4c recovery/archive inventory for old BWS files, then narrow concrete leak fixes such as #124.

## W4c Slice 1 — Infisical primary decision PR opened — 2026-05-24 **Role:** executor **Intent:** checkpoint **Needs owner:** yes, via PR merge decision Opened #438 as the #237 Decision PR slice. ### What it decides - Infisical is the primary platform secrets backend. - BWS is legacy/recovery material unless a future ADR grants a narrow exception. - Generated runtime env files are allowed only as protected Infisical-rendered runtime artifacts. - No bulk migration; one consumer/secret class at a time. ### What it does not do - No runtime mutation. - No secret migration. - No Vault sunset. - No BWS file recovery/archive yet. - No #124 Honcho Redis leak fix yet. ### Next after merge Proceed with W4c recovery/archive inventory for old BWS files, then narrow concrete leak fixes such as #124.
Collaborator

W4c BWS recovery/archive recon — 2026-05-24

Role: executor
Intent: checkpoint
Needs owner: no, unless operator has an external backup/private copy of the old BWS files

Opened #440 as the BWS recovery/archive recon PR.

Result

The three historical BWS target files from #237 are not present in current checked locations:

  • current repo target file search: no matches
  • git history target file search: no matches
  • RS2000 targeted roots: no target files
  • RS2000 legacy git status for target files: no output
  • RS2000 wider read-only find across typical roots: no target files

No file contents were printed or copied. No runtime mutation.

Decision recorded in PR

No BWS content can be safely committed or archived from current RS2000 state. The archive result is metadata-only negative evidence. BWS remains legacy/recovery material per ADR-0024.

Remaining #237 work

  • fix Apr 5 high findings as narrow PRs;
  • wire one production secret through the chosen Infisical-backed path;
  • keep #124 as a separate concrete leak fix.
## W4c BWS recovery/archive recon — 2026-05-24 **Role:** executor **Intent:** checkpoint **Needs owner:** no, unless operator has an external backup/private copy of the old BWS files Opened #440 as the BWS recovery/archive recon PR. ### Result The three historical BWS target files from #237 are not present in current checked locations: - current repo target file search: no matches - git history target file search: no matches - RS2000 targeted roots: no target files - RS2000 legacy git status for target files: no output - RS2000 wider read-only find across typical roots: no target files No file contents were printed or copied. No runtime mutation. ### Decision recorded in PR No BWS content can be safely committed or archived from current RS2000 state. The archive result is metadata-only negative evidence. BWS remains legacy/recovery material per ADR-0024. ### Remaining #237 work - fix Apr 5 high findings as narrow PRs; - wire one production secret through the chosen Infisical-backed path; - keep #124 as a separate concrete leak fix.
Collaborator

W4d/W4e closeout prep opened — 2026-05-24

Role: executor
Intent: checkpoint
Needs owner: no immediate action beyond PR review

Opened #442 to prepare W4 closeout after the parallel W4 fork PRs merge.

It classifies W4 blockers vs follow-up milestones:

  • blockers only if unresolved: #237 residual slices, #124 handling, #56 current identity standard;
  • follow-up, not W4 blockers: #274 rotation, #132/#181 YubiKey, #64 Vault sunset, #131 VPS1000/OpenClaw config migration.

Runtime: none.

## W4d/W4e closeout prep opened — 2026-05-24 **Role:** executor **Intent:** checkpoint **Needs owner:** no immediate action beyond PR review Opened #442 to prepare W4 closeout after the parallel W4 fork PRs merge. It classifies W4 blockers vs follow-up milestones: - blockers only if unresolved: #237 residual slices, #124 handling, #56 current identity standard; - follow-up, not W4 blockers: #274 rotation, #132/#181 YubiKey, #64 Vault sunset, #131 VPS1000/OpenClaw config migration. Runtime: none.
Collaborator

W4c BWS/Infisical follow-up has been consolidated into #443. If #443 merges, the W4 backend ambiguity and stale BWS-file recovery item are resolved; residual concrete fixes should continue as narrow follow-ups, not broad backend debate.

W4c BWS/Infisical follow-up has been consolidated into #443. If #443 merges, the W4 backend ambiguity and stale BWS-file recovery item are resolved; residual concrete fixes should continue as narrow follow-ups, not broad backend debate.
Collaborator

Closing after M03 triage as the broad parent is now superseded/resolved.

Evidence:

  • ADR-0024 accepted Infisical as the primary platform secrets backend.
  • runbooks/secrets-pipeline.md now defines the operational contract.
  • state/reports/w4c-bws-recovery-archive-2026-05-24.md records the BWS recovery/archive recon: the historical three BWS files were not found in current repo or checked RS2000 roots.
  • #124 closed the concrete Honcho Redis argv leak evidence path.
  • #605 and #606 added the current canary/Ollama env aliasing, Infisical key map, and Agent SOS docs so agents stop guessing path names.

What this does not claim:

  • It does not say every future secret cutover is complete.
  • It does not sunset Vault.
  • It does not rotate #274.
  • It does not authorize issue/comment writers or runtime secret mutations.

Remaining work should be tracked as narrow, concrete issues when found. Keeping this broad April-era bucket open now creates more ambiguity than safety.

Closing after M03 triage as the broad parent is now superseded/resolved. Evidence: - ADR-0024 accepted Infisical as the primary platform secrets backend. - `runbooks/secrets-pipeline.md` now defines the operational contract. - `state/reports/w4c-bws-recovery-archive-2026-05-24.md` records the BWS recovery/archive recon: the historical three BWS files were not found in current repo or checked RS2000 roots. - #124 closed the concrete Honcho Redis argv leak evidence path. - #605 and #606 added the current canary/Ollama env aliasing, Infisical key map, and Agent SOS docs so agents stop guessing path names. What this does not claim: - It does not say every future secret cutover is complete. - It does not sunset Vault. - It does not rotate #274. - It does not authorize issue/comment writers or runtime secret mutations. Remaining work should be tracked as narrow, concrete issues when found. Keeping this broad April-era bucket open now creates more ambiguity than safety.
codex closed this issue 2026-05-29 16:49:44 +02:00
Sign in to join this conversation.
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
iterating
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
large-impact
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No project
No assignees
2 participants
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
pdurlej/platform#237
No description provided.