Skip to main content

Supply Chan in Security Project Dependencies

Project description

Rekor Verifier Utility

Python 3.9+ License Sigstore

A Python tool for verifying artifacts and ensuring integrity using Sigstore's Rekor transparency log. Built for the NYU Software Supply Chain Security class, this tool demonstrates how transparency logs work and how to cryptographically verify software artifacts.

Note: This tool works with artifacts that have already been signed using Sigstore Cosign. It focuses on verification rather than signing.

🎯 What It Does

This tool helps you work with the Rekor transparency log to:

  • 📋 Fetch Checkpoints - Retrieve the latest state of the Rekor transparency log
  • ✅ Verify Inclusion - Confirm that a signed artifact's log entry exists in the transparency log
  • 🔒 Verify Consistency - Ensure the log hasn't been tampered with between checkpoints
  • 🔐 Validate Signatures - Cryptographically verify artifact signatures using certificates from log entries

In simple terms: It helps you confirm that your artifact was properly logged in Rekor and that the transparency log itself is trustworthy and hasn't been modified.

📋 Prerequisites

Before you begin, ensure you have:

  • Python 3.9 or higher - Check with python --version or python3 --version
  • pip - Python package installer (usually comes with Python)
  • git - For cloning the repository

🚀 Installation

1. Clone the Repository

git clone https://github.com/vinayakmalik1999/supply_chain_security_nyu.git
cd supply_chain_security_nyu

2. Set Up Virtual Environment (Recommended)

# On macOS/Linux
python3.9 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

This will install:

  • cryptography - For signature verification and certificate handling
  • requests - For HTTP communication with the Rekor API

4. Install Static Analysis tools**

pip install -r tools.txt

5. Verify Installation

python3 main.py --checkpoint

You should see the latest checkpoint information from Rekor!

📖 Usage

Fetch Latest Checkpoint

Retrieve the current state of the Rekor transparency log:

python3 main.py --checkpoint

With debug mode:

python3 main.py --checkpoint --debug

Debug mode saves the checkpoint to checkpoint_latest.json for later verification.


Verify Artifact Inclusion

Confirm that a specific log entry (for a signed artifact) exists in the transparency log:

python3 main.py --inclusion <log-index> --artifact <artifact>

Prerequisites:

  • Your artifact must have been previously signed with Cosign
  • You need the log index from when it was signed

Example workflow:

# Step 1: Sign your artifact with Cosign (if not already signed)
# This uploads the signature to Rekor and returns a log index
cosign sign-blob --bundle=artifact.bundle artifact.txt
# Output includes: "tlog entry created with index: 125847350"

# Step 2: Verify the artifact exists in Rekor
python main.py --inclusion 125847350 --artifact artifact.txt

Debug mode:

python main.py --inclusion 125847350 --artifact artifact.txt --debug

This saves log_entry_125847350.json with detailed verification data.


Verify Log Consistency

Ensure the transparency log is append-only and hasn't been tampered with between two checkpoints:

python main.py --consistency --tree-id <tree-id> --tree-size <tree-size> --root-hash <root-hash>

Example workflow:

# Step 1: Fetch and save an older checkpoint
python main.py --checkpoint --debug
# This saves checkpoint_latest.json with:
# - tree-id: 1234567890
# - tree-size: 125847000
# - root-hash: c8f9a5b2e3d4a1f7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1

# Step 2: Wait some time (hours/days) or perform operations that add to the log

# Step 3: Verify consistency between the old checkpoint and current log state
python main.py --consistency \
  --tree-id 1234567890 \
  --tree-size 125847000 \
  --root-hash c8f9a5b2e3d4a1f7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1

Debug Mode

Add --debug to any command to save intermediate data locally and see detailed output:

python main.py --checkpoint --debug
python main.py --inclusion 12345 --artifact file.txt --debug
python main.py --consistency --tree-id <id> --tree-size <size> --root-hash <hash> --debug

Debug mode creates:

  • checkpoint_latest.json - Latest checkpoint data
  • log_entry_<index>.json - Detailed log entry information
  • Additional verification data and intermediate results

📦 Dependencies

This project requires two Python packages to run, specified in requirements.txt:

Core Dependencies

  • cryptography - Provides cryptographic primitives

    • ECDSA signature verification
    • X.509 certificate parsing and handling
  • requests - HTTP client library

    • pre-commit - Precommit hooks framework

NOTE: while there are other dependencies they are not required to run the utility

Installing Dependencies

# Install from requirements.txt
pip install -r requirements.txt

Verifying Dependencies

# Check installed versions
pip list | grep -E "cryptography|requests"

📚 Documentation

  • SECURITY.md - Security policy, threat model, and vulnerability reporting
  • CONTRIBUTING.md - Guidelines for contributing to the project

This is an educational project demonstrating transparency log verification. For production use, please use official Sigstore tools.

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

supply_chain_security_nyu-2.0.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

supply_chain_security_nyu-2.0.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file supply_chain_security_nyu-2.0.1.tar.gz.

File metadata

  • Download URL: supply_chain_security_nyu-2.0.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Darwin/25.0.0

File hashes

Hashes for supply_chain_security_nyu-2.0.1.tar.gz
Algorithm Hash digest
SHA256 ac5c40792cdf9a3c4993af12ead222ce5796b8ff2248d2c3536359cb21bcb9ea
MD5 3af4b7020e8527786647621c0edaf1dc
BLAKE2b-256 3d8a05ce29eb5b97ae0eb273895153674a68ec07105dbcef6617c9d95dfd650b

See more details on using hashes here.

File details

Details for the file supply_chain_security_nyu-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for supply_chain_security_nyu-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7a715d7c5340102af66fbf57abfae2d6e4666321b5b501a75ff2e501df19c9c
MD5 ede0996769243df5f7a9d48169163918
BLAKE2b-256 fa34f99c2f43aa2e8d46fcc4482a095ba8586529a42146cc16b5f940714057fc

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