TEST-INFRA: [ci-pipeline-design] Add security scanning to Dockerfile.server #10954

Merged
HAL9000 merged 10 commits from chore/ci-dockerfile-server-security-scan into master 2026-06-18 04:36:00 +00:00

10 Commits

Author SHA1 Message Date
CleverAgents Bot 9805a865cb fix(ci): make Dockerfile.server Trivy gate actionable
CI / load-versions (pull_request) Successful in 17s
CI / push-validation (pull_request) Successful in 24s
CI / lint (pull_request) Successful in 33s
CI / build (pull_request) Successful in 30s
CI / quality (pull_request) Successful in 1m4s
CI / typecheck (pull_request) Successful in 1m13s
CI / security (pull_request) Successful in 1m9s
CI / helm (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 5m31s
CI / docker (pull_request) Successful in 2m24s
CI / integration_tests (pull_request) Successful in 8m50s
CI / coverage (pull_request) Successful in 11m58s
CI / status-check (pull_request) Successful in 3s
2026-06-18 00:16:54 -04:00
HAL9000 21e763f59d fix(ci): run Trivy via Docker Hub image instead of github.com tarball
The docker gate has been failing on `curl: (22) ... error: 404` against
the v0.58.0 GitHub release tarball even after pinning the version. The
helm gate's kubeconform download from github.com/yannh/kubeconform works
in the same workflow, so it's a Trivy-asset-path-specific 404 (URL/CDN
state we don't control), not a blanket github.com block.

Switch to `aquasec/trivy:0.58.0` pulled from Docker Hub:

- Docker Hub is already proven reachable by the preceding `docker build`
  steps (server image base layers pull successfully in this same dind
  job).
- A pinned tag's manifest digest is itself the verifiable artifact — no
  separate checksum file fetch and grep dance.
- Trivy runs against the just-built `cleveragents-server:test` image
  via the mounted dind docker socket.
- Same severity gating (`--severity HIGH,CRITICAL --exit-code 1`) and
  same trailing detailed-report step are preserved verbatim.

ISSUES CLOSED: #1927
2026-06-18 00:16:54 -04:00
CleverAgents Bot 5fb638db1f ci: rerun docker gate after runner socket contention 2026-06-18 00:16:54 -04:00
cleveragents-auto dbf52e9fa1 chore: re-trigger CI after docker runner socket contention 2026-06-18 00:16:54 -04:00
controller-ci-rerun de04d69dbf chore: re-trigger CI [controller] 2026-06-18 00:16:54 -04:00
HAL9000 f6e403f329 fix(ci): pin Trivy to v0.58.0 (v0.57.1 is not a real release)
The prior pin used TRIVY_VERSION=0.57.1, but Trivy never published a
v0.57.1 tag — the release sequence went v0.57.0 → v0.58.0. The CI
docker job consequently failed with `curl: (22) The requested URL
returned error: 404` when fetching trivy_0.57.1_Linux-64bit.tar.gz.

- Bump TRIVY_VERSION to 0.58.0 (the first stable release after v0.57.0).
- Factor the GitHub release base URL into TRIVY_BASE_URL.
- Add explicit `set -euo pipefail` so each curl failure surfaces
  immediately instead of relying on the runner's implicit -e.
- Anchor the checksum grep with ` ${TRIVY_TARBALL}$` so a partial
  filename match cannot smuggle in the wrong checksum line.
- Wrap the checksum verification in a subshell so `cd /tmp` does not
  affect later commands.

ISSUES CLOSED: #1927
2026-06-18 00:16:54 -04:00
controller-ci-rerun 8476e5a1f7 chore: re-trigger CI [controller] 2026-06-18 00:16:54 -04:00
controller-ci-rerun 7c3a4f5f43 chore: re-trigger CI [controller] 2026-06-18 00:16:54 -04:00
HAL9000 c3c3c224c4 fix(ci): address reviewer feedback on Dockerfile.server security scan
- Pin Trivy installation to v0.57.1 with checksum verification instead
  of the insecure curl-pipe-sh install pattern
- Fix BDD step context initialization: load workflow_content in the
  Background step so scenarios 17/24/31 no longer error with AttributeError
- Fix ruff format violations in step definitions
- Add Robot Framework integration test verifying CI scan configuration
- Add CHANGELOG entry for issue #1927

ISSUES CLOSED: #1927
2026-06-18 00:16:54 -04:00
HAL9000 4f924d5c59 chore(ci): add vulnerability scanning for Dockerfile.server image
Added Trivy-based security scanning to the CI pipeline for the Dockerfile.server image.
The scan is configured to fail the build on any HIGH or CRITICAL severity vulnerabilities,
preventing insecure images from being deployed to production.

Changes:
- Added security scan step to .forgejo/workflows/ci.yml docker job
- Trivy is installed and executed after building the Dockerfile.server image
- Scan results are displayed in CI job output with detailed vulnerability report
- Build fails (non-zero exit) if HIGH or CRITICAL vulnerabilities are detected
- Added BDD feature file and step definitions for security scanning verification
2026-06-18 00:16:54 -04:00