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 based on maintainer concentration, activity levels, and protective factors.

What It Detects

Ossuary focuses on governance failures - the type of vulnerability that enabled attacks like:

  • event-stream (2018) - Abandoned package handed off to malicious maintainer
  • colors/faker (2022) - Frustrated maintainer intentionally sabotaged packages

Detection Capabilities

Can Detect Cannot Detect
Maintainer abandonment Account compromise (like ua-parser-js)
High concentration risk Dependency confusion attacks
Economic frustration signals Typosquatting
Declining activity trends Malicious code injection
Governance centralization

Quick Start

# Install
pip install ossuary

# Initialize database (optional, for caching)
ossuary init

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

# 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

Risk Levels

Score Level Semaphore Action
0-20 Very Low ๐ŸŸข Routine monitoring
21-40 Low ๐ŸŸข Quarterly review
41-60 Moderate ๐ŸŸก Monthly review
61-80 High ๐ŸŸ  Weekly review + contingency plan
81-100 Critical ๐Ÿ”ด Immediate action required

Scoring Methodology

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

Base Risk (Maintainer Concentration)

Concentration Points
<30% 20
30-50% 40
50-70% 60
70-90% 80
>90% 100

Activity Modifier

Commits/Year Points
>50 -30
12-50 -15
4-11 0
<4 +20

Protective Factors

Factor Points
Tier-1 maintainer (500+ repos or 100K+ stars) -25
GitHub Sponsors enabled -15
Organization with 3+ admins -15
>50M weekly downloads -20
>10M weekly downloads -10
<40% concentration -10
>20 contributors -10
CII Best Practices badge -10
Frustration signals detected +20

API Usage

Start the API server:

uvicorn ossuary.api.main:app --host 0.0.0.0 --port 8000

Query a package:

curl "http://localhost:8000/score/npm/event-stream"

Response:

{
  "package": "event-stream",
  "ecosystem": "npm",
  "score": 100,
  "risk_level": "CRITICAL",
  "semaphore": "๐Ÿ”ด",
  "explanation": "๐Ÿ”ด CRITICAL (100). Critical concentration (90%): single person controls nearly all commits. Project appears abandoned (<4 commits/year).",
  "recommendations": [
    "IMMEDIATE: Identify alternative packages or prepare to fork",
    "Do not accept new versions without manual code review"
  ]
}

Development

# Clone
git clone https://github.com/anicka/ossuary.git
cd ossuary

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check src/

# Type check
mypy src/

Configuration

Environment variables:

# Required for higher GitHub API rate limits
GITHUB_TOKEN=ghp_xxxxxxxxxxxxx

# Database (defaults to SQLite)
DATABASE_URL=postgresql://user:pass@localhost/ossuary

# Repository storage
REPOS_PATH=./repos

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        API / CLI                            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Scoring Engine                           โ”‚
โ”‚  - Base risk (concentration)                                โ”‚
โ”‚  - Activity modifier                                        โ”‚
โ”‚  - Protective factors                                       โ”‚
โ”‚  - Sentiment analysis                                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Data Collectors                           โ”‚
โ”‚  GitCollector | GitHubCollector | NpmCollector | PyPICollectorโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Validation

Validated on 93 packages (20 incidents + 73 controls):

  • Accuracy: 91.4%
  • Precision: 92.9%
  • Recall: 65.0%
  • F1 Score: 0.76

T-1 analysis confirms 100% predictive detection of governance-detectable incidents before they occurred.

See methodology documentation for details.

License

MIT

Academic Context

This project supports MBA thesis research on OSS supply chain risk. Key contribution: demonstrating that meaningful risk indicators are observable in public metadata before incidents occur.

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.1.0.tar.gz (53.2 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.1.0-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ossuary_risk-0.1.0.tar.gz
  • Upload date:
  • Size: 53.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 78fcc20279f300acd6a0888e797d1afbfaac5c9ffe872b2e3e9a2422b86fb847
MD5 f2bedfe4e41c2d9270501b539e1c8346
BLAKE2b-256 d6572c3979c492c97b571372324e59ed7b97c197cd93eef980d9e4811a9eb6b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ossuary_risk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 110acaf66099bce80bb7f4e7121b54a3aaa4b11f44e148b86551b1a3cec0c29e
MD5 0d991bf399796eded9c99c8b42f2c3c6
BLAKE2b-256 70929b47cd3e89ab05ab8b5f3c795483be42d9de7859c7368357f2343995d909

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