CompCode Academy

Lesson 2 of 4 · Free to read

Exercises

Exercises — Security & Supply Chain

Watch & learn

Course video

Open on YouTube
OWASP Top 10: Injection Attacks — Security lens for AI-written handlers and queries.

Course video

Open on YouTube
Stop Vibe Coding. Use This Instead. — Spec-driven recovery from “accept all” failure modes.

Keep a prompt log while you work. Speed without a trail is not a skill — it is luck.

Exercise 1 — Fix 3 OWASP issues in the sample app

Goal: locate and fix 3 planted OWASP issues in security_lab/. Time: 30 minutes Level: intermediate

Steps

  1. cd code-examples/python/security_lab/.
  2. Read the planted code in app/. Find: SQL injection / SSRF / secret-in-code.
  3. Fix each. Add a test that would have caught the issue.

Success criteria

  • 3 fixes committed.
  • 3 regression tests added.

AI prompt hints

  • "Identify the SQL injection in this snippet. Propose a parametrised version."

Exercise 2 — SBOM + signing

Goal: build the image; generate SBOM with Syft; sign with Cosign (or simulate). Time: 25 minutes Level: intermediate

Steps

  1. docker build -t lab .
  2. syft packages lab -o spdx-json > sbom.json
  3. cosign sign --key cosign.key lab (or cosign sign --keyless lab for OIDC flow)
  4. Verify.

Success criteria

  • sbom.json exists.
  • Signature attached / verifiable.

AI prompt hints

  • "Walk me through the cosign keyless flow; what changes vs key-based?"

Exercise 3 — Triage 3 CVEs

Goal: open CVES.md; for each, decide false / real / mitigate-now and justify. Time: 30 minutes Level: intermediate

Steps

  1. Read each CVE entry.
  2. For each: rate exploitability in your context; check fix availability; decide.
  3. Log in TRIAGE.md.

Success criteria

  • 3 decisions with reasoning that cites context (not just CVSS).

AI prompt hints

  • "Summarise this CVE in 3 lines. Then list the 3 questions I should ask to decide if it's exploitable in my context."

New free lessons and course updates. Unsubscribe from any email.