Skip to content

About

VendorChain: third-party risk ranking with chain propagation (SoK-guided implementation)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

VendorChain

Multi-user third-party risk scoring for small businesses. List the vendors you depend on; VendorChain ranks which would hurt you most if compromised — alone and through the trust chain — and recommends remove / limit / watch.

Built as a SoK guided implementation: hexagonal Python core, Streamlit UI, SQLite system of record seeded from a versioned JSON vendor-intel catalog.

Features

  • Org registration, member invites (owner / analyst / viewer), tenant isolation
  • Per-vendor Access / Weakness / Damage scores (NIST SP 800-30 shaped, versioned v1 model)
  • Chain propagation with explainability paths and concentration flags
  • What-if scenarios (reduce access, add controls, remove edges)
  • Curated catalog (~25 vendors) with breaches, certs, MFA posture
  • Demo fixtures: restaurant SMB, Target 2013 HVAC replay
  • CLI evaluation harness for SoK tables
  • Audit log of org/graph/assessment actions

Quick start (laptop)

cd vendorchain
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# create schema + seed catalog from data/catalog/vendors_v1.json
vendorchain-seed

# run the web app (FastAPI + real HTML/CSS UI)
vendorchain-web
# or: uvicorn vendorchain.adapters.web.app:app --reload --port 8000

Open http://localhost:8000

Guided flow

  1. Landing → Get started
  2. Create account
  3. Create a business (or load a sample)
  4. Add companies → map connections → show ranking → try a fix

Share with others (Docker + ngrok)

docker compose up --build
# in another terminal:
ngrok http 8000

Send the ngrok HTTPS URL to teammates or graders.

Streamlit remains in the repo only as a legacy adapter; the primary UI is the web app.

Tests

pytest -q

SoK evaluation harness

vendorchain-eval \
  --fixture restaurant.json \
  --fixture target_2013.json \
  --db sqlite:///data/eval.db \
  --out data/eval_out

Writes CSV / Markdown / JSON comparing standalone vs chain ranks (and ground-truth top-k hits).

Docker

export VENDORCHAIN_SECRET_KEY='replace-with-long-random'
docker compose up --build

SQLite lives in the vc_data volume. Swap to Postgres later by setting VENDORCHAIN_DATABASE_URL=postgresql+psycopg://... (same SQLAlchemy models).

Architecture

adapters/streamlit  →  application services  →  domain (scoring, chain, policy)
adapters/cli        →           ↓
                     infrastructure (SQLAlchemy repos, argon2, JSON seeder)
  • JSON (data/catalog/) = curated public intel, seeded into SQLite
  • SQLite = users, orgs, memberships, vendor graphs, assessment snapshots, audit
  • Domain never imports Streamlit or SQLAlchemy

Security notes

  • Passwords hashed with argon2id
  • Sessions stored server-side; Streamlit keeps only the session token
  • Every use case checks org membership (fail closed); viewers cannot mutate
  • Graph size limits (max_vendors_per_org, max_edges_per_org)
  • Catalog/fixtures loaded only from the package data/ directory
  • Vendor graphs are sensitive business intel — no telemetry by default
  • Set VENDORCHAIN_SECRET_KEY in any shared deployment

Environment

Variable Purpose
VENDORCHAIN_DATABASE_URL SQLAlchemy URL (default: data/vendorchain.db)
VENDORCHAIN_SECRET_KEY App secret
VENDORCHAIN_SESSION_HOURS Session lifetime (default 12)

Project layout

src/vendorchain/
  domain/           entities, scoring v1, chain propagator, policies
  application/      auth, org, vendor graph, assessment, what-if
  infrastructure/   SQLAlchemy, repos, seed, container
  adapters/streamlit/
  adapters/cli/
data/catalog/       vendors_v1.json
data/fixtures/      restaurant.json, target_2013.json
data/scoring_models/v1.yaml
alembic/            migrations

Privacy

Assessment inputs (vendor relationships, access levels) can reveal how your business operates. Keep the SQLite file protected; do not commit data/*.db.

About

VendorChain: third-party risk ranking with chain propagation (SoK-guided implementation)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages