Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnchorBuild — Supply-chain attestation and consensus ledger
Status Zero Trust MIT License



FastAPI Ed25519 scikit-learn React 18 Vite 5 Python 3.12



Every package a maintainer publishes gets cryptographically pinned to an append-only ledger, cross-checked by five independent validators, and behaviorally scored for stolen-key misuse — before anyone downloads it.

The Problem · Quickstart · Security Stack · Architecture · Demo Scenarios · API Reference · Roadmap


🎯 The Problem

xz-utils. event-stream. Two of the most consequential supply-chain compromises in open-source history had one thing in common: a valid, trusted identity shipped compromised code, and no registry, no code-signing scheme, and no centralized SBOM caught it before it spread.

Registries verify that they served a file — never that the file matches what the maintainer actually built. Code signing verifies key ownership — but a coerced or stolen key still produces a mathematically "valid" signature on malicious code. AnchorBuild closes that gap with an attestation layer no single party can silently rewrite.


🏆 Judges' Highlight — Key Innovations

🔑 Ed25519 Asymmetric Build Attestation

Cryptographically links every publish event to a verified maintainer identity. Unauthorized or forged signatures are rejected at the API gate, instantly.

🧠 Isolation Forest Anomaly Detection

Catches stolen-but-valid keys by scoring behavioral telemetry — device novelty, timezone drift, dependency jumps — that pure cryptography can't see.

⚙️ Multi-Party Proof-of-Authority Quorum

Five independent validator nodes (registry, npm, PyPI, two auditors) must agree. Divergence is surfaced live, not hidden.

🔗 Tamper-Evident SHA-256 Hash Chain

Every block references its parent's hash. Retroactively editing history breaks that link forever — visibly, permanently, one seam at a time.

🚦 Combined Install-Gate Decision — /can-install/{hash}

The one question that actually matters: "is it safe to install this?" — answered by combining artifact verification and this record's chain-link integrity into a single safe / blocked verdict, without letting one unrelated historical incident collateral-block every other package on the ledger.


⚡ Quickstart

git clone <https://github.com/Srikanth-coderdal/AnchorBuild> anchorbuild
cd anchorbuild
.\start-demo.bat

That one script: detects your Python environment (venv or global), boots the FastAPI backend, health-checks it before proceeding, seeds a real signed baseline ledger through the actual crypto pipeline, and launches the dashboard — all in one shot.

Service URL
🖥️ Dashboard http://localhost:5173
⚙️ API + interactive docs http://localhost:8000/docs
💻 Publish & verify from the CLI
# Publish a build attestation, signed with a real Ed25519 key
python -m backend.cli.attest publish \
  --package my-package --version 1.0.0 \
  --artifact dist/my-package.tgz \
  --publisher alice --key backend/demo/keys/alice_private.hex

# Verify a downloaded artifact against the ledger
python -m backend.cli.attest verify --artifact dist/my-package.tgz

# Ask the real question: is it safe to install?
python -m backend.cli.attest can-install --hash <sha256-of-artifact>

🔬 Core Security Stack

01 · ED25519 ATTESTATION

"Every release requires a valid cryptographic signature bound to the build digest."
  • 🔑 Identity Binding — release payloads validated against registered maintainer public keys.
  • 🔗 Parent-Pointer Append — each block digest incorporates the previous block's hash.
  • 🛡️ Tamper Detection — post-commit edits are caught and flagged TAMPERED.

02 · ISOLATION FOREST ML

"Catches stolen-key misuse by scoring behavior before confirming commit."
  • 📊 Risk Scoring (0–100) — device novelty, timezone drift, dependency jumps.
  • 🚨 Automatic Bands — 0–40 pass · 41–74 review · 75–100 blocked.
  • 🔍 Explainable Signals — per-feature weight contributions, shown live.

03 · POA CONSENSUS

"No single compromised party can corrupt the registry unnoticed."
  • 🏛️ Distributed Authority — 5 independent nodes verify every state transition.
  • ⚠️ Divergence Detection — dissenting nodes surfaced, majority preserved.
  • Live Demo Controls — trigger divergence on demand for evaluators.

04 · DASHBOARD & CLI

"A high-contrast console, paired with real developer tooling."
  • 🖥️ Live Dashboard — block status, anomaly gauges, hash-chain visual.
  • 💻 Developer CLI — sign, publish, verify, and gate installs from the terminal.
  • 🔄 One-Command Reset — repeatable, real, signed baseline every launch.

🏗 Architecture

flowchart TB
  subgraph CLIENT["🖥️ Client Layer — React 18 / Vite / Tailwind"]
    FE["Overview Dashboard<br/>Status & Anomaly Gauges"]
    FORM["CLI Command Generator<br/>(never touches private keys)"]
    CLI["Developer CLI<br/>publish · verify · can-install"]
  end

  subgraph API["⚙️ FastAPI Backend — Python 3.12"]
    MAIN["main.py Router"]
    ATTEST["/attestations"]
    VERIFY["/verify/:hash"]
    GATE["/can-install/:hash"]
    DEMO["/demo/tamper · /demo/reset"]
  end

  subgraph ENGINE["🛡️ Security & Consensus Engine"]
    ED25519["Ed25519 Engine<br/>Signature Verification"]
    ML["Isolation Forest<br/>Behavioral Anomaly Score"]
    CHAIN[("Append-Only Ledger<br/>SHA-256 Hash Chain")]
    POA["5-Node PoA Quorum"]
  end

  FE -->|fetch state| MAIN
  CLI -->|sign & publish| ATTEST
  CLI -->|check before install| GATE

  MAIN --> ATTEST & VERIFY & GATE & DEMO
  ATTEST -->|verify signature| ED25519
  ATTEST -->|score behavior| ML
  ED25519 -->|append block| CHAIN
  ML --> POA
  GATE -->|artifact + chain-link check| CHAIN
  POA -->|commit / diverge| FE

  classDef frontend fill:#0F172A,stroke:#38BDF8,color:#FFFFFF,stroke-width:2px
  classDef backend fill:#1E293B,stroke:#34D399,color:#FFFFFF,stroke-width:2px
  classDef engine fill:#312E81,stroke:#A78BFA,color:#FFFFFF,stroke-width:2px
  classDef db fill:#064E3B,stroke:#6EE7B7,color:#FFFFFF,stroke-width:2px

  class FE,FORM,CLI frontend
  class MAIN,ATTEST,VERIFY,GATE,DEMO backend
  class ED25519,ML,POA engine
  class CHAIN db
Loading

🧪 Demo Scenarios

The seeded baseline ships with all four outcomes already on the ledger — no clicks required to see the mechanism working.

Status Meaning Signature valid? Behavior normal? History altered?
🟢 VERIFIED Signed, scored low-risk, unanimous consensus No
🟡 FLAGGED Validly signed, but behaviorally anomalous No
🔴 BLOCKED Rejected before ever reaching the ledger No
🟣 TAMPERED Was valid, then retroactively altered ✅ (originally)

Click Simulate Tamper Break on any verified block to watch the hash chain snap live, and Validator Consensus flip to DIVERGED — confirmed via the browser Network tab to fire a real POST /demo/tamper, not a client-side illusion.


📡 API Reference

Method Endpoint Purpose
GET /attestations List all ledger records
POST /attestations Submit a signed attestation (CLI only)
GET /verify/{hash} Check a local artifact hash against the ledger
GET /can-install/{hash} Combined artifact + chain-link install verdict
GET /anomaly-score/{id} Isolation Forest signal breakdown
GET /validators/status Live PoA consensus state
POST /demo/tamper · /demo/reset Demo-only state controls

Full interactive spec: http://localhost:8000/docs · Source of truth: shared/openapi.yaml


🗺 Roadmap & Known Limitations

Honesty about scope boundaries, not just features — a real review will ask about these:

  • Identity onboarding — only 3 demo identities (Alice/Bob/Carol) are pre-registered; there is currently no self-service flow for a new maintainer to register a public key. Registering anyone without an authentication step would break the trust model, so this is deliberately deferred, not overlooked.
  • Validator nodes are simulated in-process, not yet running as genuinely independent processes/machines. A real distributed PoA deployment is planned for a later phase.
  • No persistence layer — the ledger currently lives in memory and resets on backend restart (by design, for repeatable demos via start-demo.bat's seeding step).
  • Dashboard does not yet auto-refresh after CLI actions — a manual refresh currently surfaces new ledger state.
  • IPFS off-chain storage is mocked for MVP scope; a production version would use real pinning infrastructure.

Built by Srikanth Veeramalai · B.Tech CSE · VIT Chennai

About

Zero-trust software supply-chain attestation platform. Ed25519-signed builds are chained via SHA-256, cross-verified by a 5-node PoA quorum, and scored by an Isolation Forest model to catch stolen-key misuse and tampering before install.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages