---
title: "The Security Handcraft: 12 Fossil Scripts, One Live Key, Zero Leaks in Print"
date: 2026-08-27
description: "E23: the leak scanner turned on the fleet itself — a 138-field single home, 12 legacy scripts sharing one inline token, and 2 live strings for one bot."
category: "AI & Compute"
tags:
  - "One Man One Legion"
  - "Security"
  - "Secrets Management"
  - "Infrastructure Audit"
  - "Personal Infrastructure"
verifiedHardware: "3-machine fleet, all evidence gathered 2026-08-27 · workstation: config field-path counts (values never printed), source-code pattern scans, and on-box getMe probes through the fleet's own proxy — token strings compared by hash and never left the machine · AWS: orchestrator secrets/logging code read live, permission bits verified · publication scan across all 23 posts in this repository"
keyTakeaways:
  - "The rule as built: one credentials home per machine — the workstation config holds 138 fields of which 6 are credentials, file mode 600 — read at runtime by code like the image factory, with a logging filter that swaps token substrings for asterisks before any line is written. New code never inlines."
  - "The rule as inherited: the audit found 12 legacy push scripts each carrying the same 46-character token inline, and a live probe returned ok=true for both that fossil string and the config's string — 2 valid credentials for one bot, only one of which the config knows about."
  - "The publication gate holds: 0 secret-pattern hits across all 23 published posts, 5 ritual-scan receipts in the work log, and the two in-session forensic leaks this series caused (a config dump, a parent-object print) were both caught before print."
measuredOn: 2026-08-27
faq:
  - q: "Doesn't publishing this point attackers straight at a live key?"
    a: "No string, bot name, group id, port, or proxy address appears — the same red lines every episode is scanned against. The machine sits behind Tailscale with public SSH closed since Aug 9. And the finding's value is the method: pattern-scan, hash-compare, verify with an on-box getMe so the credential never leaves its host."
  - q: "How should the fossil lane actually be cleaned up?"
    a: "Inventory, migrate or delete, revoke, rescan. No scheduled job has invoked any of the 12 scripts since the Episode 19 contraction, so revocation breaks nothing that is lit — the only residual risk is undocumented manual use, which the inventory step exists to catch."
  - q: "Why compare token strings by hash instead of just diffing them?"
    a: "So the comparison itself never copies a secret into a transcript or log. A digest answers same-or-different without revealing the value — the same principle as the logging filter that masks tokens before a line is written anywhere."
  - q: "What do the scans actually cover?"
    a: "Known shapes: Telegram bot-token format, sk-, ghp-, and AKIA-style strings, plus this fleet's own red-line items — group ids, ports, proxy addresses, voice names. Custom-format keys are not covered. The audit is a habit, not a guarantee; that is why it reruns every episode instead of claiming to be done."
---
*[Episode 23 of One Man One Legion](/posts/2026-08-27-one-man-one-legion-fleet-audit/) — the fifth war story. [Episode 21](/posts/2026-08-27-one-man-legion-ep21-langgraph-autopsy/) autopsied a framework that died in ninety minutes; this one turns the fleet's own leak scanner around and points it at the machines.*

## The ritual

Every episode of this series ends the same way. Before anything is pushed, both files — article and ledger — are pattern-scanned for the fleet's red-line items: token shapes, group ids, ports, proxy addresses. The work log carries 5 receipts of that single line being written. And today's whole-library run covered all 23 published posts in the repository: 0 hits for Telegram-token, sk-, ghp-, or AKIA-shaped strings.

This episode asks the obvious next question. What happens if you turn that scanner around — away from the articles, onto the fleet itself?

## Where the keys live

The rule as built: one credentials home per machine, read at runtime, never inlined. On the workstation, that home is a single config file of 138 fields, of which 6 are credential-shaped — 3 apiKey entries, 1 appSecret, 1 botToken, 1 token — sitting behind mode 600, owner-only. Modern code doesn't copy from it; the image factory's helper function loads the bot token fresh on every push and skips quietly if the read fails.

The AWS orchestrator repeats the pattern with more machinery: a dedicated secrets file, mode 600 verified today, environment-first with file fallback, and a logging filter that replaces any token substring with asterisks before a line reaches a file or a console — its header calls this constitution clause 4 — keys never enter logs. The account's two inference environment variables live in a shell profile by name only.

## How keys move

Never in a command line, never across the wire. One incident set the doctrine. On Aug 11, during the fleet-monitor build told in [Episode 5](/posts/2026-08-27-one-man-legion-ep5-fleet-on-one-screen/), a bot token appeared inside a conversation. The work log's warning line recorded the exposure and prescribed the response in the same breath: the human re-issues the token at the bot authority, then places the new string into the 600-permission file by hand over ssh — a replacement credential never crosses a chat again. That doctrine is why this episode's audit compared hashes, never strings.

## The audit that found something

A pattern scan across the workstation's code matched secret-shaped strings in 16 files. 4 of those were upstream test fixtures — a packaged retrieval project ships fake keys in its own test suite; a scan's hits are not all yours. The other 12 were ours: the legacy push lane. News-push v3, v4, and v5, two hotspot-monitor skills, two social-trend monitors, a reddit monitor, and video-batch helpers — every one of them carrying an identical 46-character token string, byte for byte. The single-home rule arrived after these scripts were written, and nobody went back.

The fossil was supposed to be dead — supposed to be. No record this series has ever read tested that. Today's getMe probe, run on the workstation through its own proxy so neither string left the machine: the config's token answered ok=true, and so did the fossil — same bot, 2 distinct live strings. The config only knows about one of them. A revoke kills a string, and a live string is its own proof: no revoke ever reached this lane, though one was recommended once, on Aug 11, for a different leaked token. The fossil authenticated fine today.

Why it survived is also why the cleanup is finally cheap: since [Episode 19](/posts/2026-08-27-one-man-legion-ep19-cron-contraction/)'s contraction, no scheduled job invokes any of the 12. They are fossils with a pulse — dark cron-wise, alive credential-wise. The remediation order writes itself: inventory, migrate or delete, revoke, rescan.

## The leaks that didn't reach print

Twice, this series' own evidence-gathering printed a secret into a tool session — a config dump that carried an appSecret during the pen-name audit, a parent-object serialization that carried an apiKey during the brain-swap dig ([Episode 10](/posts/2026-08-27-one-man-legion-ep10-pen-names/), [Episode 18](/posts/2026-08-27-one-man-legion-ep18-brain-swap/)). Both were caught in session, neither entered print, and both final files scanned clean. The recurring lesson is uncomfortable: the most likely leak tool in a transparent infrastructure is your own forensic code.

## Posture, briefly

The network side is told elsewhere and hasn't changed: public SSH closed since Aug 9, render submissions gated behind a two-entry port whitelist with path checks. The one CVE war story — a torch.load security gate whose instructed upgrade produced five verbatim breakages in one morning — was [published separately](/posts/2026-08-26-infinitetalk-torch-load-dependency-matrix/) and stands where it stood.

Security in this fleet is not a product that was bought. It is a habit of scanning itself, the same grep that keeps 23 published posts clean having just found a live fossil on the machines. Transparency is paid for in redaction — and occasionally redeemed by it.

*[Back to the fleet audit](/posts/2026-08-27-one-man-one-legion-fleet-audit/) — one man, one legion, and the discipline that lets it publish its own logs.*
