Skip to main content

Local security workflow

Security checks run on the workstation. The scanners inspect checked-out source and lockfiles locally; they do not upload either to a scan service. Network access is used only to install pinned scanner binaries, fetch Go modules during bootstrap, and update public vulnerability databases.

One-time setup​

make security-tools-install
make security-db-update

This installs hash-verified Trivy v0.75.0 and Gitleaks v8.30.1 release binaries into $(go env GOPATH)/bin and downloads the Go and Trivy vulnerability databases into ~/.cache/yabanin-security and Trivy's local cache (on macOS, ~/Library/Caches/trivy). Keep the Go binary folder on PATH. Update databases daily; a missing or older-than-24-hours database is a failed check, not a clean scan:

make security-db-update
make security-db-status

During development​

Start a local worker on the current branch:

make security-start
make security-status
make security-stop

The worker checks the branch every ten seconds. It collapses pending commits to the latest SHA, preserves the full unscanned range for secret detection, and performs one scan at a time in a disposable detached worktree. The active development tree remains available. The worker does not install Git hooks or send messages to an external service. A successful earlier SHA never stands in for the current branch tip.

For an immediate single-commit scan:

make security-scan SECURITY_HEAD=HEAD SECURITY_BASE=<last-checked-sha>

Omit SECURITY_BASE for the first scan; the secret scanner checks the reachable commit history. Read the manifest path in the worker report under artifacts/security-local/reports/. The ordinary quality manifest there is bound to the source fingerprint and has per-gate logs.

Runtime and release checks​

make security-runtime SECURITY_HEAD=<sha>
make security-release SECURITY_HEAD=<sha> SECURITY_IMAGE=<local-image-tag>

Runtime checks require a working local Docker daemon. They run the existing race, module integration, RLS and gateway integration tests against the isolated checkout. The release profile also scans the supplied local image by its local Docker reference; it never pulls or pushes that image. Findings appear in the quality manifest and block a passing result.

Result meanings​

passed means every selected gate completed successfully for that SHA and the exact manifest can be checked with quality.py evidence. failed means the scanners ran and reported a finding or a quality check failed. A database or scanner error is shown as an error and remains queued for retry. Inspect the named gate log for details; secret scanner output redacts matched values.

Exceptions must identify the scanner finding, exact package/version or secret rule and path, an owner, a reason, and an expiry. A package-level exception must never suppress other findings in its directory.

The checks cover known secret formats, reachable Go advisories, High/Critical dependency and image vulnerabilities, static analysis, declared container policy, and existing authorization/tenant/SSRF tests. They do not prove the absence of vulnerabilities or replace review of security-boundary changes.