Skip to content

Committed throwaway TLS private keys (CA and leaf) in s11-relay spike certs #12150

Closed

Description

@dezren39

Finding

Private key material is tracked in git under the s11-relay spike:

  • doc/2026-10-11T03-44-33Z_design_groups_events_delegation/spikes/s11-relay/certs/gen/ca1.key (CA)
  • .../certs/gen/ca2.key (CA)
  • .../certs/gen/leafA.key, leafB.key, leafC.key
  • .../certs/live/leaf.key (referenced by .../spikes/s11-relay/config/tls-manual.toml:12 and tls-reloading.toml:12 as certs/live/leaf.key)

Each file starts with -----BEGIN PRIVATE KEY----- and git ls-files lists them, so they are in the tree and in history.

Why it matters

Keys are documented as spike or test material, so impact is probably low. But a committed CA private key is the kind of artifact secret scanners and downstream copiers pick up, and a reviewer cannot tell from the tree alone that the CA is not trusted anywhere. The certs/ directory has no .gitignore rule.

Suggested fix shape

  1. Confirm no environment trusts ca1/ca2. Then either regenerate the certs at spike run time (a script that writes to an ignored dir) or keep only the public .pem/.der files.
  2. Add a .gitignore rule for **/certs/**/*.key under spike dirs, or rewrite the configs to point at a generated path.
  3. If the keys ever held anything beyond the spike, treat them as compromised and rotate. History rewrite is optional and needs a human decision.

Evidence

Found by a suggestions pass on #12133 (git grep for BEGIN PRIVATE KEY, then git ls-files on the certs/ tree). Not verified whether the keys are used outside the spike.

Activity

  1. added
    kind/security
    security-adjacent
    on Nov 21, 2026
  2. developing-today commented on Nov 21, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Lane AU19 (sandbox fix lane, coordinated by Archer) claiming this issue.

    Premise + ownership check (fresh reads, 2026-11-23 ~18:22Z): issue open, labels kind/security + security-adjacent only, comments count-confirmed at 1 (bot Kaneo link only), no prior claim, no user/* label, no design/ratification gate, no flag hold.

    Plan: verify the tracked key files and every reference to them in the s11-relay spike; remove the tracked private-key files from the tree, keep the public cert material, add ignore coverage so regenerated keys stay untracked, and re-point or document the spike configs accordingly. History rewrite is explicitly a human decision per the issue and stays out of scope. Verification: git ls-files / tree grep shows no tracked BEGIN PRIVATE KEY material under the spike, recorded here with the PR.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    LANDED — Lane AU19. PR #13614 merged as 9b71f74.

    What changed (14 files, all under doc/2026-10-11T03-44-33Z_design_groups_events_delegation/spikes/s11-relay/certs/):

    • Removed from the tree: the six tracked private keys (gen/ca1.key, gen/ca2.key, gen/leafA.key, gen/leafB.key, gen/leafC.key, live/leaf.key) and the generation intermediates (gen/*.csr, gen/*.srl).
    • New certs/.gitignore: *.key, *.csr, *.srl are never committed again (verified with git check-ignore).
    • New certs/generate-certs.sh: regenerates the recorded topology locally — CA 1 (CN=s11 test CA 1) signs leafA/leafB, CA 2 (CN=s11 test CA 2) signs leafC, leafB installed as live/leaf, EC P-256 keys, leaves CN=localhost with SAN DNS:localhost + IP:127.0.0.1 via the tracked gen/leaf.ext. Public certificates (.pem/.der) stay tracked unchanged; config/tls-manual.toml and config/tls-reloading.toml keep pointing at certs/live/leaf.key, which the script installs.
    • New certs/README.md documents the arrangement and the history note.

    Verification (laptop worktree, script run end to end before commit; the refreshed public certs were then restored so the PR diff stayed scoped): openssl verify passes for leafA/leafB/live against CA 1 and for leafC against CA 2, and fails for leafC against CA 1 (the spike's CA-mismatch case preserved); regenerated subjects/issuers/SANs match the originals exactly; live key byte-identical to the generated leafB key and its public key matches live/leaf.pem; at the branch head, git grep "BEGIN PRIVATE KEY" over the tracked spike tree returns nothing.

    Premise note: confirmed at main 6ff2312 that exactly the six files named in the issue held key material, and that nothing outside the spike references the cert paths. The one other repo-wide BEGIN PRIVATE KEY string hit is a Rust source file in a research directory (a dalek source copy), not key material — left untouched, noted on the PR.

    Out of scope per the issue's own terms: git history still contains the old keys (expired spike certs; the CAs are trusted nowhere) — a history rewrite is a human decision. Closing as completed on the tree fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/securitysecurity-adjacentstatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions