Skip to content

feat: restore Trivy scanning via Socket-built distribution - #100

Draft
lelia wants to merge 3 commits into
mainfrom
restore-trivy-socket-dist
Draft

feat: restore Trivy scanning via Socket-built distribution#100
lelia wants to merge 3 commits into
mainfrom
restore-trivy-socket-dist

Conversation

@lelia

@lelia lelia commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What

Restores Trivy-backed container/Dockerfile/vulnerability scanning to the pre-built images. Trivy now comes from Socket's own build — rebuilt from unmodified upstream source (currently v0.73.0) and pinned by digest via a TRIVY_IMAGE build arg — instead of upstream-published binaries/images.

Changes

  • Dockerfile / Dockerfile.heavy: trivy stage restored from ghcr.io/socketdev/trivy:0.73.0@sha256:e3d9d5f1…; COPY --from=trivy re-enabled; the com.socket.trivy-version label now matches an actually-present binary.
  • app_tests/Dockerfile: was still pulling aquasec/trivy:0.69.3 from Docker Hub by mutable tag — converted to the same digest-pinned Socket image.
  • CI: GHCR login now runs in every _docker-pipeline mode (the base image is private), with packages: read granted in callers.
  • Smoke tests: removed the temporary MUST_NOT_EXIST_TOOLS guard; added trivy --version to all check sets, plus two new assertions — the binary version must agree with the Dockerfile pin, and trivy config --format json (the connector's exact invocation) must succeed on a fixture.
  • Dependabot: aquasec/trivy removed from docker allow-lists — trivy updates flow through the Socket release process only.
  • Docs: repo-wide removal of the "temporarily ships without Trivy" messaging (README + 6 docs + action.yml input descriptions); native-install warnings about 0.69.40.69.6 retained; APT instructions fixed to the generic distribution (upstream packaging change in v0.72.0).

No Python changes: the connector is config-driven and needed none.

Notes for reviewers

  • Local builds need pull access to ghcr.io/socketdev/trivy; without it: docker build --build-arg TRIVY_IMAGE=aquasec/trivy:0.73.0 .
  • The repo's Actions have package read access already granted, so PR CI should build and smoke-test the restored image end-to-end — that run is the real validation of this PR.
  • Draft until smoke/integration CI is green and messaging gets a CE once-over.

Trivy returns to the main, heavy, and app_tests images as a Socket-built
distribution: rebuilt from unmodified upstream source (v0.73.0) by Socket's
own release pipeline and pinned by digest (TRIVY_IMAGE build arg; override
available for builds without registry access).

- Dockerfiles: digest-pinned trivy stage restored; version label now truthful
- CI: GHCR login on every build mode (private base image) + packages: read
- Smoke tests: drop the removal guard; verify trivy presence, version-pin
  agreement, and a functional 'trivy config' scan (the connector's code path)
- Dependabot: trivy untracked by design — updates flow from the Socket
  release process, never independent bumps
- Docs: removed the temporarily-disabled messaging repo-wide; kept the
  0.69.4-0.69.6 warnings for native installs; fixed the APT example to the
  'generic' distribution (upstream change in trivy v0.72.0)

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia
lelia temporarily deployed to socket-firewall August 5, 2026 06:08 — with GitHub Actions Inactive
Batch with the Trivy restore since this warrants a major point release:
TruffleHog 3.93.8 -> 3.96.0, OpenGrep v1.16.5 -> v1.26.0, uv 0.10.11 -> 0.12.1,
gosec v2.24.7 -> v2.28.0 (app_tests), Go 1.24.1 -> 1.26.5 (app_tests),
Socket CLI 2.5.0 -> 2.5.8 (heavy). Runtime bases (python:3.12, node:22)
deliberately deferred to their own PR.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia

lelia commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Added the OSS toolchain refresh to this PR (major point release anyway): TruffleHog → 3.96.0, OpenGrep → v1.26.0, uv → 0.12.1, gosec → v2.28.0, Go → 1.26.5 (app_tests), Socket CLI → 2.5.8 (heavy). Runtime bases (python:3.12, node:22) deliberately not bumped here — those change the shipped runtime rather than the scanner toolchain and should get their own PR. CI smoke/integration runs validate every bump in this set.

@lelia
lelia temporarily deployed to socket-firewall August 5, 2026 06:11 — with GitHub Actions Inactive
The app_tests image predates the socket_basics layout migration: its
COPY src/... and entrypoint.sh references no longer exist anywhere in the
repo, so it could not build at all (its CI job only fires on app_tests
changes and had not run since). Drop the stale references (tools image for
now; modernizing the harness is follow-up work) and build with app_tests/
as the context so its own pyproject/uv.lock and fixtures resolve.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia
lelia deployed to socket-firewall August 5, 2026 07:44 — with GitHub Actions Active
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.

1 participant