Plan CI delivery and dependency provenance
Plan CI delivery and dependency provenance
Continuous integration (CI) checks changes with pinned tools and reviewable inputs. A delivery pipeline should test, vet, verify dependencies, scan known vulnerabilities with an approved tool, build immutable artifacts, produce a software bill of materials (SBOM) and authenticated provenance, and promote the same artifact through environments. Provenance describes where and how an artifact was built; a checksum alone does not establish trust in the builder.
package main
import ( "crypto/sha256" "fmt")
func main() { a := []byte("release-v1") expected := sha256.Sum256(a) fmt.Println(sha256.Sum256(a) == expected) fmt.Println(sha256.Sum256([]byte("release-v2")) == expected)}A digest identifies bytes. Here the expected digest is derived locally from synthetic trusted input; in deployment obtain it from an authenticated manifest, validate signatures and provenance against policy, and bind the digest to the actual artifact. Hash equality does not prove a binary is safe. go.sum and go mod verify help detect module-content changes but are not vulnerability scanning.
Expected output:
truefalseGate release on required checks
package main
import ( "fmt")
func permit(checks map[string]bool) bool { for _, k := range []string{"test", "vet", "dependencies", "provenance"} { if !checks[k] { return false } } return true}func main() { checks := map[string]bool{"test": true, "vet": true, "dependencies": true} fmt.Println(permit(checks)) checks["provenance"] = true fmt.Println(permit(checks))}This fail-closed model treats a missing check as failure, not success. Actual CI must obtain results from trusted jobs rather than caller-supplied booleans. Run go test ./..., go vet ./..., go mod verify, and build only after review; use supported pinned tools for vulnerability and provenance verification. Stage, monitor rollout, and retain a tested rollback artifact. Do not equate this model with a SLSA compliance claim.
Expected output:
falsetrueTry it locally
Write a gate requiring tests and digest verification. Demonstrate rejection when verification is absent and acceptance when both are true.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Service protocols and cloud 08: Plan CI delivery and dependency provenance
Check the lesson objective before moving on.
What does a checksum by itself prove?
What should a required missing CI result mean?