Status: SLSA Level 2 Target: SLSA Level 3 Last Updated: 2025-01-22
- What is SLSA?
- Current Compliance
- SLSA Level 2 (Current)
- SLSA Level 3 (Planned)
- Build Provenance
- Verification
- Supply Chain Threats
- Roadmap
SLSA (Supply-chain Levels for Software Artifacts) is a security framework to protect software supply chains from tampering, unauthorized changes, and malicious code injection.
Goals:
- Prevent unauthorized modifications to source code
- Ensure integrity of build process
- Provide verifiable provenance for artifacts
- Enable consumers to verify artifact authenticity
Levels:
- Level 1: Documentation of build process
- Level 2: Tamper-resistant build service
- Level 3: Hardened build platforms
- Level 4: Highest level of auditability (two-party review)
| Requirement | Status | Implementation |
|---|---|---|
| Version controlled source | ✅ | GitHub repository |
| Generated provenance | ✅ | GitHub Actions attestations |
| Build service | ✅ | GitHub Actions |
| Automated build | ✅ | CI/CD pipeline |
| Provenance available | ✅ | Signed attestations |
| Requirement | Status | Implementation |
|---|---|---|
| Hardened build platform | 🔄 | GitHub Actions (trusted) |
| Non-falsifiable provenance | 🔄 | Sigstore integration planned |
| Isolated builds | ✅ | Ephemeral GitHub runners |
| Parameterless builds | 🔄 | Working towards |
| Hermetic builds | ❌ | Planned for v2.0 |
Requirement: Source code is version controlled with history.
Implementation:
- Git repository: https://github.com/ibrahimcesar/telemetry-kit
- All changes tracked in version control
- Signed commits encouraged (not required)
- Branch protection on
main:- Pull request required
- Status checks must pass
- No direct pushes
Verification:
# Clone repository
git clone https://github.com/ibrahimcesar/telemetry-kit
cd telemetry-kit
# Verify history
git log --oneline
# Check for signed commits
git log --show-signatureRequirement: Provenance is automatically generated for each release.
Implementation:
- GitHub Actions workflows generate SLSA provenance
- Provenance includes:
- Source commit SHA
- Build parameters
- Builder identity
- Build timestamp
- Stored as GitHub attestations
Verification:
# Download release
gh release download v0.2.0
# Verify attestation (requires gh CLI v2.40+)
gh attestation verify telemetry-kit-*.tar.gz \
--owner ibrahimcesarRequirement: Builds are performed by a hosted build service.
Implementation:
- Service: GitHub Actions
- Runners: GitHub-hosted (Ubuntu latest)
- Isolation: Each build runs in fresh VM
- Logging: Full build logs available
- Reproducibility: Same inputs → same outputs
Build Configuration: .github/workflows/release.yml
Requirement: Build process is defined as code in version control.
Implementation:
# .github/workflows/release.yml
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # For SLSA provenance
attestations: write
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release
- name: Generate provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: 'target/release/telemetry-kit'Requirement: Build platform prevents tampering by build process.
Current State:
- GitHub Actions provides isolation ✅
- Ephemeral runners prevent persistence ✅
- No access to secrets from forks ✅
Planned Improvements:
- Custom runners with enhanced security
- Restricted network access during builds
- Immutable build containers
Requirement: Provenance cannot be forged by build process itself.
Current State:
- GitHub Actions signs provenance ✅
- Attestations stored externally ✅
Planned Improvements:
- Sigstore integration: Sign with Rekor transparency log
- Cosign signatures: Verify artifacts with cosign
- Public transparency: All signatures publicly verifiable
Example (planned):
# Sign with cosign
cosign sign-blob \
--bundle telemetry-kit.bundle \
target/release/telemetry-kit
# Verify signature
cosign verify-blob \
--bundle telemetry-kit.bundle \
--certificate-identity=https://github.com/ibrahimcesar/telemetry-kit/.github/workflows/release.yml@refs/heads/main \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
target/release/telemetry-kitRequirement: Builds cannot access secrets or network.
Current State:
- Each build runs in fresh VM ✅
- Secrets not available to build steps ✅
- Network access restricted (partially)
Verification:
# Build step has no secret access
- name: Build
run: cargo build --release
# No 'env:' with secrets
# No 'with: secrets'Requirement: Build doesn't accept user-controlled parameters.
Current State:
- Tag triggers build ✅
- No manual workflow_dispatch ✅
- Build parameters from git only ✅
Improvement Needed:
- Remove version from Cargo.toml
- Derive version from git tag
- Zero external parameters
Requirement: All dependencies declared and fetched from known sources.
Planned for v2.0:
- Vendor all dependencies
- Cargo.lock pinning (already done ✅)
- Offline build capability
- Reproducible builds
Provenance is metadata about how an artifact was built:
- What: Source repository and commit
- When: Build timestamp
- Where: Build platform (GitHub Actions)
- Who: Builder identity (GitHub)
- How: Build recipe (.github/workflows/release.yml)
We use the in-toto SLSA Provenance format (v1.0):
{
"_type": "https://in-toto.io/Statement/v1",
"subject": [
{
"name": "telemetry-kit",
"digest": {
"sha256": "abc123..."
}
}
],
"predicateType": "https://slsa.dev/provenance/v1",
"predicate": {
"buildDefinition": {
"buildType": "https://github.com/actions/...",
"externalParameters": {
"workflow": {
"ref": "refs/tags/v0.2.0",
"repository": "https://github.com/ibrahimcesar/telemetry-kit"
}
}
},
"runDetails": {
"builder": {
"id": "https://github.com/actions/runner"
},
"metadata": {
"invocationId": "https://github.com/ibrahimcesar/telemetry-kit/actions/runs/..."
}
}
}
}Via GitHub CLI:
# List attestations for a release
gh attestation list \
--owner ibrahimcesar \
--repo telemetry-kit \
--limit 10
# Download specific attestation
gh attestation download \
--repo ibrahimcesar/telemetry-kit \
--digest-alg sha256 \
--digest abc123...Via API:
# Get attestations
curl -H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/ibrahimcesar/telemetry-kit/attestations/sha256:abc123# Install from crates.io
cargo install telemetry-kit
# Verify checksum matches GitHub release
sha256sum $(which telemetry-kit)
# Compare with GitHub release checksum
curl -sL https://github.com/ibrahimcesar/telemetry-kit/releases/download/v0.2.0/checksums.txt# Download release
wget https://github.com/ibrahimcesar/telemetry-kit/releases/download/v0.2.0/telemetry-kit-linux-x86_64.tar.gz
# Verify checksum
sha256sum telemetry-kit-linux-x86_64.tar.gz
# Verify attestation
gh attestation verify telemetry-kit-linux-x86_64.tar.gz \
--owner ibrahimcesar \
--repo telemetry-kit# Clone repository
git clone https://github.com/ibrahimcesar/telemetry-kit
cd telemetry-kit
# Verify tag signature (if signed)
git tag -v v0.2.0
# Build from source
cargo build --release
# Verify build is reproducible
cargo clean
cargo build --release
sha256sum target/release/telemetry-kit| Threat | Mitigation | SLSA Level |
|---|---|---|
| Compromised source repo | Branch protection, 2FA required | L2 |
| Malicious dependencies | cargo-deny, cargo-audit | L2 |
| Tampered build process | Immutable workflow files | L2 |
| Man-in-the-middle attacks | HTTPS, TLS certificate pinning | L1 |
| Compromised build environment | Ephemeral GitHub runners | L3 |
| Forged provenance | GitHub-signed attestations | L3 (partial) |
| Threat | Status | Target |
|---|---|---|
| Dependency confusion | 🔄 Planning | L3 |
| Typosquatting | 🔄 Monitoring | L2 |
| Compromised maintainer account | ✅ 2FA enforced | L2 |
| Build parameter injection | 🔄 Hardening | L3 |
| Time-of-check to time-of-use (TOCTOU) | ❌ Future | L4 |
❌ Not Yet Addressed:
- Hermetic builds (dependencies fetched at build time)
- Reproducible builds (timestamps in binaries)
- Post-build tampering (waiting for Sigstore)
- Supply chain attacks on build tools (cargo, rustc)
- GitHub Actions for builds
- Provenance generation
- Branch protection
- Automated releases
- Checksums published
- Sigstore integration
- Sign releases with cosign
- Upload to Rekor transparency log
- Verify in CI/CD
- Hardened builds
- Network isolation
- Read-only filesystems
- Minimal base images
- Parameterless builds
- Version from git tags only
- No manual workflow triggers
- Reproducible builds
- Fixed timestamps
- Hermetic dependencies
- Vendored crates
- SBOM generation
- CycloneDX format
- Dependency graph
- License compliance
- Vulnerability scanning
- Automated Dependabot PRs
- Trivy container scanning
- OSV.dev integration
- Two-party review
- Mandatory code review
- Signed commits required
- Build reproducibility verified
- Complete audit trail
We trust these crates.io publishers:
tokio- Tokio team (verified)serde- Serde team (verified)reqwest- Sean McArthur (verified)rusqlite- John Gallagher (verified)
# Audit dependencies for vulnerabilities
cargo audit
# Check dependency licenses
cargo deny check licenses
# Review dependency authors
cargo supply-chain publishers
# Check for unmaintained crates
cargo outdatedWe commit Cargo.lock to ensure deterministic builds:
# Verify dependencies match lock
cargo verify-project
# Check for inconsistencies
cargo treeBefore Submitting PRs:
- Sign your commits:
git config --global commit.gpgsign true - Run security checks:
cargo audit && cargo deny check - No secrets in code:
git-secrets --scan
In Pull Requests:
- Add new dependencies to
deny.tomlallowlist - Update SBOM if dependencies change
- Note security implications in PR description
Before Merging:
- Review dependency changes carefully
- Check for suspicious code patterns
- Verify CI passes all security checks
- Ensure provenance will be generated
Release Process:
- Tag with GPG-signed tag
- Wait for automated build
- Verify attestation is generated
- Test installation from crates.io
Questions about SLSA compliance?
- Email: security@ibrahimcesar.com
- GitHub: https://github.com/ibrahimcesar/telemetry-kit/security
- Discussions: https://github.com/ibrahimcesar/telemetry-kit/discussions
Document Version: 1.0 Last Updated: 2025-01-22 SLSA Level: 2 (working towards 3)