Supply Chain Security Lab
make validateOverview
Section titled “Overview”Local and CI-based container supply-chain security lab for students.
What You Will Build
Section titled “What You Will Build”Architecture Diagram
Section titled “Architecture Diagram”Prerequisites
Section titled “Prerequisites”- Install or review: Docker, Trivy, Sbom, Cosign, GitHub Actions.
- No cloud provider credentials are required by the project metadata.
- This project can be practiced locally before you publish portfolio evidence.
- Open the safety guide before running commands that create infrastructure.
Credentials And Cost Warning
Section titled “Credentials And Cost Warning”Cost risk is low. Cloud target: no cloud provider. Cloud credentials needed: No. Always use your own account, never commit secrets, and confirm cleanup before creating paid infrastructure.
Step-By-Step Lab
Section titled “Step-By-Step Lab”Use this flow before you run commands:
- Read the cost and credential warning above.
- Review the validation, troubleshooting, cleanup, and portfolio proof sections below.
- Follow the original project guide preserved near the bottom of this page.
- Return to the validation and cleanup checks before you capture portfolio evidence.
Validation Checks
Section titled “Validation Checks”Run the project validation command before and after meaningful changes:
make validateTroubleshooting
Section titled “Troubleshooting”- Run
make validatefirst so local tooling issues are visible early. - If a command fails, check tool versions, working directory, and required environment variables.
- For pipeline failures, check repository secrets, runner permissions, and pinned action versions.
Cleanup
Section titled “Cleanup”Cleanup is available or expected for this lab. Use the cleanup or destroy steps in the guide below, then confirm that local clusters, containers, cloud resources, buckets, state files, and CI secrets are no longer active.
Portfolio Proof
Section titled “Portfolio Proof”- Validation command output:
make validate - Screenshot or terminal proof: Passing pipeline run plus scan/deploy evidence
- Notes explaining what changed, what failed, and how you fixed it
- Cleanup evidence, especially for cloud or Kubernetes resources
Original Project Guide
Section titled “Original Project Guide”The original README content is preserved here for lab-specific commands and context. Headings are intentionally demoted so the page outline stays focused on the standard lab flow.
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.
Source Files On GitHub
Section titled “Source Files On GitHub”The full learning flow stays on this page. Open GitHub only when a step asks you to inspect code, fork the lab, or download source assets.