Lion Cipher Lab

Secure Lambda layers and the dependency supply chain: the code you didn't write is still your risk

Why it matters

The first two serverless labs taught you that in Lambda there is no host to patch and no port to close, so the execution role and the network are the whole perimeter. That is true — but it hides a second half of the shared-responsibility bargain. AWS patches the runtime and the operating system underneath your function. It does NOT patch the third-party libraries you import. Every `pip install` pulls in code written by strangers that will run inside your function, with your function's execution role, on your account — and a large fraction of real serverless incidents are not clever attacks on…

What you'll learn

Steps in this lab

  1. The other half of serverless: you still own the code you didn't write
  2. Set your Region and your budget contract before you build anything
  3. Build a function that NEEDS a library it doesn't have — and watch it crash
  4. Package the dependency as a LAYER — the python/ structure everyone gets wrong
  5. The risk made visible: inventory the layer (SBOM) and scan it for CVEs
  6. The fix: pin exact versions WITH HASHES so the bytes you scanned are the bytes that run
  7. Harden and do it better: own your layers, scan in CI, let Inspector watch
  8. Judgment: when a public layer is fine, and why 'it works in the demo' isn't 'it's safe'
  9. Clean up: delete the function, every layer version, and the role
  10. What you did, and why it matters

Open the full interactive lab →