Repository navigation
feat(audit): external timestamp anchor via command transport (fail-closed) - #186
Merged
Merged
Conversation
…osed)
Implements the documented resolveExternalAnchor() extension point so a seal
can carry an external authority's receipt, closing the same-machine forge gap
(anyone holding the local anchor key can otherwise re-seal a rewritten log).
- commandExternalAnchor: runs $KIT_EXTERNAL_ANCHOR_CMD, pipes tip/count/logpath
via env, parses a JSON receipt {token, authority?, timestamp?}. Fail-closed:
non-zero exit, non-JSON, or missing token all throw (30s timeout).
- kit audit anchor --external: folds the receipt into the anchor record
(AnchorRecord.external); requested-but-unconfigured hard-errors.
- kit audit verify --require-external: fails any HMAC-only seal so a policy can
demand third-party countersignature.
- kit ships no network client (no-egress default) — operator wires the authority.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
sandstream
pushed a commit
that referenced
this pull request
Jun 30, 2026
…tity
Track C adversarial hardening of the 3.0 surface.
HIGH — palSyncFindings auto-closed findings by source-tag + scope only, with no
origin_device predicate. Since the finding id was derived from sourceTag+dedupKey
(repo-independent), it was identical across machines on a shared/synced store, so
a scan on device B that didn't see device A's open finding would permanently
close A's security blocker; two repos sharing a basename also collided.
- fold scope into the finding id (distinct rows per repo)
- scope by absolute project root, not basename (findings-track, health-track)
- device-fence the auto-close (origin_device = thisDevice OR NULL); legacy
NULL-origin rows stay reconcilable by any device
- re-attribute origin on reopen so the observing device is reminded
A cleared finding now lingers until the owning device re-scans — fail-safe.
MEDIUM — deviceId() was sha256(hostname+user): guessable by a peer on a shared
store and unstable across hostname churn (silently orphaning a device's items).
Now prefers a random id persisted to <memoryDir>/device-id (0600); validates the
KIT_DEVICE_ID override against [A-Za-z0-9_-]{1,64}; hostname hash is last resort.
Also restores the `## [3.0.0]` CHANGELOG header dropped by the #186 Unreleased
edit (the 3.0.0 block was orphaned under [Unreleased]).
3 new regression tests; full suite 1979 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
sandstream
added a commit
that referenced
this pull request
Jun 30, 2026
…tity (#187) Track C adversarial hardening of the 3.0 surface. HIGH — palSyncFindings auto-closed findings by source-tag + scope only, with no origin_device predicate. Since the finding id was derived from sourceTag+dedupKey (repo-independent), it was identical across machines on a shared/synced store, so a scan on device B that didn't see device A's open finding would permanently close A's security blocker; two repos sharing a basename also collided. - fold scope into the finding id (distinct rows per repo) - scope by absolute project root, not basename (findings-track, health-track) - device-fence the auto-close (origin_device = thisDevice OR NULL); legacy NULL-origin rows stay reconcilable by any device - re-attribute origin on reopen so the observing device is reminded A cleared finding now lingers until the owning device re-scans — fail-safe. MEDIUM — deviceId() was sha256(hostname+user): guessable by a peer on a shared store and unstable across hostname churn (silently orphaning a device's items). Now prefers a random id persisted to <memoryDir>/device-id (0600); validates the KIT_DEVICE_ID override against [A-Za-z0-9_-]{1,64}; hostname hash is last resort. Also restores the `## [3.0.0]` CHANGELOG header dropped by the #186 Unreleased edit (the 3.0.0 block was orphaned under [Unreleased]). 3 new regression tests; full suite 1979 green. Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Jun 30, 2026
Merged
sandstream
added a commit
that referenced
this pull request
Jul 1, 2026
#196) Cut 3.1.0 from [Unreleased]: - gzip-compress memory sync blobs before encryption (~3x smaller, #193) - public-key sync mode — ephemeral sessions push with no secret (#192) - kit agent-config wires GitHub Copilot (#195) - external timestamp anchor via command transport (#186) - plus device-identity hardening + transport fixes Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the documented
resolveExternalAnchor()extension point so an audit seal can carry an external authority's receipt — closing the same-machine forge gap. The keyless chain + machine-local HMAC anchor proves what happened on this machine, but anyone holding that machine's anchor key (UID) can re-seal a rewritten log undetectably. An external countersignature removes that single point of trust.kit still ships no network client (no-egress default) — the operator wires the authority via a command.
How
commandExternalAnchor(cmd)— runs$KIT_EXTERNAL_ANCHOR_CMD, piping the seal context via env (KIT_ANCHOR_TIP,KIT_ANCHOR_COUNT,KIT_ANCHOR_LOGPATH) and parsing a JSON receipt{ token, authority?, timestamp? }from stdout. The command can be an RFC3161 TSA client, an append-only log writer, a notary — anything.kit audit anchor --external— folds the receipt into the anchor record (AnchorRecord.external); requested-but-unconfigured hard-errors.kit audit verify --require-external— fails any HMAC-only seal so a policy can demand third-party countersignature on every seal.token, or--externalwith no command configured all hard-error rather than silently degrading to HMAC-only. 30s timeout.Tests
5 new tests under
audit anchor - external anchor (command transport, fail-closed): resolve null/with-env, receipt parse + tip-via-env wiring, fail-closed rejects (exit/non-json/missing-token),anchorAuditLog --externalstores the receipt + unconfigured throws, anddecideAnchorVerdict --require-externalfails HMAC-only / passes with a receipt. Full suite green (1976 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
Generated by Claude Code