DEV Community

Allen Mack
Allen Mack

Posted on

I open-sourced the front door to what I build: a zero-trust verification core in Rust, limits included

I'm a solo developer, and I build local-first security tooling in Rust. This week I open-sourced the starter edition of the verification core I build on: mack-zerotrust-rust-starter — a default-deny token policy engine with a SHA-256 hash-chained audit log, written in safe Rust.

What it does

Tokens are verified against an explicit policy. Anything not allowed is denied by default — there is no implicit trust path. Every verification decision is appended to a hash-chained audit log, so a later edit to an earlier entry breaks the chain from that point on.

The two limits, stated plainly

Most launch posts hide the weaknesses. Mine are pinned as tests so they can't silently disappear:

  1. Tail truncation is invisible to verify_chain alone. Chop entries off the end and what's left is still a valid prefix. You only catch it by comparing the tip or length against a value recorded outside the chain.
    Test: limitation_tail_truncation_is_not_detected

  2. The chain is unkeyed. Anyone who knows the public hash construction can rewrite the whole history and recompute every link, and it verifies. It's tamper-evident against partial edits, not tamper-proof against a full rewrite — an externally anchored tip is the countermeasure, and that's out of scope for this kit.
    Test: limitation_whole_chain_rewrite_is_not_detected

A companion crate, aegis-seal, covers Ed25519 signing, the same style of hash-chained ledger, and secret/entropy scanning — 18 of 18 tests, MIT or Apache-2.0.

Why post the limits first?

Because the people I want using this are the people who check. A verification tool that oversells its own guarantees is worse than no tool. If you build in Rust and care about audit trails, I'd rather you start from what this doesn't do, and decide if the rest is still useful.

Issues and criticism welcome on the repos — the sharper the better.

Top comments (7)

Collapse
 
amintacccp profile image
tamina •

Pinning the limits as tests is a great call — it turns "known limitation" from a footnote into something CI will actually defend. The tail-truncation one is especially honest: a hash chain that only verifies forward is easy to over-trust. Do you see the unkeyed-chain limit as something the companion aegis-seal crate is meant to fix for adopters, or is it more "use this starter only where the log itself isn't adversarial"?

Collapse
 
a95674127beep profile image
Allen Mack •

That's a great observation, Tamina. I see "aegis-seal" as a complementary security layer rather than silently treating the starter verification core as something it isn't.

The unkeyed chain is appropriate where the threat model doesn't include an attacker capable of rewriting the entire log and its verification state.

For stronger adversarial environments, signed checkpoints and independently retained trust anchors become important.

I want adopters to be able to start with the lightweight verification core and deliberately add stronger authentication and integrity guarantees as their threat model requires.

The limitation tests are there specifically to ensure those boundaries remain visible rather than disappearing in future changes.

Collapse
 
amintacccp profile image
tamina •

That framing clicks for me — complementary layer, not a claim to be the whole front door. Starting unkeyed where the threat model is just tamper-evidence, then deliberately adding signed checkpoints as the model grows, is a much more honest adoption path than pretending one mode fits everywhere. And pinning the limits as tests so they can't quietly drift is the part I'll steal first — do you have a sense of which signed-checkpoint design you'd reach for first, or is that still open?

Thread Thread
 
a95674127beep profile image
Allen Mack •

Thanks, Tamina — "steal the limits-as-tests part first" is exactly the reaction I hoped the post would get.

Your question — which signed-checkpoint design I'd reach for first — isn't still open, because it's the piece I built next, in aegis-seal (v0.4.0). The design:

  • The ledger itself stays unkeyed: append-only entries linked by SHA-256. Cheap, no key custody.
  • A checkpoint is an Ed25519 signature over just three things: a domain tag ("mack-checkpoint-v1"), the entry sequence number, and the chain's head hash at that point.
  • Verification is fully independent — public key, sequence, head hash, signature. No ledger database, no signing key, no vault code. A test vector produced by the signing code is pinned in the verifier, so the two can't quietly drift apart — the same limits-as-tests trick, applied to the format itself.

What it buys you: the bare chain already detects edits in the middle. The signed checkpoint adds detection of the two attacks the chain alone can't see — chopping entries off the tail, and rewriting the whole chain from scratch. What it doesn't buy: anything after the last checkpoint is only tamper-evident until the next one lands. That gap is a stated limit, not a footnote.

Two honest questions back, since you're thinking about adopting the path:

  1. Where would you put the checkpoint trigger — every N entries, on a timer, or only at moments that matter, like a release or a handoff? Mine are taken deliberately, at moments that matter, but I can argue it both ways.
  2. In your threat model, does the verifier live somewhere the writer can't reach? That's the assumption my design leans on hardest — the checkpoint only helps if the checker is independent of the thing being checked.

Curious what you're building with it.

— Allen

Thread Thread
 
amintacccp profile image
tamina •

Thanks for the detailed answer, Allen — the v0.4.0 checkpoint design is clearer than I expected. Signing just the domain tag, sequence, and head hash keeps the key-custody surface tiny, and I like that the gap after the last checkpoint is stated as a limit instead of hand-waved away.

On your two questions:

  1. Trigger: I'd go every N entries, probably with a checkpoint on clean shutdown as a bonus. Predictable, survives crashes, no clock dependency. A timer misses quiet stretches, and "moments that matter" needs a definition that will drift the first time I get lazy about releases.

  2. Verifier placement: honestly, my threat model is weaker than yours — and I should say so rather than pretend otherwise. What I'm building is GithubStarsManager, a local tool that pulls my starred repos down, writes AI summaries and tags them. The writer and the verifier would share the same machine, so a fully adversarial writer with root could swap the verifier too. What the checkpoint still buys me is detection of silent rewrites by a bad sync or a compromised dependency, as long as I verify from a separate checkout with the pinned public key. That's the bar I actually need: tamper-evidence against accidents and sloppy writes, not against root.

The test-vector-in-the-verifier trick is the part I'm stealing first, though — same limits-as-tests idea, and it closes the loop on the format itself.

Collapse
 
userxnom profile image
Abdullah Naseer •

Pinning the limits as tests is the strongest part of this post — tail truncation being invisible to verify_chain alone is exactly the kind of weakness that usually gets buried in a launch announcement. Stating plainly that the chain is unkeyed and a full rewrite would go undetected is honest in a way that makes the tool more trustworthy, not less. The default-deny policy with no implicit trust path is a good design choice for a starter. Do you see the Ed25519 signing in aegis-seal as the next step for this crate, or as a separate layer that stays optional?

Collapse
 
a95674127beep profile image
Allen Mack •

Thank you, Abdullah. That's exactly the distinction I wanted to make explicit rather than hide behind the term zero-trust.

The verification core is deliberately a starter layer, not a claim of complete protection against an adversary controlling the entire audit store.

The unkeyed hash chain provides tamper evidence for changes within the retained chain, but it cannot independently establish authenticity against a complete rewrite or reliably detect tail truncation.

That's where the companion "aegis-seal" project comes into the architecture.

My intention is to keep signing optional and composable: Ed25519-signed checkpoints can authenticate ledger state, while independently retained or externally anchored checkpoints provide the additional protection needed against rollback and truncation.

I don't want adopters confusing a verifiable hash chain with an authenticated, independently anchored audit history.

The goal is to make the security boundaries explicit, testable, and difficult to misunderstand. I appreciate you recognizing that distinction.