Skip to content

fix: install osv-scanner for air-gap; add feeds update command; drop redundant preflight - #41

Merged
pshickeydev merged 1 commit into
traust-security:mainfrom
pshickeydev:fix/osv-scanner-standalone-install
Oct 28, 2026
Merged

pshickeydev merged 1 commit into
traust-security:mainfrom
pshickeydev:fix/osv-scanner-standalone-install

Conversation

@pshickeydev

Copy link
Copy Markdown
Member

What

Three fixes for the traust v0.43.0 container build:

  1. Install osv-scanner directly for the air-gapped offline database step.
    Since v0.43.0 osv-scanner is adopter-provided (consumers: [] in
    external-tools.yaml), so the toolchain profile no longer installs it.
    This image is itself the adopter — it now fetches the binary from the
    GitHub release (pinned to 2.7.0, matching the expected version in
    external-tools.yaml).

  2. traust-cli feeds update — new command that refreshes the grype DB
    (staleness-checked via --max-age, default 5 days) and OSV offline
    databases at container start. Fails open on every error path. OSV refresh
    uses mtime comparison to distinguish actually-refreshed DBs from
    unchanged baked fallbacks. Context deadline (--timeout, default 90s)
    prevents hanging tools from blocking startup. All output goes to stderr.

    The entrypoint wrapper calls traust-cli feeds update >&2 || true before
    exec traust-cli "$@", bounded by timeout (default 120s).
    SKIP_FEED_UPDATE=1 bypasses entirely.

  3. Remove ecosystem-cert-preflight-checks from the traust-cli push
    and pull-request pipelines. The traust-cli image is FROM scratch (static
    Go binary), which fails BasedOnUbi, HasNoProhibitedPackages, and
    HasModifiedFiles. The traust-enterprise-contract integration test
    scenario handles scratch images and already passes.

Tests

10 tests in internal/feeds/:

  • Grype: current, stale+success, stale+failure, not-installed, context-timeout
  • OSV: not-installed, failed-with-baked-DBs (mtime unchanged → not falsely
    "refreshed"), actual-refresh (mtime advances → "refreshed"), no-databases,
    context-timeout

Verified with real osv-scanner against the baked Go DB from the old image:
--download-offline-databases refreshes stale files (mtime and content both
changed).


This PR description is AI-generated (Claude Opus 4).

…redundant preflight

The traust v0.43.0 tag moved osv-scanner to adopter-provided
(consumers: [] in external-tools.yaml), so the secure-code-audit
toolchain profile no longer installs it. The toolkit-plus-feeds
image is itself the adopter: it now installs osv-scanner directly
from the GitHub release (pinned to 2.7.0) in the assemble stage.

Add `traust-cli feeds update [--max-age 120h] [--timeout 90s]`:
refreshes the grype DB (staleness-checked) and OSV offline databases
at container start. Fails open on every error path — network
failures, tool crashes, and timeouts log a warning and leave the
baked databases in place. OSV refresh correctness is mtime-based:
pre-existing baked DBs that were not rewritten are reported as
unchanged fallbacks, not falsely as refreshed.

The entrypoint wrapper calls `traust-cli feeds update` with all
output to stderr (preserving command stdout), bounded by
`timeout` (default 120s). SKIP_FEED_UPDATE=1 bypasses entirely.

Remove ecosystem-cert-preflight-checks from the traust-cli push
and pull-request pipelines. The traust-cli image is FROM scratch
(a static Go binary with no base OS), which fails the BasedOnUbi,
HasNoProhibitedPackages, and HasModifiedFiles preflight checks.
The traust-enterprise-contract integration test scenario already
handles scratch images and passes.

Assisted-by: Claude Opus 4
@pshickeydev
pshickeydev requested a review from a team as a code owner October 28, 2026 01:09
@pshickeydev
pshickeydev merged commit 48554e9 into traust-security:main Oct 28, 2026
4 of 6 checks passed
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