Skip to content

Feature/lab9#1395

Open
Dnau15 wants to merge 15 commits into
inno-devops-labs:mainfrom
Dnau15:feature/lab9
Open

Feature/lab9#1395
Dnau15 wants to merge 15 commits into
inno-devops-labs:mainfrom
Dnau15:feature/lab9

Conversation

@Dnau15

@Dnau15 Dnau15 commented Jul 7, 2026

Copy link
Copy Markdown

Goal

Complete Lab 9 (DevSecOps): scan QuickNotes with Trivy and ZAP, triage every finding, and fix findings in code with guarded evidence.

Changes

  • app/middleware.go — security-headers middleware on all routes (CSP default-src 'none', X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: no-referrer, Cache-Control: no-store, Cross-Origin-Resource-Policy: same-origin); wired via Server.Handler() in main.go — fixes ZAP 10021, 10049, 90004
  • app/middleware_test.go — unit test asserting all six headers on every route (incl. 404 paths); fails if the middleware is removed
  • app/Dockerfile — builder bumped golang:1.24-alpine1.26-alpine (fixes 10 HIGH stdlib CVEs found by Trivy: image scan 10 HIGH → 0) + HEALTHCHECK instruction (fixes Trivy AVD-DS-0026)
  • submissions/lab9/ — scan artifacts: Trivy image/fs/config reports (before + after), CycloneDX SBOM, ZAP baseline HTML/JSON reports (before + after, root and /notes targets)
  • submissions/lab9.md — full triage table for every HIGH/CRITICAL and every ZAP finding (FIX / ACCEPT / FALSE POSITIVE with reasons and re-eval dates), before/after evidence, design questions a–g answered. Bonus task not attempted

Testing

  • go vet ./... and go test -race -count=1 ./... pass
  • Guard proof: removing the middleware from Handler() makes TestSecurityHeaders_PresentOnAllRoutes fail (24 assertions across 5 routes) — output captured in the report
  • ZAP baseline re-run after the fix: 10021, 10049, 90004 gone from the report (moved to PASS)
  • Trivy image re-scan after rebuild: 10 HIGH → 0 HIGH/CRITICAL
  • curl -si localhost:8080/health shows all six security headers

Checklist

  • Title is a clear sentence (≤ 70 chars)
  • Commits are signed (git log --show-signature)
  • submissions/labN.md updated

Dnau15 and others added 15 commits June 5, 2026 14:04
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
…blickey-denied pitfalls

Signed-off-by: Dmitrii Creed <creeed22@gmail.com>
…n; set honest cache expectations

- 2.2: matrixed jobs report as 'test (1.23)' etc.; the old required
  'test'/'vet' contexts hang at 'Expected' and block every student PR.
  Document both fixes (rename required checks / require a single ci-ok
  aggregation job with if: always())
- 2.4: QuickNotes has zero deps, so cache on/off won't move wall-clock;
  ask students to explain why + compare per-step timings instead
- pitfalls for both

Signed-off-by: Dmitrii Creed <creeed22@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
…ook, Checkly

Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Signed-off-by: Dmitrii <15dnau@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants