Supply Chain Security Lab
low
ci cd ready
ci lab
make validate
Use the guide first.
The full learning guide is on this page. Open the repository files only when a step asks you to inspect code, fork the project, or download raw assets.
Project Guide
Section titled “Project Guide”
Student-friendly lab for learning image scanning, SBOM generation, and image signing concepts with GitHub Actions, Trivy, Syft, and Cosign.
What You Learn
Section titled “What You Learn”- How container images move through a security pipeline
- How to scan for vulnerabilities and secrets
- How to generate an SBOM
- Why image signing matters
- How CI gates protect deployments
Architecture
Section titled “Architecture”flowchart LR Code["Node demo app"] --> Image["Docker image"] Image --> Trivy["Trivy vulnerability scan"] Image --> Syft["Syft SBOM"] Image --> Cosign["Cosign signing optional"] Trivy --> Gate["CI security gate"] Syft --> Artifact["SBOM artifact"]Prerequisites
Section titled “Prerequisites”- Node.js for local syntax validation
- Docker
- Trivy for vulnerability scanning
- Syft for SBOM generation
- Cosign, optional for signing
One-Command Local Workflow
Section titled “One-Command Local Workflow”make validatemake upmake logsmake scanmake downmake up builds the local image and runs it at http://localhost:8080.
Beginner Local Flow
Section titled “Beginner Local Flow”docker build -t supply-chain-demo:local ./apptrivy image --severity HIGH,CRITICAL supply-chain-demo:localsyft supply-chain-demo:local -o spdx-json > sbom.spdx.jsonOptional signing flow:
cosign generate-key-paircosign sign --key cosign.key supply-chain-demo:localValidation
Section titled “Validation”make validateThis runs node --check app/server.js and parses the GitHub Actions workflow when PyYAML is installed.
CI Flow
Section titled “CI Flow”The sample workflow in .github/workflows/security.yml builds the image, scans it, and writes an SBOM artifact.
Troubleshooting
Section titled “Troubleshooting”trivy: command not found: install Trivy, or run onlymake validateandmake upfor the beginner path.syft: command not found: install Syft before generatingsbom.spdx.json.- Docker cannot connect: start Docker Desktop or your local Docker engine.
- Signing a local image fails: push to a registry first, or use the signing step as a concept exercise.
Cleanup
Section titled “Cleanup”make downrm -f sbom.spdx.json cosign.key cosign.pubStudent Exercises
Section titled “Student Exercises”- Add a vulnerable dependency and watch Trivy fail.
- Add
.trivyignorewith a documented exception. - Push the image to GHCR.
- Sign the GHCR image with keyless Cosign.