Deployment Guide

This guide covers how to build, configure, and deploy SourceSeal from local development through production.

Development Setup

Prerequisites

ToolVersionPurpose
Go1.22+Build the CLI and API server
Docker20.10+Container runtime for services and Fabric network
Docker Composev2+Orchestrate multi-container deployments
MakeanyBuild automation
bash
go version              # Should print go1.22 or later
docker info             # Should succeed (Docker daemon running)
docker compose version  # Should print v2.x

Build from Source

bash
git clone https://github.com/sourceseal/sourceseal.git
cd sourceseal
make build

# Binaries are placed in ./bin/
ls bin/
# sourceseal         (CLI)
# sourceseal-server  (API server)

Run in Development Mode

Development mode uses in-memory stores and a stub Fabric client. No external dependencies are required.

bash
# Start the API server (no auth, in-memory storage, stub blockchain)
SOURCESEAL_DEV_MODE=true ./bin/sourceseal-server

# Verify it is running
curl http://localhost:8080/healthz
# {"status":"ok"}

Initialize the CLI

bash
./bin/sourceseal init

Creates ~/.sourceseal/ with an Ed25519 key pair and a config pointing to http://localhost:8080.

Docker Compose

App Services Only (External Fabric)

Starts PostgreSQL, MinIO, and the SourceSeal API server:

bash
docker compose -f deployments/docker-compose.yaml up -d
  • PostgreSQL 15 -- Attestation metadata store (port 5432)
  • MinIO -- S3-compatible SBOM storage (port 9000, console on 9001)
  • SourceSeal API -- REST API server (port 8080)

Full Stack (Including Fabric Network)

bash
docker compose -f deployments/docker-compose.yaml --profile fabric up -d

Additionally starts: Fabric CA (port 7054), Fabric Orderer (port 7050), Fabric Peer (port 7051), and CouchDB (port 5984).

bash
# Or use the Makefile shortcuts
make docker-up    # Start full stack
make docker-down  # Stop everything

Fabric Network Setup

For a dedicated Fabric network (outside of Docker Compose), use the setup script:

bash
./network/setup.sh

This script:

  1. Checks prerequisites (Docker, Docker Compose, peer CLI)
  2. Downloads Hyperledger Fabric 2.5.6 binaries and Docker images
  3. Generates crypto material using cryptogen
  4. Creates channel artifacts (genesis block, channel transaction)
  5. Starts the Fabric network containers
  6. Creates the sourceseal-channel and joins the peer
  7. Packages, installs, approves, and commits the sourceseal-cc chaincode
  8. Runs a test invocation to verify the deployment

Connecting the Server to Fabric

bash
./bin/sourceseal-server \
  --fabric-peer https://localhost:7053 \
  --fabric-channel sourceseal-channel \
  --fabric-chaincode sourceseal-cc \
  --fabric-msp Org1MSP \
  --fabric-cert /path/to/client.crt \
  --fabric-key /path/to/client.key \
  --fabric-tls-cert /path/to/tlsca.pem

Production Checklist

TLS

  • Configure --tls-cert and --tls-key on the API server
  • Use certificates from a trusted CA
  • Enable TLS on Fabric peer, orderer, and CA connections

Authentication

  • Set SOURCESEAL_API_KEYS to strong, randomly generated keys (min 32 chars)
  • Do not set SOURCESEAL_DEV_MODE=true in production
  • Rotate API keys periodically

Database

  • Use --store-type=postgres with a dedicated PostgreSQL instance
  • Enable SSL on the PostgreSQL connection
  • Configure regular database backups

Object Storage

  • Use --sbom-store-type=s3 for durable SBOM storage
  • Set dedicated IAM credentials with minimal permissions
  • Enable server-side encryption on the S3 bucket

Network

  • Place the API server behind a reverse proxy (nginx, Envoy)
  • Set SOURCESEAL_TRUST_PROXY=true when using a reverse proxy
  • Restrict Docker Compose port bindings to 127.0.0.1
  • Configure SOURCESEAL_CORS_ORIGINS to allow only your frontend domain(s)

Environment Variables

API Server

VariableDefaultDescription
SOURCESEAL_API_KEYSComma-separated list of valid API keys for authentication
SOURCESEAL_DEV_MODESet to true to allow unauthenticated access when no API keys are configured
SOURCESEAL_CORS_ORIGINShttp://localhost:3000Comma-separated allowed CORS origins
SOURCESEAL_S3_ACCESS_KEYS3 access key for SBOM storage
SOURCESEAL_S3_SECRET_KEYS3 secret key for SBOM storage
SOURCESEAL_TRUST_PROXYSet to true to trust X-Forwarded-For for client IP detection

Docker Compose

VariableDefaultDescription
POSTGRES_DBsourcesealPostgreSQL database name
POSTGRES_USERsourcesealPostgreSQL username
POSTGRES_PASSWORDsourceseal-devPostgreSQL password. Change in production.
MINIO_ROOT_USERminioadminMinIO root username. Change in production.
MINIO_ROOT_PASSWORDminioadminMinIO root password. Change in production.
S3_BUCKETsourceseal-artifactsS3 bucket name for artifact/SBOM storage
SERVER_PORT8080API server listen port
LOG_LEVELinfoLogging verbosity
FABRIC_CA_ADMINadminFabric CA bootstrap admin username. Change in production.
FABRIC_CA_ADMIN_PASSWORDadminpwFabric CA bootstrap admin password. Change in production.
COUCHDB_USERadminCouchDB username. Change in production.
COUCHDB_PASSWORDadminpwCouchDB password. Change in production.

Fabric Network Setup Script

VariableDefaultDescription
FABRIC_VERSION2.5.6Hyperledger Fabric version to download
CA_VERSION1.5.9Fabric CA version to download
CHANNEL_NAMEsourceseal-channelFabric channel name
CC_NAMEsourceseal-ccChaincode name
CC_VERSION1.0Chaincode version
CC_SEQUENCE1Chaincode lifecycle sequence number