Chapter 3. Retesting

Artifacts Delta — Current vs Previous

This table summarizes what changed in the security artifacts after the latest fixes.
Use the “Verify” commands (right column) to reproduce the numbers locally.

ToolMetric (scope)BeforeAfterΔEvidence file(s)Verify locally
TrivyHigh vulns (image)10−1artifacts/trivy-image.json`jq ‘[.Results[]?.Vulnerabilities[]?
SemgrepFindings total (Go app)N/AN/Aartifacts/semgrep.json`jq ‘.results?
SemgrepXSS (reflected)(not flagged)(not flagged)(manual validation)Visit http://…/echo?input=<script>alert(1)</script> → script should not execute
TruffleHogVerified secrets (app/ only)000artifacts/trufflehog.json`jq -c ‘select(.Source==“filesystem” and (.Verified==true))’ artifacts/trufflehog.json
CheckovFailed checks (K8s manifests)XYΔXartifacts/checkov.json`jq ‘.summary? // {}
CheckovKey hardening present (seccomp, caps drop, probes, SA token, ns)presentinfra/k8s/deployment.yaml`grep -nE ‘seccompProfile
ZAPHigh / Medium alerts (baseline)0 / M0 / M’artifacts/zap/report.json (if present)`jq -r ‘[.site[]?.alerts[]?

Notes

  • Trivy: expect High=0 after upgrading the Go toolchain/base image (e.g., golang:1.24.6-alpine).
  • Semgrep: our fix removes the reflected XSS behavior (manual validation); your ruleset may not have flagged it originally.
  • TruffleHog: canary strings should be removed or allow-listed; we block only on verified credentials.
  • Checkov: after adding probes, seccomp, caps drop, SA token hardening, namespace, and basic NetPols, failures should drop significantly.
  • ZAP: baseline tends to report header hygiene as Medium/Low; after adding headers (CSP/XFO/XCTO/HSTS*), counts should reduce (HSTS only with TLS).

How to Refresh This Table

  1. Capture a “before” snapshot (optional if you already have one):

    rm -rf artifacts_before && mkdir -p artifacts_before
    cp -a artifacts/* artifacts_before/ 2>/dev/null || true
    
  2. Apply Fixes and re-run scans:

make build sca
make sast secrets
make iac
make cd
make zap
  1. Make delta table
bash scripts/artifacts_delta.sh > artifacts/ARTIFACTS.md
echo "Wrote artifacts/ARTIFACTS.md"

How to reproduce

optional: snapshot current as “before”

rm -rf artifacts_before && mkdir -p artifacts_before cp -a artifacts/* artifacts_before/ 2>/dev/null || true

regenerate table

bash scripts/artifacts_delta.sh > artifacts/ARTIFACTS.md


Makefile convenience target

Add this to your starter Makefile so readers can do make artifacts-delta:

artifacts-delta:
	@bash scripts/artifacts_delta.sh > artifacts/ARTIFACTS.md
	@echo "Wrote artifacts/ARTIFACTS.md"