Skip to content

ci: add periodic security-scan cron workflow (#72)#74

Merged
ilmoniemi merged 3 commits into
mainfrom
feature/72
May 12, 2026
Merged

ci: add periodic security-scan cron workflow (#72)#74
ilmoniemi merged 3 commits into
mainfrom
feature/72

Conversation

@ilmoniemi
Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/security-scan.yml — a scheduled workflow that re-runs the same two security scanners that gate PRs (image-scan Trivy from #68 and govulncheck from #41) against the latest main SHA, on a daily cron (06:00 UTC) plus workflow_dispatch for manual re-runs.

The goal is to close the post-merge invisibility window: CVEs disclosed today against deps that haven't changed since the last PR otherwise produce no signal until someone next bumps the affected dep. The cron caps that window at ~24h via a red row in the Actions list. Auto-issue filing on top of that signal is deferred to #73.

Issue

Closes #72.

Testing

Architecture compliance

Follows docs/specs/architecture/72-periodic-security-scan.md verbatim:

🤖 Generated with Claude Code

ilmoniemi and others added 2 commits May 12, 2026 20:36
Adds .github/workflows/security-scan.yml that re-runs the Trivy image
scan (#68) and govulncheck (#41) against main on a daily cron and on
workflow_dispatch. Same pin policy, same flags as the PR-time scans;
contents: read only — issues: write deferred to #73.
Runs ci.yml's image-scan (Trivy) and govulncheck jobs against latest
`main` daily at 06:00 UTC, plus workflow_dispatch for manual re-runs.
Closes the post-merge invisibility window where CVEs disclosed against
unchanged deps produce no PR signal.

Pins mirror ci.yml exactly (trivy-action SHA + govulncheck@v1.1.4)
per the lockstep convention. Permissions are contents: read at both
workflow and job level; issues: write for auto-issue filing lands
with #73.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ilmoniemi
Copy link
Copy Markdown
Contributor Author

Code Review: #72

Decision: PASS

Findings

None.

Summary

The PR adds a single new file .github/workflows/security-scan.yml that mirrors the architect's spec verbatim. Verified against ci.yml:

  • Pin lockstep with ci.yml:
    • Trivy action aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 — matches ci.yml:70
    • # Tracks: aquasecurity/trivy-action@v0.36.0 — matches ci.yml:63
    • golang.org/x/vuln/cmd/govulncheck@v1.1.4 — matches ci.yml:43
    • # Tracks: golang.org/x/vuln/cmd/govulncheck@v1.1.4 — matches ci.yml:35
    • actions/checkout@v6, actions/setup-go@v6 with go-version: '1.26.x' — matches ci.yml
  • Trivy flag parity with ci.yml's image-scan job (AC feat(relay): routing-envelope wrapper type (#1) #2): format: table, severity: CRITICAL,HIGH, ignore-unfixed: true, vuln-type: os,library, exit-code: '1' all present ✓
  • gosec correctly NOT ported — spec § Out of scope rationale honoured ✓
  • Schedule: 0 6 * * * daily + workflow_dispatch: (no inputs) ✓
  • Permissions (AC relay: WS upgrade for /v1/server — accept binary connection, validate headers, claim server-id #4): workflow-level permissions: contents: read, job-level contents: read on both jobs, no issues: write (deferred to relay: auto-file GitHub issue when periodic security-scan finds a regression #73) ✓
  • Explicit ref: main on checkout — guarantees the scan targets main even on a feature-branch workflow_dispatch
  • Two parallel jobs, no needs: — independent surfaces produce independent check entries per spec § Why two parallel jobs ✓

Security review (label: security-sensitive)

  1. Architect's security-review section present. Spec docs/specs/architecture/72-periodic-security-scan.md § Security review exists with verdict PASS and the eight-section findings list (trust boundaries, secrets, file ops, subprocess, crypto, network, logs, concurrency, threat-model alignment) plus five adversarial scenarios. ✓
  2. Diff matches the spec's findings. Walked the security goggles patterns:
    • Tokens / secrets: no ${{ secrets.* }} references, no token logging.
    • File operations: none beyond docker build (runner-local) and go install (runner-local).
    • Subprocess: only fixed command strings; the one interpolation ${{ github.sha }} is a 40-char hex SHA, shell-safe.
    • Crypto: no new crypto; inherits the commit-SHA pin (Trivy) and Go module checksum-DB (govulncheck) controls.
    • Network: no listeners; egress targets identical to ci.yml.
    • gosec / govulncheck: workflow adds no Go code, no // #nosec annotations.

CI checks test is green; security and image-scan were still pending at review time — both will be exercised again post-merge via the workflow_dispatch step in the AC #6 verification plan.

Recommend merge.

Add per-ticket codebase notes for #72, fold periodic re-scan into the
docker-image feature doc + threat-model § Supply chain so the post-merge
invisibility window is documented as closed, and extend the INDEX entry
accordingly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ilmoniemi ilmoniemi merged commit a9be1a3 into main May 12, 2026
3 checks passed
@ilmoniemi ilmoniemi deleted the feature/72 branch May 12, 2026 17:41
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.

relay: periodic security-scan cron workflow (re-runs Trivy + govulncheck against main)

1 participant