Skip to main content

OSS Supply Chain Risk Scoring - Where abandoned packages come to rest

Project description

Ossuary

OSS Supply Chain Risk Scoring - Where abandoned packages come to rest.

Ossuary analyzes open source packages to identify governance-based supply chain risks before incidents occur. It calculates a risk score (0-100) based on maintainer concentration, activity patterns, protective factors, and takeover detection.

What It Detects

Ossuary targets the subset of supply chain attacks where governance weakness is a precondition - social engineering takeovers, abandoned packages, governance disputes. High maintainer concentration isn't inherently dangerous (pciutils has been maintained by one person for 28 years), but combined with other signals it becomes meaningful.

Can Detect Cannot Detect
Social engineering takeover (xz pattern) Account compromise (stolen tokens)
Abandoned packages Dependency confusion
Governance disputes (left-pad pattern) Typosquatting
Newcomer takeover patterns Malicious code injection
Economic frustration signals Active maintainer sabotage

Quick Start

# Install from GitHub
pip install git+https://github.com/anicka-net/ossuary-risk.git

# Set GitHub token for API access (optional but recommended)
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxx

# Initialize database
ossuary init

# Score a package
ossuary score event-stream --ecosystem npm

# Score across ecosystems
ossuary score numpy --ecosystem pypi
ossuary score serde --ecosystem cargo

# Score with historical cutoff (T-1 analysis)
ossuary score event-stream --ecosystem npm --cutoff 2018-09-01

# Output as JSON
ossuary score requests --ecosystem pypi --json

# Batch score from seed file
ossuary seed-custom seeds/pypi-popular.yaml

# Show packages with biggest score changes
ossuary movers

Supported Ecosystems

npm, PyPI, Cargo, RubyGems, Packagist, NuGet, Go, GitHub

Scoring Methodology

Final Score = Base Risk + Activity Modifier + Protective Factors
             (20-100)      (-30 to +20)        (-70 to +20)

Base Risk from maintainer concentration. Activity Modifier rewards active maintenance, penalizes abandonment. Protective Factors include maintainer reputation, funding (GitHub Sponsors), org ownership, visibility (downloads/stars), community size, and takeover detection.

Takeover Detection (novel contribution): compares each contributor's recent commit share vs historical baseline. A newcomer jumping from 2% to 50% on a mature project triggers an alert. Guards prevent false positives for established contributors, long-tenure maintainers, and internal org handoffs.

When a takeover pattern is detected, the activity bonus is suppressed - high commit activity during a takeover is evidence of the attack, not project health.

See methodology for full details.

Dashboard

# Install with dashboard dependencies
pip install "ossuary-risk[dashboard] @ git+https://github.com/anicka-net/ossuary-risk.git"

# Run dashboard
streamlit run dashboard.py --server.port 8501

Features: risk overview, ecosystem breakdown, package detail with score history, delta detection (biggest movers).

Validation

Validated on 144 packages across 8 ecosystems:

  • Accuracy: 96.5%
  • Precision: 100.0% (zero false positives)
  • Recall: 80.0%
  • F1 Score: 0.89

The 5 remaining false negatives are all account compromises on well-governed projects - confirming the known boundary of governance-based detection.

Development

git clone https://github.com/anicka-net/ossuary-risk.git
cd ossuary-risk
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,dashboard]"
cp .env.example .env  # add GITHUB_TOKEN
ossuary init

Configuration

GITHUB_TOKEN=ghp_xxxxxxxxxxxxx     # GitHub API access (recommended)
DATABASE_URL=sqlite:///ossuary.db  # Default; supports PostgreSQL
OSSUARY_CACHE_DAYS=7               # Score freshness threshold

License

MIT

Academic Context

MBA thesis research on OSS supply chain risk (due Dec 2026). Key contribution: governance-based risk indicators are observable in public metadata before incidents occur, but they address a specific attack subset - not a universal detector.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ossuary_risk-0.7.0.tar.gz (469.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ossuary_risk-0.7.0-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file ossuary_risk-0.7.0.tar.gz.

File metadata

  • Download URL: ossuary_risk-0.7.0.tar.gz
  • Upload date:
  • Size: 469.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ossuary_risk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 e34f971fc6947b3d17e09c1b6c9f6d115e4b6de0a7767a657771c3a02e4daa06
MD5 85fa3191310597e56dd8d2297c8a6550
BLAKE2b-256 b8c5f0fdc0e6c4ef450a27f2ca0d79c45637994ee21102fa06fea6f6e7068cf7

See more details on using hashes here.

File details

Details for the file ossuary_risk-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: ossuary_risk-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 72.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ossuary_risk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96eccc88b834264fd158ee0bdb7eb112f9a9545d73989a13ee8ac96a7f33afe7
MD5 0af258bc0b7152e33e176a10c7cb4746
BLAKE2b-256 b49c2a6464f0e50ab1c8dd8d3843913bceba1e58cee5be4b2bf3dcbc4bd30579

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page