How percobain/leakguard works
LeakGuard is an incident-response demo: a simulated secret leak triggers detection, key rotation and redeployment, revocation, history cleanup, verification, and a zero-knowledge proof. The orchestrator owns the workflow and exposes live state and actions to the dashboard. The README documents the external services and lifecycle; source excerpts and the SOURCE INDEX support the main module relationships, though several implementation details were not sampled.
Main entry points: pipeline.ts Incident pipeline · server.ts HTTP and WebSocket API · App.tsx Dashboard application · zk.ts Proof generation and verification
Components 25
Incident workflow
- Incident pipeline
services/orchestrator/src/pipeline.ts - Incident state
services/orchestrator/src/state.ts - HTTP and WebSocket API
services/orchestrator/src/server.ts - Runtime configuration
services/orchestrator/src/config.ts
Service integrations
- Git operations
services/orchestrator/src/git.ts - GitHub integration
services/orchestrator/src/github.ts - Google key API
services/orchestrator/src/google.ts - Vault secrets
services/orchestrator/src/vault.ts - Docker control
services/orchestrator/src/docker.ts - GitHub Actions and repo
- Google API Keys
- HashiCorp Vault
Proof system
- Proof generation and verification
services/orchestrator/src/zk.ts - Clean-repo circuit
zk/circuits/leakguard.circom
Live dashboard
- Dashboard application
dashboard/src/App.tsx - Live state connection
dashboard/src/useLeakGuard.ts - Incident chapters
dashboard/src/components/Story.tsx - Stage display
dashboard/src/components/Stage.tsx - Incident metrics
dashboard/src/components/Vitals.tsx - Event log drawer
dashboard/src/components/LogDrawer.tsx - Browser proof check
dashboard/src/components/ZkVerify.tsx
Demo environment
- Production demo app
services/demo-app/server.js - Attacker bot
services/attacker/attacker.js - Mock Google API
services/mock-google/server.js
Other components
- Developer
Connections 31
- Developer → GitHub Actions and repo: pushes leak
README.md - Incident pipeline → Incident state: updates state
services/orchestrator/src/pipeline.ts - HTTP and WebSocket API → Incident pipeline: routes actions
services/orchestrator/src/server.ts - HTTP and WebSocket API → Incident state: serves state
services/orchestrator/src/server.ts - HTTP and WebSocket API → Proof generation and verification: verifies proof
services/orchestrator/src/server.ts - Incident pipeline → Git operations: delegates git work
services/orchestrator/src/pipeline.ts - Incident pipeline → GitHub integration: delegates CI work
services/orchestrator/src/pipeline.ts - Incident pipeline → Google key API: delegates key operations
services/orchestrator/src/pipeline.ts - Incident pipeline → Vault secrets: delegates secret operations
services/orchestrator/src/pipeline.ts - Incident pipeline → Docker control: controls redeploy
services/orchestrator/src/pipeline.ts - Incident pipeline → Proof generation and verification: requests proof
services/orchestrator/src/pipeline.ts - Incident pipeline → Runtime configuration: uses settings
services/orchestrator/src/pipeline.ts - Git operations → GitHub Actions and repo: rewrites and pushes
README.md - GitHub integration → GitHub Actions and repo: reads Actions runs
README.md - Google key API → Google API Keys: creates and deletes keys
README.md - Google API Keys → Mock Google API: simulated by
README.md - Vault secrets → HashiCorp Vault: stores key versions
README.md - Docker control → Production demo app: restarts container
README.md - Production demo app → HashiCorp Vault: reads key via AppRole
README.md - Attacker bot → GitHub Actions and repo: scrapes commits
README.md - Attacker bot → Google API Keys: tests stolen key
README.md - Proof generation and verification → Clean-repo circuit: proves constraints
services/orchestrator/src/zk.ts - Dashboard application → Live state connection: subscribes to state
dashboard/src/App.tsx - Live state connection → HTTP and WebSocket API: fetches and subscribes
dashboard/src/useLeakGuard.ts - HTTP and WebSocket API → Live state connection: streams snapshots
services/orchestrator/src/server.ts - Dashboard application → Incident chapters: renders
dashboard/src/App.tsx - Dashboard application → Stage display: renders
dashboard/src/App.tsx - Dashboard application → Incident metrics: renders
dashboard/src/App.tsx - Dashboard application → Event log drawer: renders
dashboard/src/App.tsx - Stage display → Browser proof check: renders
dashboard/src/components/Stage.tsx - Browser proof check → HTTP and WebSocket API: requests browser verification
README.md