On this page

🎯 Workshop Overview

β€œSecure code is not enough. You must also secure the PATH from source to runtime β€” and prove what arrived is what you built.”

Open in GitHub Codespaces

This is Workshop 3 of 4 in the Agentic DevSecOps series. A hands-on workshop (30–45 min, 3 exercises) for DevSecOps engineers who need to eliminate credential theft, prove artifact provenance, and trace runtime vulnerabilities back to their source commit β€” using OIDC, GitHub artifact attestations, and Microsoft Defender for Cloud.

Β  Workshop Focus
πŸ›‘οΈ WS1 β€” Trust Boundary & Platform Trust WHERE does development happen?
πŸ”’ WS2 β€” Secure by Design Guardrails WHAT prevents bad code from landing?
πŸ”— WS3 β€” Supply Chain Integrity & Code-to-Cloud Visibility (YOU ARE HERE) HOW do we trust the delivery path?
πŸ”„ WS4 β€” Operational Response & Continuous Improvement WHAT happens when things go wrong?

πŸ“š Learning Objectives

By the end of this workshop, you will be able to:

  1. Explain why supply chain integrity requires controls beyond code scanning β€” protecting the delivery path, not just the code
  2. Replace long-lived deployment secrets with OIDC federated credentials, eliminating an entire class of credential-theft attacks
  3. Sign build artifacts with attestations and verify provenance from the consumer side using gh attestation verify
  4. Trace a runtime vulnerability back through the delivery chain to its source commit using Microsoft Defender for Cloud’s code-to-runtime correlation
  5. Update the threat model with supply chain controls (OIDC for credential theft, attestation for artifact tampering)

πŸ—οΈ NIST SP 800-204D Alignment

This workshop focuses on PS β€” Protect the Software: ensuring that all forms of the software are protected from unauthorized access and tampering.

NIST SSDF Practice Group WS1 WS2 WS3 WS4
PO β€” Prepare the Organization βœ… Core β€” β€” β€”
PS β€” Protect the Software β€” β€” βœ… Core β€”
PW β€” Produce Well-Secured Software β€” βœ… Core β€” β€”
RV β€” Respond to Vulnerabilities β€” β€” β€” βœ… Core
Attribute Value
Thesis β€œSecure code is not enough. Secure the PATH from source to runtime β€” and prove what arrived is what you built.”
Driving Question β€œHOW do we trust the delivery path β€” and can we trace from runtime back to source?”
Key Insight β€œVisibility without integrity is weak. Integrity without runtime context is slow. You need both.”
NIST SSDF Group PS β€” Protect the Software
Duration 30–45 minutes
Exercises 3

πŸ“– Curriculum

Step Title Duration
Setup Environment Setup ~15 min
1 OIDC & Credential-Free Deployment ~12 min
2 Artifact Attestation & Provenance ~12 min
3 Code-to-Runtime Correlation ~12 min
Exercise Title Goal Unique Focus
1 OIDC & Credential-Free Deployment Eliminate credential theft as an attack class Before/after OIDC comparison, token exchange verification
2 Artifact Attestation & Provenance Prove what was built, where, and from what source Sign artifact, consumer-side gh attestation verify
3 Code-to-Runtime Correlation Trace a runtime issue back to its source commit Defender for Cloud: Runtime β†’ Registry β†’ Pipeline β†’ Source

πŸ’¬ Discussion Prompts

  1. Blast Radius of OIDC Misconfiguration β€” If your OIDC federated credential configuration is compromised (e.g., wildcard subject claim), what’s the blast radius? How does this compare to a leaked static secret? How would you recover?

  2. Pipeline Integrity Beyond Credentials β€” NIST SP 800-204D calls for CI/CD pipeline integrity verification. We secured credentials (OIDC) and artifacts (attestation). What other pipeline steps could be compromised? (Think: build dependencies, runner images, action versions.)

  3. Attestation for Auditors β€” How would you explain artifact attestation to a non-technical auditor? What evidence would you show them to prove a production deployment matches a reviewed PR?

  4. Scaling OIDC Across the Organization β€” Your team has 200 repositories deploying to 5 cloud environments. How would you roll out OIDC at scale? What governance controls would you put in place to manage federated credential configurations?


πŸš€ Optional Extensions

Extension A: Copilot Pipeline Updates

Can GitHub Copilot help update CI/CD infrastructure?

  1. Open the Dockerfile in VS Code with Copilot enabled
  2. Ask Copilot: β€œUpdate this Dockerfile to use a more secure base image with minimal attack surface”
  3. Ask Copilot: β€œAdd a health check to this Dockerfile”
  4. Review the suggestions β€” does Copilot understand supply chain implications of base image selection?

Extension B: Attestation as Compliance Evidence

Export attestation data for auditor submission:

gh attestation verify oci://${ACR_NAME}.azurecr.io/supply-chain-demo:latest \
  --owner {owner} \
  --format json > attestation-evidence.json

cat attestation-evidence.json | jq '{
  buildTimestamp: .verificationResult.statement.metadata.buildFinishedOn,
  sourceRepo: .verificationResult.statement.invocation.configSource.uri,
  sourceCommit: .verificationResult.statement.materials[0].digest,
  builder: .verificationResult.statement.builder.id
}'

Extension C: Multi-Registry Provenance

Test attestation verification across different container registries:

  1. Push the same image to a second registry (e.g., GitHub Container Registry)
  2. Verify attestation works from both registries
  3. Discuss: How does registry choice affect supply chain trust?

Extension D: Tampering Deep-Dive

Explore additional tampering scenarios:

  1. Modify a workflow file to inject an extra build step β€” does attestation still pass? (Yes β€” but the provenance metadata changes)
  2. Pin action versions vs. using @main β€” what’s the supply chain risk?
  3. Discuss: What would a comprehensive pipeline integrity policy look like?

πŸ“Ž References

Resource Link
GitHub Docs: Actions OIDC Configuring OpenID Connect in Azure
GitHub Docs: Artifact Attestations Using artifact attestations
GitHub Docs: gh attestation verify Verifying artifact attestations with the GitHub CLI
GitHub Actions: actions/attest-build-provenance attest-build-provenance action
NIST SP 800-218 (SSDF) Secure Software Development Framework β€” PS group
NIST SP 800-204D Strategies for Integration of Software Supply Chain Security in DevSecOps CI/CD Pipelines
Microsoft Learn: Defender for Cloud Code-to-cloud security with Defender for Cloud
Microsoft Learn: Defender + GHAS Connect GitHub repositories to Defender for Cloud
Azure Docs: Workload Identity Federation Workload identity federation for GitHub Actions