diff --git a/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/2026-11-24T01-37-13Z_report_secrets-stack-analysis.md b/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/2026-11-24T01-37-13Z_report_secrets-stack-analysis.md new file mode 100644 index 000000000..f7921a32f --- /dev/null +++ b/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/2026-11-24T01-37-13Z_report_secrets-stack-analysis.md @@ -0,0 +1,140 @@ +# Secrets stack analysis — attestation-based issuance, SOPS scope, and the cluster overlap map + +*Lane SECRETS-STACK-ANALYSIS, 2026-11-24. Answers Drew's questions of 2026-11-23 ~19:34 CST. Sources: the CNCF security & identity survey (2026-11-23, `doc/2026-11-23T22-33-41Z_research_cncf-landscape/`), the secrets-plane design #13948 and its parent problem #13893, the fleet CA / credentials programme #9155, and the IdP story #13658. Secrets are referenced by name only throughout; no values appear anywhere in this record.* + +## Verdicts up front + +| Question | Answer | +|---|---| +| What is attestation-based secretless issuance, and should we build or adopt it? | A workload proves what it is from platform evidence and is minted a short-lived credential (a SPIFFE SVID); no bootstrap secret exists anywhere. **Adopt SPIRE, chained under the fleet CA, when the first real cluster workload-identity need lands — do not build our own attestation.** Until then, no new system. | +| Should all secrets management move to SOPS? | **No.** SOPS is the right home for config-shaped, deploy-time secrets (including in the public repo, under the conditions in §2.3). It has no runtime-delivery, per-access audit, dynamic-minting, or real revocation story, so it cannot replace the broker/stores design in #13948. The two compose: disjoint sets of secrets, one system of record per secret. | +| Keycloak + cert-manager + External Secrets Operator — does OpenBao still have a job? | The three cover people-login, in-cluster certificates, and secret *delivery* respectively. None of them mints dynamic secrets, offers transit encryption, or leases/revokes credentials — that remainder is OpenBao's alone. **Posture: Keycloak skip, cert-manager adopt at cluster time, ESO adopt at cluster time, OpenBao defer until a dynamic-secrets need is real.** | + +--- + +## 1. Attestation-based secretless issuance + +### 1.1 What it is + +Drew's sketch — "a cert to every container launch" — is essentially correct. The full shape: + +In the stored-secret model, a workload proves its identity by *presenting* something it was given earlier: a token in an environment variable, a key file baked into an image, a Kubernetes Secret mounted into the pod. That thing can be copied, leaked, and replayed from anywhere, and it usually lives for months. + +In the attestation model, the workload presents **nothing**. Instead, a trusted local agent inspects *evidence about the workload that the workload cannot forge* and vouches for it to an issuing server: + +1. **Node attestation** — the agent first proves which machine it runs on. Evidence types: a Kubernetes projected service-account token (the `k8s_psat` attestor), a cloud instance identity document (AWS/GCP/Azure metadata, verified against the provider), a TPM / DevID certificate, or an SSH host identity. (A pre-shared *join token* also exists as an attestor — and using it reintroduces exactly the bootstrap secret the design exists to eliminate.) +2. **Workload attestation** — when a process asks the agent for an identity (over a local Unix socket, the SPIFFE Workload API — the caller presents no credential at all), the agent derives **selectors** from the caller's process via the kernel, kubelet, and container runtime: Kubernetes namespace and service account, container image digest, Unix UID, systemd unit name, process path, and similar. +3. **Registration entries** — the server holds policy mapping selector sets to a SPIFFE ID (e.g. `spiffe:///ns//sa/`). If the attested selectors match an entry, the server signs an **SVID** — an X.509 certificate (or JWT) carrying that ID. +4. **Lifetime and rotation** — SPIRE's defaults are a 1-hour X.509 SVID and a 5-minute JWT SVID, rotated automatically at half-life by the agent, with no restart and no human. There is no CRL-based revocation story; **revocation is achieved by deregistering the entry** — the workload simply stops receiving fresh SVIDs and its existing one expires within the hour. +5. **Verification** — peers validate the SVID against the trust domain's bundle and authorise on the SPIFFE ID itself. + +So the bootstrap secret is not moved or better hidden; it is *deleted*, and the root of trust becomes "the platform's own account of what is running where." + +### 1.2 Honest limits + +- **Attestation proves environment, not intent or code quality.** A compromised workload running in the right namespace with the right service account attests perfectly. Selectors are the security policy: an entry keyed only on namespace is a much weaker claim than one keyed on namespace + service account + image digest, and writing entries by hand drifts — in Kubernetes the entries should be generated (SPIRE Controller Manager / `ClusterSPIFFEID` templates), not hand-maintained. +- **Node trust is load-bearing.** The SPIRE documentation itself warns that workload attestation is only a reliable signal for *unprivileged* workloads: root on the node can manufacture the evidence. Attestation raises the bar from "stole a file" to "owns the node" — a real improvement, not a proof against node compromise. +- **The bootstrap problem moves, it does not vanish.** It concentrates in node attestation: if node evidence is weak (join tokens, spoofable metadata), the whole chain inherits the weakness. +- **An SVID is identity, not a secret vault.** It gets a workload *authenticated*; turning that into data-plane secrets still requires an exchange step — a vault/broker auth method that accepts the SVID and returns the actual secret. Attestation replaces the credential a workload *starts* with, not the secrets it ultimately *uses*. +- **It is infrastructure.** A SPIRE server (HA if it matters), an agent on every node, entry lifecycle, bundle distribution. Small, but not free, and idle weight until workloads actually consume SVIDs. + +### 1.3 Our fit + +The CNCF survey's framing stands: **the fleet CA enrols machines; workloads are a different subject, and attestation is the one genuine gap in the house stack.** Our estate PKI is ahead of the alternatives for what it aims at — multi-algorithm roots, tested escrow/restoration, `fleet cert` issuance for hosts and services (#9155) — but a host certificate answers "which machine is this," not "which process, in which pod, running which image, is calling right now." + +Two ways to close the gap: + +**Option A — SPIRE chained under the fleet CA (recommended).** SPIRE is explicitly designed to anchor under an existing CA: its UpstreamAuthority plugin obtains the SPIRE server's intermediate signing certificate from an upstream PKI (stock plugins include a CA loaded from disk, AWS PCA, GCP CAS, Vault PKI, and cert-manager — so our CA can serve directly via a disk-loaded intermediate, or indirectly through a cert-manager Issuer that chains to it). Root custody, escrow, and algorithm policy stay exactly where #9155 put them; SPIRE adds only the attestation and per-workload granularity it is good at. SPIRE also is not Kubernetes-only — agents run on bare hosts/VMs with systemd and Unix selectors, which suits our NixOS fleet shape. + +**Option B — build attestation into our own issuance.** Extend `fleet cert` / the broker with selector collection and entry policy. Pros: no new system, reuses fleet enrolment, NixOS/systemd evidence is natural on our hosts. Cons: attestation is security-critical code where the failure mode is *subtle forgery acceptance*, the selector ecosystem (kubelet, runtimes, cloud metadata) is a moving target that SPIRE's maintainers track full-time, and every hour spent here is an hour not spent on the fleet's actual differentiators. We would own the risk forever to save running one well-understood daemon set later. + +**Recommendation: Option A, on a trigger, not today.** There is no production cluster and no workload today whose identity problem a broker token doesn't solve; deploying SPIRE now would be idle infrastructure. The day in-cluster (or multi-process host) workloads need identity that isn't a stored secret, SPIRE is the pre-chosen answer, chained under the fleet CA. One cheap interim exists if a single bridge is ever needed before that day: OpenBao's PKI engine (since 2.6) can issue SPIFFE-shaped documents — noted in the CNCF survey — but that is a stopgap, not the plan. + +--- + +## 2. Should all secrets management move to SOPS? + +### 2.1 What SOPS actually is, mechanically + +SOPS encrypts the *values* in structured files (YAML/JSON/ENV/INI/binary), leaving keys and structure readable so diffs stay reviewable. Each file gets a random data key; values are encrypted with it (AES-256-GCM, with a MAC over the file); the data key is wrapped once per **recipient** — an age public key, a PGP key, or a cloud KMS key. Anyone holding a matching private key (or KMS grant) decrypts. `.sops.yaml` creation rules choose recipient sets by path, so "who can decrypt what" is itself versioned policy. + +### 2.2 What it covers well — and what it structurally does not + +**Covers well (config-shaped secrets at rest):** + +- Secrets that travel *with configuration through git*: NixOS host configuration (the sops-nix pattern — decrypt at activation, per-host age keys generated on the host), GitOps payloads (Flux decrypts SOPS natively in-cluster), CI materialisation (one age key or KMS grant in the pipeline, plaintext only in memory/at deploy). +- Whole-file encryption when a config is mostly sensitive; per-environment/per-team recipient topology; rotation of the *recipient set* as a concrete re-wrap operation (`sops rotate`). + +**Does not cover (and no file format can):** + +- **Runtime delivery.** A running process that needs a secret *by name, now, possibly on a machine with no repo checkout* gets nothing from SOPS. The broker's whole shape — named fetch, tiered cache, no plaintext in any repo — exists for this case. +- **Rotation without redeploy.** Changing a SOPS-held value means edit, commit, push, redeploy/re-activate. Changing a broker-held value is a `put` (#13948 §5.5) and the next fetch sees it. +- **Revocation.** Git history is permanent and replicated to every clone. Removing a recipient re-wraps *current* files; every historical version remains decryptable by the old key, and the *underlying secret values* in those versions are unchanged — real revocation still means rotating the secrets themselves, file by file. A broker/store revokes centrally and immediately. +- **Per-access audit.** SOPS has no record of who decrypted what, ever. The broker and stores log access by name. +- **Dynamic secrets.** Nothing is minted per-use with a TTL and a lease; a SOPS value is a static string until a human changes it. +- **Per-workload identity.** A recipient key decrypts *everything wrapped to it* — granularity is per-file recipient sets, never per-process. (This is exactly the gap §1's attestation addresses, from the other side.) + +**Where the key-custody problem moves:** from store accounts to age private keys — one per host/person, each needing escrow and a tested restore. Custody doesn't shrink; it changes shape. Losing an age key loses everything wrapped to it; leaking one opens everything ever wrapped to it, history included. + +### 2.3 The repo question, head-on + +**Is SOPS ciphertext safe in a public repo?** The cryptography, yes — AES-256-GCM values under age/KMS wrapping is not the weak point, and public SOPS stores are a real, working pattern in the wild (one documented fleet ran its whole SOPS store in a public repository; the failure that eventually moved it private was a *recipient-set* defect — one catch-all rule wrapping six identities' secrets to all six keys — not a cryptanalytic one; see supplements). But "the ciphertext is strong" is not the whole answer: + +- **Metadata leaks by design.** Key names, file paths, structure, which values changed and when, ciphertext sizes, and the recipient public keys (which identify hosts and people) are all public. That is an inventory of what secrets exist and how the estate is shaped. +- **History is forever, publicly archived.** Public ciphertext is copied by mirrors, forks, and crawlers beyond any later deletion. This creates a *harvest-now, decrypt-later* exposure: any future compromise of a recipient private key retroactively opens every historical version wrapped to it. In a private repo, a leaked key opens the current set; in a public repo, it opens the *archaeology*. +- **Blast radius concentrates.** One leaked host age key + a public repo = every value ever wrapped to that host, no further access needed. The same leak against the broker model yields a token that can be revoked and an access log to inspect. +- **Operational asymmetry.** A single plaintext mistake in a public repo is scraped within minutes and is un-recallable. (True in private repos too — but the audience is whoever holds repo access, not the internet.) + +**Vs a private secrets repo:** Drew's stated costs are real and we weigh them as stated — a second repo to keep in step, and private flake inputs make Nix builds harder (builders and CI need credentials to fetch the input, which is itself a secret-distribution problem, and public reproducibility suffers). Mitigations exist (a private repo consumed as a non-flake path input; sops-nix reading from outside the flake), but each is friction purchased to protect *metadata and history*, not values. + +**The hybrid shape (recommended):** the question "public or private repo?" only has to be answered for the class of secrets SOPS is actually suited to, and for that class the public repo is acceptable *under discipline*: + +- **Tier A — crown jewels and runtime secrets: never SOPS-only, in any repo.** CA private keys, broker/store tokens, and anything needing revocation, audit, or rotation-without-redeploy stay in the #13948 world: Bitwarden Secrets primary, 1Password mirror, broker delivery, name-only references in git. (This is already how CA material is held under #9155.) +- **Tier B — config-shaped, deploy-time secrets: SOPS, in the same (public) repo.** Conditions: one file per recipient set (a file's name effectively states who can open it — the documented lesson from the public-store case above); per-host age keys generated on the host; values individually low-to-medium sensitivity and individually rotatable; no single catch-all creation rule. +- **Tier C — cluster-bound secrets:** delivered by ESO from the Tier A stores (§3), or SOPS-via-Flux for Tier B material — chosen per cluster, not globally. + +### 2.4 Composition with #13948 — the actual recommendation + +**Do not move all secrets management to SOPS. The two systems govern disjoint sets, with one system of record per secret:** + +- #13948 (delta refresh, peer sync, dual-store `put`) is the design for **runtime-shaped** secrets — fetched by machines, by name, with audit and revocation. SOPS changes nothing in it; it neither conflicts with nor supersedes any of its six slices. +- SOPS is the design for **config-shaped** secrets — travelling with the configuration that consumes them, decrypted at activation/apply time. The broker changes nothing in it. +- The one rule needed at the seam: a given secret has exactly **one** home (store/broker *or* a named SOPS file), recorded where #9158's canonical secrets model / #10358's scoping work already decides which store and namespace a name resolves to. If a Tier B value later needs runtime fetch or fast revocation, it is *promoted* — rotated into the store and removed from the file (accepting that history retains the old, now-dead value). The reverse demotion should not happen: once a secret has needed audit/revocation, it doesn't go back to a file. + +Arguing the replacement case honestly: moving everything to SOPS would delete the broker's operating cost — and with it, per-access audit, central revocation, rotation without redeploy, dynamic credentials if they ever arrive, and the entire #13948 sync design's reason to exist, in exchange for making git the distribution mechanism for secrets git was never able to un-distribute. That trade is wrong for Tier A at any repo visibility, and unnecessary for Tier B, which SOPS already serves. + +--- + +## 3. The cluster stack overlap map: Keycloak, cert-manager, ESO, OpenBao + +The four are often named in one breath because all four "do security in Kubernetes." They sit at four different layers, and the overlaps are narrower than the naming suggests. + +| Component | Layer / what it actually does | Overlaps with | Unique remainder | +|---|---|---|---| +| **Keycloak** | **People identity.** Users, realms, login flows, MFA, federation to LDAP/AD and external IdPs; issues OIDC/SAML tokens to applications. | **Our own IdP** (#13658 / #9077 programme) — near-total overlap *for our use*. (Not with any vault: it stores no workload secrets.) | Federation-*in* of arbitrary enterprise IdPs, multi-tenant user administration, a decade of protocol corners (full SAML IdP *and* SP, LDAP/AD). | +| **cert-manager** | **In-cluster certificate issuance.** Watches `Certificate` resources; issues/renews from ACME, CA, Vault/OpenBao, and external issuers; lands key pairs in Kubernetes Secrets. | **Fleet CA** at the single point "issues certificates" — scopes differ: estate/host PKI vs per-namespace in-cluster ergonomics. | Nothing conceptual — its value is being the standard, maintained implementation of in-cluster issuance/renewal. | +| **External Secrets Operator** | **Secret delivery shim.** Reads from an external store (Vault/OpenBao, cloud secret managers, generic webhooks) and materialises ordinary Kubernetes Secrets on a refresh interval. | Nothing above it: it *consumes* stores, it is not one. Its backend can be our broker (webhook provider), Bitwarden/1Password-side stores, or OpenBao. | The standard, maintained bridge from "secrets live outside the cluster" to "apps consume Kubernetes Secrets," with templating and refresh. | +| **OpenBao** | **Vault server.** KV store, **dynamic secrets** (database credentials minted per-request, TTL'd, revoked on lease expiry), **transit encryption-as-a-service**, its own PKI engine, auth methods (Kubernetes SA, OIDC, …), leases and audit. | KV overlaps the broker/stores *functionally* (a place secrets live); PKI overlaps the fleet CA (and can sit under it); its OIDC auth method *consumes* an IdP (ours or Keycloak) — it does not replace one. | **Dynamic secrets, transit encryption, lease-based revocation.** None of the other three mints a credential that did not exist before the request, or encrypts application data as a service. | + +### 3.1 Posture per component + +- **Keycloak — SKIP (keep our IdP).** What it would do for us, stated plainly: nothing our provider doesn't already do for our own sign-in, at the price of a JVM estate and a relational database, and at the cost of the properties our IdP exists for (identity bound to our own PKI custody and role model, ~7 MB footprint). Its genuine wins are breadth we don't currently need. **Trigger to revisit:** federating *in* arbitrary external/enterprise identity providers, multi-tenant user administration for other people's users, or handing administration to non-us operators. The two also compose — our provider can federate to a Keycloak realm as one more door — so skipping now forecloses nothing. +- **cert-manager — ADOPT when Kubernetes lands, chained to our CA.** Via a CA Issuer holding a fleet-CA intermediate (or an external issuer against our PKI), cluster workloads get frictionless issuance whose trust anchors remain ours. It composes with, and does not replace, `fleet cert` — exactly as the CNCF survey concluded. +- **ESO — ADOPT when cluster workloads need Tier A secrets.** The alternative is a homegrown sync script we would have to secure ourselves; ESO is the ecosystem's answer and its backend being *our broker* keeps #13948 as the single runtime source of truth. One caution carried from the survey: guard `ExternalSecret` resources with admission policy (Kyverno) — a malicious ExternalSecret is an exfiltration path — and note ESO's thin maintainer bench as a watch item, not a blocker. +- **OpenBao — DEFER; it keeps a job, but the job hasn't arrived.** Adopting Keycloak + cert-manager + ESO (or, in our case, skipping Keycloak and adopting the other two) still leaves OpenBao's remainder untouched: if cluster applications ever need per-request database credentials, application-level transit encryption, or lease-revocable credentials at in-cluster scale, OpenBao is the open-licence way to get them and nothing else on this list substitutes. Until one of those needs is real, running it means operating a seal/unseal vault cluster to duplicate what the broker already does. **Trigger:** any one of dynamic secrets / transit / in-cluster auth at scale becoming an actual requirement. Note the composition is friendly when that day comes: ESO's backend can switch to OpenBao by configuration, cert-manager can use it as an issuer, and SPIRE's stock Vault UpstreamAuthority pattern is the shape our §1 chain would follow — deferring OpenBao blocks none of the other three. + +### 3.2 The one-sentence version + +Keycloak is a door, cert-manager is a mint for certificates, ESO is a conveyor belt, OpenBao is a safe that can also mint credentials on demand — adopting the door, the mint, and the belt still leaves the safe's unique work undone, and we will rent the safe when we have something that needs it. + +--- + +## Recommendation set (consolidated) + +1. **Attestation:** SPIRE pre-chosen, chained under the fleet CA via UpstreamAuthority; deploy on the first real workload-identity need, not before. Do not build our own attestation. +2. **SOPS:** expand Tier B use (config-shaped secrets, same public repo, one file per recipient set, per-host age keys) — and explicitly do **not** migrate Tier A/runtime secrets into SOPS. One system of record per secret; promotion is one-way (file → store, by rotation). +3. **Repo shape:** no second secrets repo. The public repo carries Tier B ciphertext under §2.3's discipline; Tier A never enters git in any form, ciphertext or otherwise. +4. **Cluster stack:** cert-manager (adopt, chained to fleet CA) and ESO (adopt, broker-backed, policy-guarded) at cluster time; Keycloak skipped in favour of our IdP; OpenBao deferred behind a named trigger (dynamic secrets / transit / in-cluster auth at scale). +5. **Composition with #13948:** no change to its slices; this record adds the SOPS tier beside it and the one-home-per-secret rule at the seam, recorded on #13948 itself. + +*Supplements: `supplements/research-notes.md` (sources and evidence trail), `supplements/issue-premises.md` (the #13948 / #13893 / #9155 / #13658 premises this analysis composes with, name-only).* diff --git a/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/supplements/issue-premises.md b/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/supplements/issue-premises.md new file mode 100644 index 000000000..00f8f10c5 --- /dev/null +++ b/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/supplements/issue-premises.md @@ -0,0 +1,25 @@ +# Issue premises this analysis composes with (name-only, no values) + +*Summarised 2026-11-24 from the issue bodies of #13948, #13893, #9155, #13658 in developing-today/code.* + +## #13948 — secrets plane design (the design this analysis must compose with) + +- Problem: sandbox secrets broker cold refresh shells out to `bws secret get` once per secret (242 spawns, ~160–220 s), clients hang instead of falling back; two brokers (sandbox + laptop) hold the same set with no sync proof; `fleet secrets` is read-only (verbs `get`, `list` only — verified from the installed binary). +- Chosen design: delta refresh from one `bws secret list` (entries carry `revisionDate`; apply only what moved; a partial list applies nothing — the #5504 lesson); broker-to-broker peer sync gated by a **keyed (HMAC) set hash** (v1 peer payload = full set; full upstream refresh only when the peer is down AND the broker restarted cacheless); client surface gains `refresh`, `get --upstream`, `get --no-cache`; `put` commits to the **primary store first**, then pushes to the peer and writes the mirror (one-store nodes escalate the dual write to the laptop). +- Primary-store recommendation inside #13948: **Bitwarden Secrets primary / 1Password mirror** (evidence: broker already authenticates headless to Bitwarden; only Bitwarden's list returns values + `revisionDate`; 1Password list is metadata-only and its service accounts carry rate limits). Open question 1 leaves ratification to Drew. +- Non-goals recorded there: namespaces/store selection is #10358; the canonical secrets model is #9158; replacing either store is out of scope. +- **Interaction with this analysis:** SOPS governs a disjoint, config-shaped set; nothing in #13948's six slices changes. The seam rule (one system of record per secret; one-way promotion file → store by rotation) is the only addition, and it is recorded on #13948 as a comment. + +## #13893 — the cold-refresh problem record + +- Measured incident: ~160–220 s cold refresh (242 per-secret `bws` spawns), clients hung >120 s behind a present-but-refreshing broker; proposed batching + a ~2–5 s client fallback bound. #13948 absorbs the batching as its full-refresh mechanism and keeps the client bound in Slice 1; #13893 stays open until Slice 1 lands evidence. + +## #9155 — fleet CA, credentials & secrets programme (v0.3 design mill) + +- Estate PKI reference: four independent roots (Ed25519, P-256, RSA, ML-DSA-44 baseline) plus the P-384 IdP CA as interim primary; root custody escrowed to exactly three destinations (encrypted laptop storage, the authorised Bitwarden project, the authorised 1Password vault) with tested restoration; SOPS/age/NixOS integration is an in-scope workstream of this programme; safety gate: design/synthetic proof only in this phase, no production CA generation or live vault writes authorised by the programme itself. +- Relevance: §1's recommendation keeps root custody exactly here and chains SPIRE *under* it; §2's Tier A (CA material) already lives in this custody model, never in git. + +## #13658 — the IdP story + +- One self-hosted identity provider issuing OIDC + SAML SSO for our own services, signing keys from our own PKI, new services onboarded by configuration. Programme frame over #9077 and children (minimal provider #13409, federation doors #13411/#13412/#13414, linking #13415, first consumer #13416), with pkgs/id binding via #2852 as recorded acceptance debt. +- Relevance: §3's Keycloak verdict is measured against this — Keycloak's overlap is with this provider, not with any vault — and the provider's stated properties (own-PKI signing keys, minimal footprint) are the fit argument for keeping it. diff --git a/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/supplements/research-notes.md b/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/supplements/research-notes.md new file mode 100644 index 000000000..294c39346 --- /dev/null +++ b/doc/2026-11-24T01-37-13Z_report_secrets-stack-analysis/supplements/research-notes.md @@ -0,0 +1,26 @@ +# Research notes — sources and evidence trail + +*Gathered 2026-11-24 for the SECRETS-STACK-ANALYSIS record. Facts below were used in the main analysis; each is tied to its source.* + +## Primary internal source + +- **CNCF security & identity survey** (lane CNCF-SECURITY, 2026-11-23), workspace copy at `~/workspace/cncf-investigation/research/security-and-identity.md`, landed in the repo as part of `doc/2026-11-23T22-33-41Z_research_cncf-landscape/`. Carries the estate verdicts this analysis builds on rather than re-derives: OpenBao (OpenSSF sandbox, v2.7.x line, Vault-API-compatible, dynamic secrets / transit / PKI, since 2.6 its PKI can issue SPIFFE-shaped documents), Keycloak (CNCF incubating, 26.8.2, breadth vs our IdP's fit/footprint ~7 MB RSS), SPIFFE/SPIRE (CNCF graduated, SPIRE v1.15.x, "adopted the ID format already; SPIRE itself only with a real cluster, anchored to our CA"; attestation named the house stack's one genuine gap), cert-manager (graduated, adopt chained to our CA), SOPS (CNCF sandbox, v3.13.x, limits: no read-time access control, no audit, no dynamic secrets), ESO (CNCF sandbox, v1.0 2025-11 / v2.0 2026-02, maintainer-capacity watch item, "the bridge between our broker world and in-cluster apps"). + +## SPIRE mechanics (verified via spiffe.io documentation and secondary write-ups, 2026-11-24) + +- Server configuration reference (https://spiffe.io/docs/latest/deploying/spire_server/): UpstreamAuthority plugin type "allows SPIRE server to integrate with existing PKI systems"; built-in UpstreamAuthority plugins include `disk` (CA loaded from disk signs SPIRE server intermediates), `aws_pca`, `awssecret`, `gcp_cas`, `vault` (Vault PKI secrets engine), `spire`, and `cert-manager` (requests intermediates via a referenced cert-manager Issuer). KeyManager plugins include `disk`, `aws_kms`, `hashicorp_vault`. +- Attestation flow: node attestation first (Kubernetes projected service account token `k8s_psat`, cloud instance identity documents, TPM/DevID), then workload attestation deriving selectors (namespace, service account, image digest, Unix UID, systemd unit, …) from the calling process via kubelet/runtime; the workload presents no credential to the Workload API (Unix socket). SPIRE documentation warns the workload-attestation signal is reliable only for unprivileged workloads (root on the node can circumvent it). +- Lifetimes: default X.509 SVID TTL 1 hour, JWT SVID TTL 5 minutes, agent rotation at half-life; revocation by deregistration (issuance stops; outstanding SVIDs expire). +- Registration-entry drift is the known operational pitfall; the SPIRE Controller Manager / `ClusterSPIFFEID` templating is the current answer (the older Kubernetes Workload Registrar was deprecated in SPIRE 1.5.0). + +## SOPS mechanics and the public-repo evidence + +- SOPS encrypts values, leaves keys/structure readable; per-file random data key (AES-256-GCM + file MAC) wrapped per recipient (age / PGP / cloud KMS); adding a recipient re-wraps the data key without re-encrypting values; `.sops.yaml` creation rules select recipients by path. (getsops README and multiple practitioner write-ups, e.g. https://www.bugsntea.dev/articles/managing-secrets-with-sops/ and https://dev.to/systhoughts/sops-age-store-secrets-safely-in-git-for-gitops-4g6i, both retrieved 2026-11-24.) +- GitOps: Flux decrypts SOPS natively; Argo CD via plugins — consistent across sources. +- Public-repo case study (https://git.ymrtech.com/ymrtech/ymrtech — a fleet operator's published post-mortem, retrieved 2026-11-24): a SOPS store lived in a **public** repository until 2026-09-23; the operator's own verdict is that the ciphertext part "is sound either way" — the actual defect was one catch-all creation rule wrapping six recipient identities' secrets to all six keys (a mail host's key could open portal tokens and VPN private keys). Fix: split to one file per recipient set, filename stating the set, and move to a private repo; per-host age keys generated on the host (`/var/lib/sops-nix/keys.txt`, root-only). The same post-mortem notes the leak that actually occurred in that fleet was plaintext in a *running system's log transcript*, not the repository — a useful calibration of where SOPS risk does and doesn't live. +- Rotation nuance (multiple sources): `sops rotate` / recipient removal re-wraps data keys for current files; it does not change the underlying secret values, and historical versions remain openable by previously-authorised keys — the basis for §2.2's revocation analysis. + +## Notes on claims deliberately hedged in the main text + +- "SPIRE's Vault UpstreamAuthority against OpenBao" is stated in the main analysis only as a *pattern* (API compatibility is OpenBao's design goal), not as a verified integration for our estate — it would need a spike before being relied on. +- No secret values were inspected at any point in this research; internal premises were read from issue bodies (titles, designs, counts, field names) only. diff --git a/doc/README.md b/doc/README.md index f88a1651d..46ab5b0da 100644 --- a/doc/README.md +++ b/doc/README.md @@ -65,7 +65,8 @@ Folders are named `__`. The kinds in use are `feature` - [CNCF landscape — the slice this estate will actually need](2026-11-23T22-33-41Z_research_cncf-landscape/2026-11-23T22-33-41Z_research_cncf-landscape.md) — research record (2026-11-23): ~150 cloud-native projects across the seven areas this estate will need, each with CNCF status (graduated / incubating / sandbox / not CNCF) and an estate verdict — observability (OpenTelemetry as the contract; Prometheus as the language, VictoriaMetrics as the store; Grafana stays; no open-source Datadog exists), networking (Cilium yes; Gateway API after ingress-nginx's March 2026 retirement; MetalLB is the remembered LAN LoadBalancer; no service mesh yet), platform & GitOps (Flux over Argo CD for us; Cozystack fits with the caveat that it decides storage/tenancy/GitOps for you; Crossplane graduated but not now), data (TiKV no — a storage layer, not a database, and its Jepsen record is honest; CloudNativePG + replicas; NATS yes with a JetStream shape; LINSTOR over Rook), security & identity (Keycloak ≠ OpenBao; cert-manager and Kyverno when Kubernetes lands; SPIRE later, chained under the fleet CA; OPA management-plane only), runtimes (no OCI runtime is "much faster"; KubeVirt graduated and is the VMs-in-Kubernetes answer; Wasm apps designed to the Component Model, not WasmEdge), and registries & builds (GHCR until friction, then Zot; Harbor is a registry and Dragonfly a distribution layer, not alternatives; Nix + Actions already win the build category). Includes the Oct–Nov 2026 status-correction list (Crossplane, KubeVirt, NATS, Dragonfly graduated; CloudNativePG, OpenFGA promoted) and the uncertain-name identifications (Argonize doesn't exist; Trimmer→Tremor; Yuki→youki; Percy→Pixie; Spiffy→SPIFFE). - [RustFS vs SeaweedFS — object storage compared](2026-11-24T01-33-33Z_research_rustfs-vs-seaweedfs/2026-11-24T01-33-33Z_research_rustfs-vs-seaweedfs.md) — research record (2026-11-24): the two S3 stores head to head — the one independent benchmark (SeaweedFS wins small-object PUT throughput and p99 latency, RustFS wins large objects and uses ~4.3× less RAM; zero acknowledged objects lost across kill -9 cycles in either store), features and metadata models side by side, the data-loss record investigated case by case (SeaweedFS losses concentrate in maintenance tooling, single-copy setups and filer-metadata failures, each with a named guardrail; RustFS's short history carries a hardcoded-token CVE and an Object Lock bypass), project health (SeaweedFS's one-maintainer reality verified by commit counts; RustFS's company real but geographically opaque), and the verdict: stay on SeaweedFS inside Cozystack, with RustFS as a watch/pilot candidate for standalone large-object workloads. Benchmark extracts, data-loss case notes, feature notes and raw project-health data ride in the folder as supplements. - [Multi-transport reach — any protocol as a carrier](2026-11-24T01-04-53Z_design_multi-transport-reach/2026-11-24T01-04-53Z_design_multi-transport-reach.md) — programme direction record (Drew, 2026-11-23) for epic #13926 and head design #13929: the P2P/ID/fleet stack reachable over many alternate transports and proxied systems (Spritely-style relays, Tor, Noise, ActivityPub, ATProto, email, MQTT, HTTP/REST, MCP, IRC, Zulip, Slack, Discord bots, Gopher, Gemini, telnet, physical media), each adapter at a declared level (read / bidirectional / write-capable / sync-equivalent), with asymmetric send/receive paths as a first-class design requirement. -- [Secrets plane — delta refresh, broker peer sync, dual-store puts](2026-11-24T01-23-30Z_design_secrets-plane-sync/2026-11-24T01-23-30Z_design_secrets-plane-sync.md) — design record for #13948 (Drew, 2026-11-23): the secrets broker refresh becomes delta-first (one `bws secret list`, apply only entries whose `revisionDate` moved), brokers sync peer-to-peer behind a keyed set hash (v1 peer payload is the full set; a full upstream refresh is needed only when the laptop is down and the broker restarted with no cache), `fleet secrets` gains `refresh`, `get --upstream/--no-cache`, and a `put` that commits to the primary store then pushes to the peer and the mirror, and the two stores are kept in sync with Bitwarden Secrets recommended as primary and 1Password as mirror on the evidence in the design. Companion to-dos: #13950 (embed both stores in the fleet binary), #13952 (`fleet init` bootstrap command). +- [Secrets plane — delta refresh, broker peer sync, dual-store puts](2026-11-24T01-23-30Z_design_secrets-plane-sync/2026-11-24T01-23-30Z_design_secrets-plane-sync.md) +- [Secrets stack analysis — attestation, SOPS scope, cluster overlap map](2026-11-24T01-37-13Z_report_secrets-stack-analysis/2026-11-24T01-37-13Z_report_secrets-stack-analysis.md) — analysis record (2026-11-24) answering Drew's secrets-stack questions: attestation-based secretless issuance explained (SPIRE pre-chosen, chained under the fleet CA, on a trigger — not built in-house), SOPS scoped to config-shaped Tier B secrets in the public repo under per-recipient-set discipline with runtime/crown-jewel secrets staying in the #13948 broker/store design (composes with #13948, one system of record per secret), and the Keycloak / cert-manager / External Secrets Operator / OpenBao overlap map (Keycloak skip, cert-manager + ESO adopt at cluster time, OpenBao deferred to a dynamic-secrets trigger). — design record for #13948 (Drew, 2026-11-23): the secrets broker refresh becomes delta-first (one `bws secret list`, apply only entries whose `revisionDate` moved), brokers sync peer-to-peer behind a keyed set hash (v1 peer payload is the full set; a full upstream refresh is needed only when the laptop is down and the broker restarted with no cache), `fleet secrets` gains `refresh`, `get --upstream/--no-cache`, and a `put` that commits to the primary store then pushes to the peer and the mirror, and the two stores are kept in sync with Bitwarden Secrets recommended as primary and 1Password as mirror on the evidence in the design. Companion to-dos: #13950 (embed both stores in the fleet binary), #13952 (`fleet init` bootstrap command). - [IdP identity-linking policy — pending trust, passkeys, configurable factors, account merge](2026-11-24T01-28-40Z_design_idp-linking-policy/2026-11-24T01-28-40Z_design_idp-linking-policy.md) — design record (Drew, 2026-11-23) for #13415 and workstreams #13972 (HEAD), #13973, #13974, #13975: federation doors link to the same user without auto-trust (a new provider sign-in registers pending until approved from an established session), first sign-in auto-provisions the CA SSO account, passkeys bind to the originating sign-in path by default with a standalone option (unlimited, multi-provider attach), two-factor is user-configured as any two distinct factors, and account merge stays possible (no per-account-unique objects beyond a limited set, primary chosen, no data lost, per-attribute repointing); recovery/deletion policy explicitly undecided. - [Roc ecosystem research](2026-11-23T22-00-25Z_research_roc-ecosystem/2026-11-23T22-00-25Z_research_roc-ecosystem.md) — research record (2026-11-23): the state of the Roc language ecosystem — the new Zig compiler (feature parity July 2026; 0.1.0-RC1 shipped 2026-11-21, promotion to 0.1.0 still open), platforms (basic-cli, basic-webserver, Joy, roc-ray, roc-gui, Cloudflare Workers, native Android), the new-compiler package canon, real projects and production use (Joy/roc-deflate, roc-chat), a 30-day Zulip digest (linear types decided against FBIP; the LLM-generated-code conversation, no policy adopted; tooling and distribution progress), and the talks/releases/showcases worth watching. - [Actions exec — build and tiered-extension proof material](2026-11-24T00-39-49Z_report_actions-exec-proof-material/2026-11-24T00-39-49Z_report_actions-exec-proof-material.md) — raw proof scripts and run logs for #13774: the ACTIONS-EXEC-2 build (broker verbs, OIDC RS256 gate, fleet actions family; handoff proven end to end twice; the second run failed at the agent-install step and its diagnosis is held behind a flag hold) and the ACTIONS-EXEC-3 tiered lease-extension policy (design amendment and completion record on the issue; fleet-queue 616 and fleet bin 141 tests passing; live tier proof on the generation-8 broker; push delivery blocked by the PM intake 401, #13902). Backfilled from lane /tmp under the work-product landing rule.